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; } } }
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(); }
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); }
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; }
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(); } }
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); }