private void SetData(SellerTicket.JSellerTicket objSeller) { objSeller.Adress = txtAddress.Text; objSeller.Tel = txtTel.Text; objSeller.StationCode = Convert.ToInt32(txtStationName.Tag); objSeller.lat = Convert.ToDecimal(txtLat.Text); objSeller.longs = Convert.ToDecimal(txtLongs.Text); if (jComType.SelectedValue != null) { objSeller.Type = Convert.ToInt32(jComType.SelectedValue); } }
private void LoadData(int PCode) { SellerTicket.JSellerTicket objSeller = new SellerTicket.JSellerTicket(); _Code = PCode; objSeller.GetData(_Code); txtStationName.Tag = objSeller.StationCode; Station.JStation station = new Station.JStation(objSeller.StationCode); Zone.JZone zone = new Zone.JZone(station.ZoneCode); txtStationName.Text = zone.Name + " - " + station.Name; txtAddress.Text = objSeller.Adress; txtTel.Text = objSeller.Tel; txtLat.Text = objSeller.lat.ToString(); txtLongs.Text = objSeller.longs.ToString(); txtTel.Text = objSeller.Tel; JSellerTicketTypes types = new JSellerTicketTypes(); types.SetComboBox(jComType, objSeller.Type); LoadSellers(); }
private bool Save() { bool result = false; if (Validate()) { SellerTicket.JSellerTicket objSeller = new SellerTicket.JSellerTicket(_Code); SetData(objSeller); if (State == ClassLibrary.JFormState.Insert) { _Code = objSeller.Insert(); result = _Code > 0; } else { if (State == ClassLibrary.JFormState.Update) { result = objSeller.Update(); } } State = ClassLibrary.JFormState.Update; } return(result); }