Esempio n. 1
0
 private void grdStation_OnRowDBClick(object Sender, Janus.Windows.GridEX.RowActionEventArgs e)
 {
     if (grdStation.SelectedRow != null)
     {
         SelectedStation = new JStation();
         if (SelectedStation.GetData(System.Convert.ToInt32(grdStation.SelectedRow.Row["Code"])))
         {
             DialogResult = System.Windows.Forms.DialogResult.OK;
         }
     }
 }
Esempio n. 2
0
 private void SetData(JStation Auto)
 {
     Auto.Code = Code;
     try { Auto.Lat = Convert.ToDecimal(Lat); }
     catch { Auto.Lat = 0; }
     try { Auto.Lng = Convert.ToDecimal(Lng); }
     catch { Auto.Lng = 0; }
     Auto.Name            = txtName.Text;
     Auto.ZoneCode        = Convert.ToInt32(jComZone.SelectedValue);
     Auto.StationTypeCode = Convert.ToInt32(cboStationType.SelectedValue);
     SetDefalut();
 }
Esempio n. 3
0
        public void SetDefalut()
        {
            JZones Zone = new JZones();

            jComZone.DataSource    = JZones.GetDataTable();
            jComZone.DisplayMember = "Name";
            jComZone.ValueMember   = "Code";
            JStationTypes StationTypes = new JStationTypes();
            JStation      station      = new JStation(Code);

            StationTypes.SetComboBox(cboStationType, station.StationTypeCode);
        }
Esempio n. 4
0
        private void Load1(int pCode)
        {
            JStation Auto = new JStation();

            Auto.GetData(pCode);
            txtName.Text = Auto.Name;
            try { Lat = Convert.ToDouble(Auto.Lat); }
            catch { Lat = 0; }
            try { Lng = Convert.ToDouble(Auto.Lng); }
            catch { Lng = 0; }
            txtLat.Text                  = Lat.ToString();
            txtLng.Text                  = Lng.ToString();
            jComZone.SelectedValue       = Auto.ZoneCode;
            cboStationType.SelectedValue = Auto.StationTypeCode;
        }
Esempio n. 5
0
 public void Delete()
 {
     if (ClassLibrary.JMessages.Question("آیا تمایل دارید مورد انتخاب شده حذف گردد", "اخطار!") == System.Windows.Forms.DialogResult.Yes)
     {
         JStation objStation = new JStation();
         objStation.Code = Code;
         if (objStation.Delete())
         {
             Close();
         }
         else
         {
             ClassLibrary.JMessages.Message("پردازش با خطا مواجه شد", "", ClassLibrary.JMessageType.Error);
         }
     }
     else
     {
         Close();
     }
 }
Esempio n. 6
0
        private int Save()
        {
            JStation objAutoDefine = new JStation();

            SetData(objAutoDefine);
            if (State == ClassLibrary.JFormState.Insert)
            {
                Code = objAutoDefine.Insert();
            }
            else
            if (State == ClassLibrary.JFormState.Update)
            {
                objAutoDefine.Update();
            }
            State = ClassLibrary.JFormState.Update;
            if (Code > 0)
            {
                jPropertyValue.ValueObjectCode = Code;
                jPropertyValue.Save();
            }
            return(Code);
        }