private void delete(ListGridRecord listGridRecord) {
    try {
      com.smartgwt.client.rpc.RPCManager.startQueue();

      Record record = new Record();
      record.setAttribute(
          "loggedUserName", CommonSingleton.getInstance().getSessionPerson().getUser_name());
      record.setAttribute(
          "billing_company_id", listGridRecord.getAttributeAsInt("billing_company_id"));

      DSRequest req = new DSRequest();
      req.setAttribute("operationId", "removeBillingComp");

      billingCompsGrid.removeData(
          record,
          new DSCallback() {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) {}
          },
          req);
      com.smartgwt.client.rpc.RPCManager.sendQueue();
    } catch (Exception e) {
      SC.say(e.toString());
    }
  }
  private void save() {
    try {
      Record records[] = listGrid.getRecords();

      Integer mainIdList[] = new Integer[records.length];
      int i = 0;
      for (Record record : records) {
        mainIdList[i++] = record.getAttributeAsInt("main_id");
      }
      DataSource dataSource = DataSource.get("OrgDS");
      com.smartgwt.client.rpc.RPCManager.startQueue();
      Record record = new Record();
      record.setAttribute("mainIdList", mainIdList);
      record.setAttribute(
          "loggedUserName", CommonSingleton.getInstance().getSessionPerson().getUserName());
      DSRequest req = new DSRequest();
      req.setAttribute("operationId", "updateMainServiceOrders");
      dataSource.updateData(
          record,
          new DSCallback() {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) {
              destroy();
              tabOrganization.search();
            }
          },
          req);
      com.smartgwt.client.rpc.RPCManager.sendQueue();

    } catch (Exception e) {
      e.printStackTrace();
      SC.say(e.toString());
    }
  }
  private void changeStatus(Integer calendar_id, Integer deleted) {
    try {
      com.smartgwt.client.rpc.RPCManager.startQueue();
      Record record = new Record();
      record.setAttribute("deleted", deleted);
      record.setAttribute("calendar_id", calendar_id);
      record.setAttribute(
          "loggedUserName", CommonSingleton.getInstance().getSessionPerson().getUserName());
      DSRequest req = new DSRequest();

      req.setAttribute("operationId", "updateSecularCalendarStatus");
      listGrid.updateData(
          record,
          new DSCallback() {
            @Override
            public void execute(DSResponse response, Object rawData, DSRequest request) {}
          },
          req);
      com.smartgwt.client.rpc.RPCManager.sendQueue();
    } catch (Exception e) {
      SC.say(e.toString());
    }
  }
  private void saveCountry() {
    try {
      String cityNameGeo = cityNameGeoItem.getValueAsString();
      if (cityNameGeo == null || cityNameGeo.trim().equalsIgnoreCase("")) {
        SC.say("შეიყვანეთ ქართული დასახელება !");
        return;
      }

      String town_code = cityCodeItem.getValueAsString();
      //			if (town_code == null || town_code.trim().equalsIgnoreCase("")) {
      //				SC.say("შეიყვანეთ ქალაქის კოდი !");
      //				return;
      //			}
      String town_code_new = cityNewCodeItem.getValueAsString();

      ListGridRecord country_record = countryItem.getSelectedRecord();
      if (country_record == null || country_record.getAttributeAsInt("country_id") == null) {
        SC.say("გთხოვთ აირჩიოთ ქვეყანა !");
        return;
      }
      Integer country_id = country_record.getAttributeAsInt("country_id");

      if (cityNameGeo.length() > 1005) {
        SC.say("ქართული დასახელება შედგება მაქსიმუმ 155 სიმბოლოსაგან !");
        return;
      }
      //			if (town_code.length() > 180) {
      //				SC.say("ქალაქის კოდი შედგება მაქსიმუმ 90 სიმბოლოსაგან !");
      //				return;
      //			}
      //			if (town_code_new != null && town_code_new.length() > 180) {
      //				SC.say("ქალაქის ახალი კოდი შედგება მაქსიმუმ 90 სიმბოლოსაგან !");
      //				return;
      //			}

      ListGridRecord city_type_record = townTypeItem.getSelectedRecord();
      if (city_type_record == null
          || city_type_record.getAttributeAsInt("description_id") == null) {
        SC.say("გთხოვთ აირჩიოთ ქალაქის ტიპი !");
        return;
      }
      Integer town_type_id = city_type_record.getAttributeAsInt("description_id");

      String capital_town_record = isCapitalItem.getValueAsString();
      if (capital_town_record == null || capital_town_record.trim().equals("")) {
        SC.say("გთხოვთ აირჩიოთ ქალაქის სახეობა !");
        return;
      }
      Integer capital_town = Integer.parseInt(capital_town_record);

      //			try {
      //				Integer.parseInt(town_code);
      //			} catch (NumberFormatException e) {
      //				SC.say("ქალაქის კოდის შედგება მხოლოდ ციფრებისაგან !");
      //				return;
      //			}
      //			if (town_code_new != null && !town_code_new.equals("")) {
      //				try {
      //					Integer.parseInt(town_code_new);
      //				} catch (NumberFormatException e) {
      //					SC.say("ქალაქის ახალი კოდის შედგება მხოლოდ ციფრებისაგან !");
      //					return;
      //				}
      //			}
      String normal_gmt = ofGmtItem.getValueAsString();
      if (normal_gmt == null || normal_gmt.trim().equals("")) {
        SC.say("გთხოვთ შეიყვანოთ დრო !");
        return;
      }
      try {
        Integer.parseInt(normal_gmt);
      } catch (NumberFormatException e) {
        SC.say("დრო შედგება მხოლოდ ციფრებისაგან !");
        return;
      }
      String winter_gmt = ofGmtWinterItem.getValueAsString();
      if (winter_gmt == null || winter_gmt.trim().equals("")) {
        SC.say("გთხოვთ შეიყვანოთ ზამთრის დრო !");
        return;
      }
      try {
        Integer.parseInt(winter_gmt);
      } catch (NumberFormatException e) {
        SC.say("ზამთრის დრო შედგება მხოლოდ ციფრებისაგან !");
        return;
      }

      com.smartgwt.client.rpc.RPCManager.startQueue();
      Record record = new Record();
      record.setAttribute("town_name", cityNameGeo);
      record.setAttribute("town_code", town_code);
      record.setAttribute("town_new_code", town_code_new);
      record.setAttribute("country_id", country_id);
      record.setAttribute("town_type_id", town_type_id);
      record.setAttribute("capital_town", capital_town);
      record.setAttribute("normal_gmt", normal_gmt);
      record.setAttribute("winter_gmt", winter_gmt);

      if (lCityRecord != null) {
        record.setAttribute("town_id", lCityRecord.getAttributeAsInt("town_id"));
      }
      record.setAttribute(
          "loggedUserName", CommonSingleton.getInstance().getSessionPerson().getUser_name());
      DSRequest req = new DSRequest();

      if (lCityRecord == null) {
        req.setAttribute("operationId", "townAdd");
        cityGrid.addData(
            record,
            new DSCallback() {
              @Override
              public void execute(DSResponse response, Object rawData, DSRequest request) {
                destroy();
              }
            },
            req);
      } else {
        req.setAttribute("operationId", "townUpdate");
        cityGrid.updateData(
            record,
            new DSCallback() {
              @Override
              public void execute(DSResponse response, Object rawData, DSRequest request) {
                destroy();
              }
            },
            req);
      }
      com.smartgwt.client.rpc.RPCManager.sendQueue();
    } catch (Exception e) {
      e.printStackTrace();
      SC.say(e.toString());
    }
  }