Esempio n. 1
0
        void Update_PropertyGrid(object sender, EventArgs e)
        {
            Error.Clear();
            if (SN_Code.SN.Text.Trim() == "")
            {
                Error.SetError(SN_Code.SN, "Выберите короткий номер");
                return;
            }
            if (SN_Code.Code.Text.Trim() == "")
            {
                Error.SetError(SN_Code.Code, "Введите код");
                return;
            }
            map           = db.Map_by_sn_code(SN_Code.SN.Text, SN_Code.Code.Text);
            mapProperties = new MapProperties(map);
            MePropetryGrid.SelectedObject = mapProperties;
            SMSDataGrid.Rows.Clear();
            if (map == null)
            {
                Error.SetError(SN_Code.Code, "По этому номеру и коду ничего не опубликовано");
                DeleteMap.Enabled = false;
                return;
            }
            if (map.Me.idMeType != (int)MeTypeEnum.RandomText)
            {
                Error.SetError(SN_Code.Code, "Это не серия SMS");
                DeleteMap.Enabled   = false;
                SMSDataGrid.Visible = false;
                return;
            }

            SMSDataGrid.Visible = true;

            IQueryable <MePropValue> h = from x in db.MePropValues
                                         where x.idProp == (int)MePropertyEnum.text && x.idMe == map.idMe
                                         select x;

            sms_list = h.ToList();
            foreach (MePropValue b in h)
            {
                SMSDataGrid.Rows.Add(b.sVal);
            }

            UpdateProcessSMSField();

            chooseSellSection.UpdateSection(map.idSellSection);

            // Пока что изменений не было => сохранять нечего
            SaveChanges.Enabled = false;
        }
Esempio n. 2
0
    void Update_PropertyGrid(object sender, EventArgs e) {
      Error.Clear();
      if (SN_Code.SN.Text.Trim() == "") {
        Error.SetError(SN_Code.SN, "Выберите короткий номер");
        return;
      }
      if (SN_Code.Code.Text.Trim() == "") {
        Error.SetError(SN_Code.Code, "Введите код");
        return;
      }
      map = db.Map_by_sn_code(SN_Code.SN.Text, SN_Code.Code.Text);
      mapProperties = new MapProperties(map);
      MePropetryGrid.SelectedObject = mapProperties;
      SMSDataGrid.Rows.Clear();
      if (map == null) {
        Error.SetError(SN_Code.Code, "По этому номеру и коду ничего не опубликовано");
        DeleteMap.Enabled = false;
        return;
      }
      if (map.Me.idMeType != (int) MeTypeEnum.RandomText) {
        Error.SetError(SN_Code.Code, "Это не серия SMS");
        DeleteMap.Enabled = false;
        SMSDataGrid.Visible = false;
        return;
      }

      SMSDataGrid.Visible = true;

      IQueryable<MePropValue> h = from x in db.MePropValues
                                  where x.idProp == (int) MePropertyEnum.text && x.idMe == map.idMe
                                  select x;
      sms_list = h.ToList();
      foreach (MePropValue b in h) {
        SMSDataGrid.Rows.Add(b.sVal);
      }

      UpdateProcessSMSField();

      chooseSellSection.UpdateSection(map.idSellSection);

      // Пока что изменений не было => сохранять нечего
      SaveChanges.Enabled = false;
    }