private void FillListBox() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { String Condition = "[LaderType_T].[SaloonID_int] Is Null"; if (this.State != enmFormState.Add && this.Key != null) { Condition += " Or [LaderType_T].[SaloonID_int]= " + ((HPS.BLL.SaloonBLL.BLLSaloon_TKeys) this.Key).SaloonID_int.ToString(); } List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeList = LaderTypeFactory.GetAllByCondition(Condition); if (LaderTypeList != null && LaderTypeList.Count > 0) { foreach (HPS.BLL.LaderTypeBLL.BLLLaderType_T item in LaderTypeList) { lstLaderTypeCheckBox.Items.Add(item, false); } } this.lstLaderTypeCheckBox.GetType().GetProperty("DisplayMember").SetValue(this.lstLaderTypeCheckBox, HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(), null); this.lstLaderTypeCheckBox.GetType().GetProperty("ValueMember").SetValue(this.lstLaderTypeCheckBox, HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(), null); } catch (Exception ex) { throw ex; } }
protected override void Insert() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { Properties.Settings Setting = new HPS.Properties.Settings(); if (SaloonID_intComboBox.SelectedIndex != -1) { Setting.SaloonID_int = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonID_intComboBox.SelectedValue, TypeCode.Int32); Setting.SaloonIDComboBoxIndex = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonID_intComboBox.SelectedIndex, TypeCode.Int32); Setting.Save(); } else { Setting.SaloonID_int = 0; Setting.SaloonIDComboBoxIndex = 0; Setting.Save(); } this.ClearForm(this); } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
private void AllInfoByDateReportForm_Load(object sender, EventArgs e) { HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); //this.FromTimeTextBox.Text = "08:00:00"; //this.ToTimeTextBox.Text = Factory.ServerTime.ToString(); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); laderTypeGrid.SetDataBinding(LaderTypeID_intDataTable, "LaderTypeID_intDataTable"); //CompanyGroupComboBox Fill. HPS.BLL.CompanyGroupBLL.BLLCompanyGroup_TFactory GroupID_intFatory = new BLL.CompanyGroupBLL.BLLCompanyGroup_TFactory(); DataTable GroupID_intDataTable = new DataTable(); GroupID_intFatory.GetAll(ref GroupID_intDataTable); this.CompanyGroupComboBox.DisplayMember = "GroupName_nvc"; this.CompanyGroupComboBox.ValueMember = "GroupID_int"; this.CompanyGroupComboBox.DataSource = GroupID_intDataTable; this.CompanyGroupComboBox.SelectedIndex = -1; var LadeAssignmentFactory = new BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory(); string LastDate_vc = string.Empty; LadeAssignmentFactory.SelectLastPerBarnameDate(out LastDate_vc); LastDateLabel.Text = LastDate_vc; }
private void FillCombo() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeDataTable = new DataTable(); LaderTypeFactory.GetAll(ref LaderTypeDataTable); this.LaderTypecheckedComboBox.DropDownDataSource = LaderTypeDataTable; this.LaderTypecheckedComboBox.DropDownDataMember = "LaderType_T"; this.LaderTypecheckedComboBox.DropDownDisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypecheckedComboBox.DropDownValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); LaderTypecheckedComboBox.RetrieveStructure(); LaderTypecheckedComboBox.DropDownList.Columns[1].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[2].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[4].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[5].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[6].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[7].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[8].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[9].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[3].Caption = "نوع بارگیر"; LaderTypecheckedComboBox.DropDownList.Columns[3].Width = 300; this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LaderTypeFactory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LaderTypeFactory.ServerJalaliDate); }
protected override void ShowForm() { HPS.BLL.SaloonBLL.BLLSaloon_TFactory SaloonFactory = new HPS.BLL.SaloonBLL.BLLSaloon_TFactory(); HPS.BLL.SaloonBLL.BLLSaloon_T SaloonEntity = SaloonFactory.GetBy((HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key); this.FillListBox(); if (SaloonEntity == null) { throw new Exceptions.SaloonNotFound(); } Saloon_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonEntity.Saloon_nvc, TypeCode.String).ToString(); TurnDistinictAfterCredit_intNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonEntity.TurnDistinictAfterCredit_int, TypeCode.Int32).ToString(); TurnNumberInLadeAnnouncement_intNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonEntity.TurnNumberInLadeAnnouncement_int, TypeCode.Int32).ToString(); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeList = LaderTypeFactory.GetAllBy(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int, SaloonEntity.SaloonID_int); if (LaderTypeList != null && LaderTypeList.Count > 0) { for (int i = 0; i < lstLaderTypeCheckBox.Items.Count; i++) { if (LaderTypeList.FindAll(c => c.LaderTypeID_int == (((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.Items[i]).LaderTypeID_int)).Count > 0) { this.lstLaderTypeCheckBox.SetItemChecked(i, true); } else { this.lstLaderTypeCheckBox.SetItemChecked(i, false); } } } }
protected override void Delete() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true) { LaderTypeFactory.BeginProc(); LaderTypeFactory.Delete((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key); LaderTypeFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString() + "='" + ((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key).LaderTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } DataTable.AcceptChanges(); } this.Close(); } } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderType_TFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32)LaderTypeGridView.CurrentRow.Cells["colLaderTypeID_int"].Value; LaderTypeFactory.Delete(LaderTypeKey); DataRow[] dr = ((DataTable)this.LaderTypeGridView.DataSource).Select(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString() + "='" + LaderTypeKey.LaderTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.LaderTypeGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
protected override void Edit() { HPS.BLL.SaloonBLL.BLLSaloon_TFactory SaloonFactory = new HPS.BLL.SaloonBLL.BLLSaloon_TFactory(); try { HPS.BLL.SaloonBLL.BLLSaloon_T SaloonEntity = new HPS.BLL.SaloonBLL.BLLSaloon_T(); SaloonEntity.SaloonID_int = ((HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key).SaloonID_int; SaloonEntity.Saloon_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(Saloon_nvcTextBox.Text, TypeCode.String).ToString(); SaloonEntity.TurnDistinictAfterCredit_int = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnDistinictAfterCredit_intNumericTextBox.NumericText, TypeCode.Int32); SaloonEntity.TurnNumberInLadeAnnouncement_int = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnNumberInLadeAnnouncement_intNumericTextBox.NumericText, TypeCode.Int32); if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true) { SaloonFactory.BeginProc(); SaloonFactory.Update(SaloonEntity, (HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); foreach (HPS.BLL.LaderTypeBLL.BLLLaderType_T item in LaderTypeFactory.GetAllBy(BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int, SaloonEntity.SaloonID_int)) { item.SaloonID_int = null; LaderTypeKey.LaderTypeID_int = item.LaderTypeID_int; LaderTypeFactory.Update(item, LaderTypeKey); } foreach (HPS.BLL.LaderTypeBLL.BLLLaderType_T item in lstLaderTypeCheckBox.CheckedItems) { item.SaloonID_int = SaloonEntity.SaloonID_int; LaderTypeKey.LaderTypeID_int = item.LaderTypeID_int; LaderTypeFactory.Update(item, LaderTypeKey); } //for (int i = 0; i < lstLaderTypeCheckBox.CheckedItems.Count; i++) //{ // ((HPS.BLL.LaderTypeBLL.BLLLaderType_T)this.lstLaderTypeCheckBox.CheckedItems[i]).SaloonID_int = SaloonEntity.SaloonID_int; // LaderTypeKey.LaderTypeID_int = ((HPS.BLL.LaderTypeBLL.BLLLaderType_T)this.lstLaderTypeCheckBox.CheckedItems[i]).LaderTypeID_int; // LaderTypeFactory.Update(((HPS.BLL.LaderTypeBLL.BLLLaderType_T)this.lstLaderTypeCheckBox.CheckedItems[i]), LaderTypeKey); //} SaloonFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString() + " = " + ((HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key).SaloonID_int.ToString() + ""); if (dr.Length > 0) { dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.SaloonID_int, TypeCode.Int32); dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.Saloon_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.Saloon_nvc, TypeCode.String); dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnDistinictAfterCredit_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnDistinictAfterCredit_int, TypeCode.Int32); dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnNumberInLadeAnnouncement_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnNumberInLadeAnnouncement_int, TypeCode.Int32); } DataTable.AcceptChanges(); } } } catch (Exception ex) { SaloonFactory.RollBackProc(); throw ex; } }
private void FillCombo() { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); this.LaderTypeID_intComboBox.DisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypeID_intComboBox.ValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); this.LaderTypeID_intComboBox.DataSource = LaderTypeID_intDataTable; this.LaderTypeID_intComboBox.SelectedIndex = -1; HPS.BLL.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory(); //string CompanyCondition = "[Company_T].[Active_bit]='true'"; //CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable); ////DataRow Companydr = CompanyID_intDataTable.NewRow(); ////Companydr["CompanyID_int"] = 0; ////CompanyID_intDataTable.Rows.InsertAt(Companydr, 0); //this.CompanyID_intComboBox.DisplayMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.Company_nvc.ToString(); //this.CompanyID_intComboBox.ValueMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.CompanyID_int.ToString(); //this.CompanyID_intComboBox.DataSource = CompanyID_intDataTable; //this.CompanyID_intComboBox.SelectedIndex = -1; HPS.BLL.GoodBLL.BLLGood_TFactory GoodFactory = new HPS.BLL.GoodBLL.BLLGood_TFactory(); DataTable GoodID_intDataTable = new DataTable(); GoodFactory.GetAll(ref GoodID_intDataTable); this.GoodID_intcomboBox.DisplayMember = HPS.BLL.GoodBLL.BLLGood_T.Good_TField.Good_nvc.ToString(); this.GoodID_intcomboBox.ValueMember = HPS.BLL.GoodBLL.BLLGood_T.Good_TField.GoodID_int.ToString(); this.GoodID_intcomboBox.DataSource = GoodID_intDataTable; this.GoodID_intcomboBox.SelectedIndex = -1; HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory(); DataTable PortPlaceID_intDataTable = new DataTable(); PortPlaceFactory.GetAll(ref PortPlaceID_intDataTable); this.PortPlaceID_intcomboBox.DisplayMember = HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlaces_nvc.ToString(); this.PortPlaceID_intcomboBox.ValueMember = HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlacesID_int.ToString(); this.PortPlaceID_intcomboBox.DataSource = PortPlaceID_intDataTable; this.PortPlaceID_intcomboBox.SelectedIndex = -1; HPS.BLL.CityBLL.BLLCity_TFactory CityFactory = new HPS.BLL.CityBLL.BLLCity_TFactory(); DataTable DestinationCityID_intDataTable = new DataTable(); CityFactory.GetAll(ref DestinationCityID_intDataTable); this.DestinationCityID_intcomboBox.DisplayMember = HPS.BLL.CityBLL.BLLCity_T.City_TField.City_nvc.ToString(); this.DestinationCityID_intcomboBox.ValueMember = HPS.BLL.CityBLL.BLLCity_T.City_TField.CityID_int.ToString(); this.DestinationCityID_intcomboBox.DataSource = DestinationCityID_intDataTable; this.DestinationCityID_intcomboBox.SelectedIndex = -1; } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
private void LoadLaderType() { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeDataTable = new DataTable(); LaderTypeFactory.GetAll(ref LaderTypeDataTable); this.LaderTypeGridView.DataSource = LaderTypeDataTable; } catch (System.Exception ex) { throw ex; } }
private void FillCombo() { try { HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityID_intFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); DataTable PlateCityID_intDataTable = new DataTable(); PlateCityID_intFactory.GetAll(ref PlateCityID_intDataTable); this.PlateCityID_intComboBox.DisplayMember = HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCity_nvc.ToString(); this.PlateCityID_intComboBox.ValueMember = HPS.BLL.PlateCityBLL.BLLPlateCity_T.PlateCity_TField.PlateCityID_int.ToString(); this.PlateCityID_intComboBox.DataSource = PlateCityID_intDataTable; this.PlateCityID_intComboBox.SelectedIndex = -1; HPS.BLL.ColorBLL.BLLColor_TFactory PlateColorID_intFactory = new HPS.BLL.ColorBLL.BLLColor_TFactory(); DataTable PlateColorID_intDataTable = new DataTable(); PlateColorID_intFactory.GetAll(ref PlateColorID_intDataTable); this.PlateColorID_intComboBox.DisplayMember = HPS.BLL.ColorBLL.BLLColor_T.Color_TField.Color_nvc.ToString(); this.PlateColorID_intComboBox.ValueMember = HPS.BLL.ColorBLL.BLLColor_T.Color_TField.ColorID_int.ToString(); this.PlateColorID_intComboBox.DataSource = PlateColorID_intDataTable; this.PlateColorID_intComboBox.SelectedIndex = -1; HPS.BLL.CountryBLL.BLLCountry_TFactory CountryID_intFactory = new HPS.BLL.CountryBLL.BLLCountry_TFactory(); DataTable CountryID_intDataTable = new DataTable(); CountryID_intFactory.GetAll(ref CountryID_intDataTable); this.CountryID_intComboBox.DisplayMember = HPS.BLL.CountryBLL.BLLCountry_T.Country_TField.Country_nvc.ToString(); this.CountryID_intComboBox.ValueMember = HPS.BLL.CountryBLL.BLLCountry_T.Country_TField.CountryID_int.ToString(); this.CountryID_intComboBox.DataSource = CountryID_intDataTable; this.CountryID_intComboBox.SelectedIndex = -1; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); LaderTypeID_intFactory.GetAll(ref LaderTypeID_intDataTable); this.LaderTypeID_intComboBox.DisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypeID_intComboBox.ValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); this.LaderTypeID_intComboBox.DataSource = LaderTypeID_intDataTable; this.LaderTypeID_intComboBox.SelectedIndex = -1; HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupID_intFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory(); DataTable InfractionGroupID_intDataTable = new DataTable(); InfractionGroupID_intFactory.GetAll(ref InfractionGroupID_intDataTable); this.InfractionGroupID_intComboBox.DisplayMember = HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroup_nvc.ToString(); this.InfractionGroupID_intComboBox.ValueMember = HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString(); this.InfractionGroupID_intComboBox.DataSource = InfractionGroupID_intDataTable; this.InfractionGroupID_intComboBox.SelectedIndex = -1; } catch (Exception ex) { throw ex; } }
private void FillCombo() { try { HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupID_intFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory(); DT.DataTable LaderPivotGroupID_intDataTable = new DT.DataTable(); LaderPivotGroupID_intFactory.GetAll(ref LaderPivotGroupID_intDataTable); this.LaderPivotGroupID_intComboBox.DisplayMember = HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroup_nvc.ToString(); this.LaderPivotGroupID_intComboBox.ValueMember = HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroupID_int.ToString(); this.LaderPivotGroupID_intComboBox.DataSource = LaderPivotGroupID_intDataTable; this.LaderPivotGroupID_intComboBox.SelectedIndex = -1; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DT.DataTable LaderTypeID_intDataTable = new DT.DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); this.LaderTypeID_intComboBox.DisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypeID_intComboBox.ValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); this.LaderTypeID_intComboBox.DataSource = LaderTypeID_intDataTable; this.LaderTypeID_intComboBox.SelectedIndex = -1; HPS.BLL.ServicesBLL.BLLServices_TFactory ServicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory(); DT.DataTable ServicesDataTable = new DT.DataTable(); string condition = "[Services_T].[Activie_bit]='true'"; ServicesFactory.GetAllByCondition(condition, ref ServicesDataTable); ServicescomboBox.DataSource = ServicesDataTable; ServicescomboBox.DisplayMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesType_nvc.ToString(); ServicescomboBox.ValueMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesID_int.ToString(); ServicescomboBox.SelectedIndex = -1; HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); string TrafficTypeCondition = "[TrafficType_T].[TrafficTypeID_int]!=1 And [TrafficType_T].[TrafficTypeID_int]!=2"; DT.DataTable TrafficTypeDataTable = new DT.DataTable(); TrafficTypeFactory.GetAllByCondition(TrafficTypeCondition, ref TrafficTypeDataTable); TrafficTypeID_intComboBox.DataSource = TrafficTypeDataTable; TrafficTypeID_intComboBox.DisplayMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString(); TrafficTypeID_intComboBox.ValueMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString(); TrafficTypeID_intComboBox.SelectedIndex = 0; HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); } catch (Exception ex) { throw ex; } }
private void TransferLaderType(string FilePath, string TableName) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { LaderTypeFactory.BeginProc(); LaderTypeFactory.TransferData(FilePath, TableName); LaderTypeFactory.CommitProc(); } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
private void LoadLaderType() { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string Condition = "[LaderType_T].[Active_bit]='true'"; DataTable LaderTypeDataTable = new DataTable(); LaderTypeFactory.GetAllByCondition(Condition, ref LaderTypeDataTable); this.LaderTypeGridView.DataSource = LaderTypeDataTable; } catch (System.Exception ex) { throw ex; } }
private void SearchButton_Click(object sender, EventArgs e) { if (LaderTypeGridView.CurrentRow != null) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32)LaderTypeGridView.CurrentRow.Cells[colLaderTypeID_int.Name].Value; LaderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); if (string.IsNullOrEmpty(Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeGridView.CurrentRow.Cells[colLaderTypeID_int.Name].Value, TypeCode.String).ToString()) == false) { LaderTypeEntity.LaderType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeGridView.CurrentRow.Cells[colLaderType_nvc.Name].Value, TypeCode.String).ToString(); } } this.Close(); }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = LaderTypeFactory.GetBy((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key); if (LaderTypeEntity == null) { throw new HPS.Exceptions.LaderTypeNotFound(); } LaderTypeCode_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String).ToString(); LaderType_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.LaderType_nvc, TypeCode.String).ToString(); MinTruckWeight_decNumericTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal)); MaxTruckWeight_decNumericTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal)); Active_bitCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.Active_bit, TypeCode.Boolean); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref LaderPivotGroupID_intComboBox, LaderTypeEntity.LaderPivotGroupID_int, TypeCode.Int32); TurnCancelCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean); }
private void LaderTypeID_intComboBox_SelectionChangeCommitted(object sender, EventArgs e) { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32?)LaderTypeID_intComboBox.SelectedValue; HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); if (LaderTypeEntity.LaderTypeID_int != 0) { LaderTypeCode_nvcTextBox.Text = LaderTypeEntity.LaderTypeCode_nvc; } } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
private void AllInfoByDateReportForm_Load(object sender, EventArgs e) { HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); //this.FromTimeTextBox.Text = "08:00:00"; //this.ToTimeTextBox.Text = Factory.ServerTime.ToString(); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); this.LaderTypeID_intComboBox.DisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypeID_intComboBox.ValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); this.LaderTypeID_intComboBox.DataSource = LaderTypeID_intDataTable; this.LaderTypeID_intComboBox.SelectedIndex = -1; }
private void TrafficFields() { TrafficList = TrafficFactory.GetAllByCondition(TrafficCondition); if (TrafficList != null && TrafficList.Count > 0 && TrafficList[TrafficList.Count - 1].In_bit == true) { CarCardNumber_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].CarCardNumber_nvc; SavedCarCardDate_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].CarCardDate_nvc; SavedPlateType_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].PlateType_nvc; SavedNumberPlate_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].NumberPlate_nvc; SavedSerialPlate_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].SerialPlate_nvc; HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); string PlateCityCondition = "[PlateCity_T].[PlateCityID_int] = '" + TrafficList[TrafficList.Count - 1].PlateCityID_int + "'"; List <HPS.BLL.PlateCityBLL.BLLPlateCity_T> PlateCityList = PlateCityFactory.GetAllByCondition(PlateCityCondition); if (PlateCityList != null) { SavedPlateCityID_inttextBox.Text = PlateCityList[0].PlateCity_nvc; } HPS.BLL.ColorBLL.BLLColor_TFactory ColorFactory = new HPS.BLL.ColorBLL.BLLColor_TFactory(); string ColorCondition = "[Color_T].[ColorID_int] = '" + TrafficList[TrafficList.Count - 1].PlateColorID_int + "'"; List <HPS.BLL.ColorBLL.BLLColor_T> ColorList = ColorFactory.GetAllByCondition(ColorCondition); if (ColorList != null && ColorList.Count > 0) { SavedPlateColorID_inttextBox.Text = ColorList[0].Color_nvc; } SavedCountryID_inttextBox.Text = TrafficList[TrafficList.Count - 1].Country_nvc; SavedYearType_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].YearType_nvc; SavedProductionYear_intNumericTextBox.Text = TrafficList[TrafficList.Count - 1].ProductionYear_int.Value.ToString(); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int] = '" + TrafficList[TrafficList.Count - 1].LaderTypeID_int + "'"; List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeList = LaderTypeFactory.GetAllByCondition(LaderTypecondition); if (LaderTypeList != null) { SavedLaderType_nvctextBox.Text = LaderTypeList[0].LaderType_nvc; } SavedLaderTypeCode_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].LaderTypeCode_nvc; SavedSystemCode_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].SystemCode_nvc; SavedSystem_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].System_nvc; SavedCapacity_intNumericTextBox.Text = TrafficList[TrafficList.Count - 1].Capacity_flt.Value.ToString(); } else { Hepsa.Core.Common.MessageBox.ErrorMessage(string.Format(HPS.Exceptions.ExceptionCs.RecordNotFound, "ترددی با این مشخصات")); } }
protected override void Insert() { HPS.BLL.SaloonBLL.BLLSaloon_TFactory SaloonFactory = new HPS.BLL.SaloonBLL.BLLSaloon_TFactory(); try { HPS.BLL.SaloonBLL.BLLSaloon_T SaloonEntity = new HPS.BLL.SaloonBLL.BLLSaloon_T(); SaloonEntity.Saloon_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(Saloon_nvcTextBox.Text, TypeCode.String).ToString(); SaloonEntity.TurnDistinictAfterCredit_int = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnDistinictAfterCredit_intNumericTextBox.NumericText, TypeCode.Int32); SaloonEntity.TurnNumberInLadeAnnouncement_int = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnNumberInLadeAnnouncement_intNumericTextBox.NumericText, TypeCode.Int32); SaloonFactory.BeginProc(); SaloonFactory.Insert(SaloonEntity); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); for (int i = 0; i < lstLaderTypeCheckBox.CheckedItems.Count; i++) { ((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.CheckedItems[i]).SaloonID_int = SaloonEntity.SaloonID_int; LaderTypeKey.LaderTypeID_int = ((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.CheckedItems[i]).LaderTypeID_int; LaderTypeFactory.Update(((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.CheckedItems[i]), LaderTypeKey); } SaloonFactory.CommitProc(); if (DataTable != null) { DataRow dr = this.DataTable.NewRow(); dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.SaloonID_int, TypeCode.Int32); dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.Saloon_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.Saloon_nvc, TypeCode.String); dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnDistinictAfterCredit_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnDistinictAfterCredit_int, TypeCode.Int32); dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnNumberInLadeAnnouncement_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnNumberInLadeAnnouncement_int, TypeCode.Int32); DataTable.Rows.Add(dr); DataTable.AcceptChanges(); } this.ClearForm(this); } catch (Exception ex) { SaloonFactory.RollBackProc(); throw ex; } }
private void FillGrid() { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); laderTypeGrid.SetDataBinding(LaderTypeID_intDataTable, "LaderTypeID_intDataTable"); HPS.BLL.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory(); string CompanyCondition = "[Company_T].[Active_bit]='true'"; CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable); companyGrid.SetDataBinding(CompanyID_intDataTable, "CompanyID_intDataTable"); HPS.BLL.GoodBLL.BLLGood_TFactory GoodFactory = new HPS.BLL.GoodBLL.BLLGood_TFactory(); DataTable GoodID_intDataTable = new DataTable(); GoodFactory.GetAll(ref GoodID_intDataTable); goodGrid.SetDataBinding(GoodID_intDataTable, "GoodID_intDataTable"); HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory(); DataTable PortPlaceID_intDataTable = new DataTable(); string PortPlacesCondition = "[PortPlaces_T].[Active_bit]='true'"; PortPlaceFactory.GetAllByCondition(PortPlacesCondition, ref PortPlaceID_intDataTable); portPlaceGrid.SetDataBinding(PortPlaceID_intDataTable, "PortPlaceID_intDataTable"); HPS.BLL.CityBLL.BLLCity_TFactory CityFactory = new HPS.BLL.CityBLL.BLLCity_TFactory(); DataTable DestinationCityID_intDataTable = new DataTable(); string CityCondition = "[City_T].[Active_bit]='true'"; CityFactory.GetAllByCondition(CityCondition, ref DestinationCityID_intDataTable); destinationCityGrid.SetDataBinding(DestinationCityID_intDataTable, "DestinationCityID_intDataTable"); this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(CityFactory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(CityFactory.ServerJalaliDate); //this.FromTimeTextBox.Text = "08:00:00"; //this.ToTimeTextBox.Text = CityFactory.ServerTime; } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory(); HPS.BLL.CarBLL.BLLCar_T CarEntity = CarFactory.GetBy((HPS.BLL.CarBLL.BLLCar_TKeys)Key); if (CarEntity == null) { throw new HPS.Exceptions.CarNotFound(); } CarCardDate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.CarCardDate_nvc, TypeCode.String)); CarCardNumber_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.CarCardNumber_nvc, TypeCode.String)); PlateType_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.PlateType_nvc, TypeCode.String)); NumberPlate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.NumberPlate_nvc, TypeCode.String)); SerialPlate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.SerialPlate_nvc, TypeCode.String)); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref PlateCityID_intComboBox, CarEntity.PlateCityID_int, TypeCode.Int32); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref PlateColorID_intComboBox, CarEntity.PlateColorID_int, TypeCode.Int32); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref CountryID_intComboBox, CarEntity.CountryID_int, TypeCode.Int32); CountryCode_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.CountryCode_nvc, TypeCode.String)); YearType_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.YearType_nvc, TypeCode.String)); ProductionYear_intNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.ProductionYear_int, TypeCode.Int32).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref LaderTypeID_intComboBox, CarEntity.LaderTypeID_int, TypeCode.Int32); Active_bit.Checked = Convert.ToBoolean(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Active_bit, TypeCode.Boolean)); if (LaderTypeID_intComboBox.SelectedValue != null) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32?)LaderTypeID_intComboBox.SelectedValue; HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); if (LaderTypeEntity.LaderTypeID_int != 0) { LaderTypeCode_nvcTextBox.Text = LaderTypeEntity.LaderTypeCode_nvc; } } SystemCode_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.SystemCode_nvc, TypeCode.String)); System_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.System_nvc, TypeCode.String)); Capacity_fltNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Capacity_flt, TypeCode.Double).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref InfractionGroupID_intComboBox, CarEntity.InfractionGroupID_int, TypeCode.Int32); InsertDate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.InsertDate_nvc, TypeCode.String)); UpdateDate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.UpdateDate_nvc, TypeCode.String)); Active_bitCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Active_bit, TypeCode.Boolean); Deleted_bitCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Deleted_bit, TypeCode.Boolean); }
protected override void Edit() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); LaderTypeEntity.LaderTypeCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.LaderType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderType_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.MinTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MinTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.MaxTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MaxTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.Active_bit = Active_bitCheckBox.Checked; LaderTypeEntity.LaderPivotGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroupID_intComboBox.SelectedValue, TypeCode.Int32); LaderTypeEntity.TurnCancel_bit = TurnCancelCheckBox.Checked; if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true) { LaderTypeFactory.BeginProc(); LaderTypeFactory.Update(LaderTypeEntity, (HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key); LaderTypeFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString() + "='" + ((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key).LaderTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderType_nvc, TypeCode.String); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.Active_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.Active_bit, TypeCode.Boolean); dr[0]["LaderPivotGroupID_intLaderPivotGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderPivotGroupID_intComboBox); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.TurnCancel_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean); } DataTable.AcceptChanges(); } } } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
protected override void Insert() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); LaderTypeEntity.LaderTypeCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.LaderType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderType_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.MinTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MinTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.MaxTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MaxTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.Active_bit = Active_bitCheckBox.Checked; LaderTypeEntity.LaderPivotGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroupID_intComboBox.SelectedValue, TypeCode.Int32); LaderTypeEntity.TurnCancel_bit = TurnCancelCheckBox.Checked; LaderTypeFactory.BeginProc(); LaderTypeFactory.Insert(LaderTypeEntity); LaderTypeFactory.CommitProc(); if (DataTable != null) { DataRow dr = this.DataTable.NewRow(); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeID_int, TypeCode.Int32); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderType_nvc, TypeCode.String); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.Active_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.Active_bit, TypeCode.Boolean); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.SaloonID_int, TypeCode.Int32); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderPivotGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderPivotGroupID_int, TypeCode.Int32); dr["LaderPivotGroupID_intLaderPivotGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderPivotGroupID_intComboBox); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.TurnCancel_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean); DataTable.Rows.Add(dr); DataTable.AcceptChanges(); } this.ClearForm(this); } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
private void GroupTrafficReportForm_Load(object sender, EventArgs e) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeDataTable = new DataTable(); LaderTypeFactory.GetAll(ref LaderTypeDataTable); this.LaderTypecheckedComboBox.DropDownDataSource = LaderTypeDataTable; this.LaderTypecheckedComboBox.DropDownDataMember = "LaderType_T"; this.LaderTypecheckedComboBox.DropDownDisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypecheckedComboBox.DropDownValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); LaderTypecheckedComboBox.RetrieveStructure(); LaderTypecheckedComboBox.DropDownList.Columns[1].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[2].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[4].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[5].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[6].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[7].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[8].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[9].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[3].Caption = "نوع بارگیر"; LaderTypecheckedComboBox.DropDownList.Columns[10].Caption = "تعداد محور"; LaderTypecheckedComboBox.DropDownList.Columns[3].Width = 300; HPS.BLL.ServicesBLL.BLLServices_TFactory ServicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory(); DataTable ServicesDataTable = new DataTable(); string condition = "[Services_T].[Activie_bit]='true'"; ServicesFactory.GetAllByCondition(condition, ref ServicesDataTable); ServicescheckedComboBox.DropDownDataSource = ServicesDataTable; ServicescheckedComboBox.DropDownDataMember = ""; ServicescheckedComboBox.DropDownDisplayMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesType_nvc.ToString(); ServicescheckedComboBox.DropDownValueMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesID_int.ToString(); ServicescheckedComboBox.RetrieveStructure(); ServicescheckedComboBox.DropDownList.Columns[1].Visible = false; ServicescheckedComboBox.DropDownList.Columns[3].Visible = false; ServicescheckedComboBox.DropDownList.Columns[2].Caption = "نوع مراجعه"; ServicescheckedComboBox.DropDownList.Columns[2].Width = 300; this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LaderTypeFactory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LaderTypeFactory.ServerJalaliDate); }
private void FillCombo() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); this.LaderTypecheckedComboBox.DropDownDataSource = LaderTypeID_intDataTable; this.LaderTypecheckedComboBox.DropDownDataMember = "LaderType_T"; this.LaderTypecheckedComboBox.DropDownDisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypecheckedComboBox.DropDownValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); LaderTypecheckedComboBox.RetrieveStructure(); LaderTypecheckedComboBox.DropDownList.Columns[1].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[2].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[4].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[3].Caption = "بارگیر"; LaderTypecheckedComboBox.DropDownList.Columns[3].Width = 300; LaderTypecheckedComboBox.DropDownList.Columns[5].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[6].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[7].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[8].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[9].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[10].Visible = false; }
public IranianTrafficEditReport(HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey) { // // Required for Windows Form Designer support // InitializeComponent(); HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt = TrafficFactory.GetBy(TrafficKey); DateTextBox.Text = TrafficEntityrpt.Date_nvc; TimeTextBox.Text = TrafficEntityrpt.Time_nvc; TrafficNumbertxt.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); TurnNumbertxt.Text = TrafficEntityrpt.TurnNumber_bint.ToString(); HPS.BLL.ServicesBLL.BLLServices_TFactory servicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory(); HPS.BLL.ServicesBLL.BLLServices_TKeys ServicesKey = new HPS.BLL.ServicesBLL.BLLServices_TKeys(); ServicesKey.ServicesID_int = TrafficEntityrpt.ServiceID_int; HPS.BLL.ServicesBLL.BLLServices_T ServicesEntity = new HPS.BLL.ServicesBLL.BLLServices_T(); ServicesEntity = servicesFactory.GetBy(ServicesKey); Servicestxt.Text = " مراجعه به : " + ServicesEntity.ServicesType_nvc; DriverNametxt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'"; List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition); if (LaderTypeLst != null) { CarTypetxt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; } HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory(); HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys Platecitykey = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys(); Platecitykey.PlateCityID_int = TrafficEntityrpt.PlateCityID_int; HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T(); PlateCityEntity = PlatecityFactory.GetBy(Platecitykey); if (PlateCityEntity != null) { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc; } else { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc; } if (TrafficEntityrpt.WithLade_bit == true) { WithLadetxt.Text = "وضعیت : " + "با بار" + "(" + TrafficEntityrpt.Comment_nvc + ") "; } else { WithLadetxt.Text = "وضعیت : " + "بدون بار"; } HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory(); if (TrafficEntityrpt.BillMessageID_int == 0 || TrafficEntityrpt.BillMessageID_int == null) { } else { string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntityrpt.BillMessageID_int; List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition); if (BillLst != null) { Messagetxt.Text = BillLst[0].Message_nvc; } } HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntityrpt.Price_dec != null) { txt.Text = TrafficEntityrpt.Price_dec.ToString(); Pricetxt.Text = " مبلغ دریافتی هنگام ورود " + txt.Text + " ريال می باشد"; } //AllowableHourtxt.Text = TrafficEntityrpt.AllowableHour_int.ToString(); //txt.Text = TrafficEntityrpt.Fee_dec.ToString(); //Feetxt.Text = txt.Text; //ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString(); // txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString(); //ExtraHourFeetxt.Text = txt.Text; UserNametxt.Text = TrafficEntityrpt.UserName_nvc; TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); if (TrafficEntityrpt.TurnAccepted_bit == false && TrafficEntityrpt.TurnHour_int != null) { TurnNumberAllerttxt.Text = " شماره نوبت شما رزرو می باشد لطفاً تا " + TrafficEntityrpt.TurnHour_int.ToString() + " ساعت نسبت به تأیید آن اقدام نمایید"; } }
private void FillCombo() { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); DataTable LaderTypeID_intDataTable = new DataTable(); string laderCondition = "[LaderType_T].[Active_bit]='true'"; LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable); this.LaderTypecheckedComboBox.DropDownDataSource = LaderTypeID_intDataTable; this.LaderTypecheckedComboBox.DropDownDataMember = "LaderType_T"; this.LaderTypecheckedComboBox.DropDownDisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(); this.LaderTypecheckedComboBox.DropDownValueMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(); LaderTypecheckedComboBox.RetrieveStructure(); LaderTypecheckedComboBox.DropDownList.Columns[1].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[2].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[4].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[3].Caption = "بارگیر"; LaderTypecheckedComboBox.DropDownList.Columns[3].Width = 300; LaderTypecheckedComboBox.DropDownList.Columns[5].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[6].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[7].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[8].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[9].Visible = false; LaderTypecheckedComboBox.DropDownList.Columns[10].Visible = false; HPS.BLL.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory(); DataTable CompanyID_intDataTable = new DataTable(); string CompanyCondition = "[Company_T].[Active_bit]='true'"; CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable); DataRow Companydr = CompanyID_intDataTable.NewRow(); //Companydr["CompanyID_int"] = 0; //CompanyID_intDataTable.Rows.InsertAt(Companydr, 0); this.CompanyID_intcheckedComboBox.DropDownDataSource = CompanyID_intDataTable; this.CompanyID_intcheckedComboBox.DropDownDataMember = "Company_T"; this.CompanyID_intcheckedComboBox.DropDownDisplayMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.Company_nvc.ToString(); this.CompanyID_intcheckedComboBox.DropDownValueMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.CompanyID_int.ToString(); CompanyID_intcheckedComboBox.RetrieveStructure(); CompanyID_intcheckedComboBox.DropDownList.Columns[1].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[2].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[4].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[3].Caption = "شرکت"; CompanyID_intcheckedComboBox.DropDownList.Columns[3].Width = 300; CompanyID_intcheckedComboBox.DropDownList.Columns[5].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[6].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[7].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[8].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[9].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[10].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[11].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[12].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[13].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[14].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[15].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[16].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[17].Visible = false; CompanyID_intcheckedComboBox.DropDownList.Columns[18].Visible = false; HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillCreditFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory(); DataTable LadbillOrder1Table = new DataTable(); LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder1Table); DataRow emptyRow1 = LadbillOrder1Table.NewRow(); LadbillOrder1Table.Rows.InsertAt(emptyRow1, 0); this.Order1ComboBox.DisplayMember = "PropertyValue"; this.Order1ComboBox.ValueMember = "ColumnName"; this.Order1ComboBox.DataSource = LadbillOrder1Table; this.Order1ComboBox.SelectedIndex = 0; DataTable LadbillOrder2Table = new DataTable(); LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder2Table); DataRow emptyRow2 = LadbillOrder2Table.NewRow(); LadbillOrder2Table.Rows.InsertAt(emptyRow2, 0); this.Order2ComboBox.DisplayMember = "PropertyValue"; this.Order2ComboBox.ValueMember = "ColumnName"; this.Order2ComboBox.DataSource = LadbillOrder2Table; this.Order2ComboBox.SelectedIndex = 0; DataTable LadbillOrder3Table = new DataTable(); LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder3Table); DataRow emptyRow3 = LadbillOrder3Table.NewRow(); LadbillOrder3Table.Rows.InsertAt(emptyRow3, 0); this.Order3ComboBox.DisplayMember = "PropertyValue"; this.Order3ComboBox.ValueMember = "ColumnName"; this.Order3ComboBox.DataSource = LadbillOrder3Table; this.Order3ComboBox.SelectedIndex = 0; DataTable LadbillOrder4Table = new DataTable(); LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder4Table); DataRow emptyRow4 = LadbillOrder4Table.NewRow(); LadbillOrder4Table.Rows.InsertAt(emptyRow4, 0); this.Order4ComboBox.DisplayMember = "PropertyValue"; this.Order4ComboBox.ValueMember = "ColumnName"; this.Order4ComboBox.DataSource = LadbillOrder4Table; this.Order4ComboBox.SelectedIndex = 0; DataTable LadbillOrder5Table = new DataTable(); LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder5Table); DataRow emptyRow5 = LadbillOrder5Table.NewRow(); LadbillOrder5Table.Rows.InsertAt(emptyRow5, 0); this.Order5ComboBox.DisplayMember = "PropertyValue"; this.Order5ComboBox.ValueMember = "ColumnName"; this.Order5ComboBox.DataSource = LadbillOrder5Table; this.Order5ComboBox.SelectedIndex = 0; HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
public ForeignCarsReport(HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntity) { // // Required for Windows Form Designer support // InitializeComponent(); this.TrafficEntityrpt = TrafficEntity; DateTextBox.Text = TrafficEntityrpt.Date_nvc; TimeTextBox.Text = TrafficEntityrpt.Time_nvc; TrafficNumbertxt.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); DriverNametxt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc; HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'"; List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition); if (LaderTypeLst != null) { CarTypetxt.Text = "نوع وسيله : " + TrafficEntityrpt.System_nvc + "- " + LaderTypeLst[0].LaderType_nvc; } if (!string.IsNullOrEmpty(TrafficEntityrpt.SerialPlate_nvc)) { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc; } else { NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc); } if (TrafficEntityrpt.WithLade_bit == true) { WithLadetxt.Text = "وضعیت : " + "با بار" + "(" + TrafficEntityrpt.Comment_nvc + ") "; } else { WithLadetxt.Text = "وضعیت : " + "بدون بار"; } HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox(); txt.DigitsInGroup = 3; if (TrafficEntityrpt.Price_dec != null) { txt.Text = TrafficEntityrpt.Price_dec.ToString(); Pricetxt.Text = " مبلغ دریافتی هنگام ورود " + txt.Text + " ريال می باشد"; } AllowableHourtxt.Text = TrafficEntityrpt.AllowableHour_int.ToString(); ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString(); txt.Text = TrafficEntityrpt.Fee_dec.ToString(); Feetxt.Text = txt.Text; txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString(); ExtraHourFeetxt.Text = txt.Text; UserNametxt.Text = TrafficEntityrpt.UserName_nvc; TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString(); if (TrafficEntityrpt.Printed_bit == true) { this.txtPrintedAgain.Visible = true; } else { this.txtPrintedAgain.Visible = false; HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); try { HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys(); TrafficKey.TrafficID_bint = TrafficEntityrpt.TrafficID_bint; TrafficEntityrpt.Printed_bit = true; TrafficFactory.BeginProc(); TrafficFactory.Update(TrafficEntityrpt, TrafficKey); TrafficFactory.CommitProc(); } catch (Exception ex) { TrafficFactory.RollBackProc(); throw ex; } } }
public IranianInNotOutTrafficReport(string FromDate, string ToDate, int TrafficType, int?PivotGroupID, int?ServicesID) { // // Required for Windows Form Designer support // InitializeComponent(); FromDatetxt.Text = FromDate; ToDatetxt.Text = ToDate; HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory(); DataTable TrafficDataTable = new DataTable(); string Condition = string.Empty; if (ServicesID.HasValue) { if (PivotGroupID.HasValue) { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}') AND (LaderPivotGroup_T.LaderPivotGroupID_int={2}) AND (T1.ServiceID_int={3})", FromDate, ToDate, PivotGroupID, ServicesID); } else { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}') AND (T1.ServiceID_int={2})", FromDate, ToDate, ServicesID); } } else { if (PivotGroupID.HasValue) { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}') AND (LaderPivotGroup_T.LaderPivotGroupID_int={2})", FromDate, ToDate, PivotGroupID); } else { Condition = String.Format("(T1.TrafficTypeID_int='1') AND (T1.Date_nvc>='{0}') AND (T1.Date_nvc<='{1}')", FromDate, ToDate); } } TrafficFactory.GetAllByConditionAllInTrafficNotTemporaryOut(Condition, ref TrafficDataTable); TrafficDataTable.Columns.Add(new DataColumn("AllPayment_dec", typeof(decimal))); TrafficDataTable.Columns.Add(new DataColumn("Remained_dec", typeof(decimal))); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); string stopFeeCondition = string.Empty; var stopFeeFactory = new BLL.StopFeeBLL.BLLStopFee_TFactory(); BLL.StopFeeBLL.BLLStopFee_T oldStopFeeEntity = null; BLL.StopFeeBLL.BLLStopFee_TKeys stopFeeKey = null; BLL.LaderTypeBLL.BLLLaderType_T laderTypeEntity = null; HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory(); DataTable TrafficInWithladBillDataTable = null; DataTable TrafficInDatatable = null; HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory(); HPS.BLL.SettingsBLL.BLLSetting_TKeys SettingKey = null; HPS.BLL.SettingsBLL.BLLSetting_T TurnHourSettingEntity = null; HPS.BLL.SettingsBLL.BLLSetting_T SettingEntity = null; foreach (DataRow row in TrafficDataTable.Rows) { DataTable LaderTypeDataTable = new DataTable(); try { oldStopFeeEntity = new BLL.StopFeeBLL.BLLStopFee_T(); stopFeeKey = new BLL.StopFeeBLL.BLLStopFee_TKeys(); stopFeeKey.StopFeeID_int = Convert.ToInt32(row["StopFeeID_int"]); oldStopFeeEntity = stopFeeFactory.GetBy(stopFeeKey); if ((Int32)row["TrafficTypeID_int"] == 1) { laderTypeEntity = new BLL.LaderTypeBLL.BLLLaderType_T(); LaderTypeKey.LaderTypeID_int = Convert.ToInt32(row["LaderTypeID_int"]); laderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); stopFeeCondition = string.Format(" StartDate_nvc>'{0}' AND StopFee_T.TrafficTypeID_int={1} AND StopFee_T.ServicesID_int={2} AND StopFee_T.LaderPivotGroupID_int={3}", oldStopFeeEntity.EndDate_nvc, Convert.ToInt32(row["TrafficTypeID_int"]), Convert.ToInt32(row["ServiceID_int"]), laderTypeEntity.LaderPivotGroupID_int); } else { stopFeeCondition = string.Format(" StartDate_nvc>'{0}' AND StopFee_T.TrafficTypeID_int={1}", oldStopFeeEntity.StartDate_nvc, Convert.ToInt32(row["TrafficTypeID_int"])); } var newStopFeeTable = new DataTable(); stopFeeFactory.GetAllByCondition(stopFeeCondition, ref newStopFeeTable); Hepsa.Core.Common.MyDateTime InDateTime = new Hepsa.Core.Common.MyDateTime(row["Date_nvc"].ToString()); Hepsa.Core.Common.MyDateTime OutDateTime = new Hepsa.Core.Common.MyDateTime(TrafficFactory.ServerJalaliDate); string InDate = InDateTime.MyDate.ToString("yyyy/MM/dd"); //+ " " + InTime_nvcTextBox.Text; string OutDate = OutDateTime.MyDate.ToString("yyyy/MM/dd"); // + " " + Time_nvcTextBox.Text; if (InDate.Length == 16) { InDate += ":00"; } else if (InDate.Length > 19) { InDate = InDate.Substring(0, 19); } if (OutDate.Length == 16) { OutDate += ":00"; } else if (OutDate.Length > 19) { OutDate = OutDate.Substring(0, 19); } decimal Price = Convert.ToDecimal(row["Fee_dec"]); if (Convert.ToInt32(row["ServiceID_int"]) == 2) { Price = row["Fee_dec"] != null?Convert.ToInt32(row["Fee_dec"]) : 0; } string incondition = "Traffic_T.TrafficNumber_bint='" + row["TrafficNumber_bint"].ToString() + "'"; Condition = string.Format("Traffic_T.TurnNumber_bint='{0}' And Traffic_T.TrafficNumber_bint<>{1}", row["TurnNumber_bint"], row["TrafficNumber_bint"].ToString()); TrafficInWithladBillDataTable = new DataTable(); LadBillFactory.GetAllWithTrafficLadBillCreditByConditon(incondition, ref TrafficInWithladBillDataTable); TrafficInDatatable = new DataTable(); TrafficFactory.GetAllByCondition(Condition, ref TrafficInDatatable); SettingKey = new HPS.BLL.SettingsBLL.BLLSetting_TKeys(); SettingKey.SettingID_int = 1002; TurnHourSettingEntity = settingsFactory.GetBy(SettingKey); if (TrafficInDatatable.Rows.Count > 0) { DateTime TrafficDate = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(TrafficInDatatable.Rows[0]["Date_nvc"].ToString())).MyDate.ToString("yyyy/MM/dd") + " " + TrafficInDatatable.Rows[0]["Time_nvc"].ToString()); Int32 Allowablehour = Convert.ToInt32(TurnHourSettingEntity.Value_nvc); if (TrafficFactory.ServerDate <= TrafficDate.AddHours(Allowablehour)) { if (TrafficInWithladBillDataTable.Rows.Count == 0) { Price = 0; } } } decimal Balanced = 0; TimeSpan ts = new TimeSpan(); if (newStopFeeTable != null && newStopFeeTable.Rows.Count > 0) { //Hepsa.Core.Common.MyDateTime stopFeeMiladiEndDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["EndDate_nvc"].ToString()); //string stopFeeEndDate_nvc = stopFeeMiladiEndDate_nvc.MyDate.ToString("yyyy/MM/dd"); Hepsa.Core.Common.MyDateTime stopFeeMiladiEndDate_nvc = new Hepsa.Core.Common.MyDateTime(oldStopFeeEntity.EndDate_nvc); string stopFeeEndDate_nvc = stopFeeMiladiEndDate_nvc.MyDate.ToString("yyyy/MM/dd"); ts = DateTime.Parse(stopFeeEndDate_nvc).Subtract(DateTime.Parse(InDate)); if (Convert.ToBoolean(row["TurnAccepted_bit"]) == true) { double ExtraHour = ts.TotalHours; SettingEntity = new HPS.BLL.SettingsBLL.BLLSetting_T(); SettingKey.SettingID_int = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); ExtraHour -= Convert.ToDouble(SettingEntity.Value_nvc); if (ExtraHour > 0) { ///محاسبه مازاد بر اساس قیمت قبلی از ورود تا شروع قیمت جدید int days = (int)(ExtraHour / Convert.ToInt32(row["ExtraHour_int"])); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); } Hepsa.Core.Common.MyDateTime stopFeeMiladiStartDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["StartDate_nvc"].ToString()); string newStopFeeStartDate_nvc = stopFeeMiladiStartDate_nvc.MyDate.ToString("yyyy/MM/dd"); TimeSpan ExtaTS = DateTime.Parse(newStopFeeStartDate_nvc).Subtract(DateTime.Parse(InDate)); double ExtraExtraHour = ExtaTS.TotalHours; if (ExtraExtraHour < Convert.ToDouble(SettingEntity.Value_nvc)) { ///محاسبه مازاد از شروع تاریخ قیمت جدید تا تاریخ خروج if (ExtraHour >= 0) { ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(InDate)); } else { ts = DateTime.Parse(OutDate).Subtract(DateTime.Parse(InDate)); } ExtraHour = ts.TotalHours - Convert.ToDouble(SettingEntity.Value_nvc); if (ExtraHour >= 0) { Int32 days = Convert.ToInt32((ExtraHour / Convert.ToInt32(newStopFeeTable.Rows[0]["ExtraHour_int"]))); Price += Math.Floor((Convert.ToDecimal((days)) * Convert.ToDecimal(newStopFeeTable.Rows[0]["ExtraHourFee_dec"]))); } } else { ///محاسبه مازاد از شروع تاریخ قیمت جدید تا تاریخ خروج //Hepsa.Core.Common.MyDateTime stopFeeMiladiStartDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["StartDate_nvc"].ToString()); //string newStopFeeStartDate_nvc = stopFeeMiladiStartDate_nvc.MyDate.ToString("yyyy/MM/dd"); //ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); if (ExtraHour > 0) { ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); } else { ts = DateTime.Parse(OutDate).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); } ExtraHour = ts.TotalHours; if (ExtraHour > 0) { Int32 days = Convert.ToInt32((ExtraHour / Convert.ToInt32(newStopFeeTable.Rows[0]["ExtraHour_int"]))); Price += Math.Floor((Convert.ToDecimal((days)) * Convert.ToDecimal(newStopFeeTable.Rows[0]["ExtraHourFee_dec"]))); } } } else { if (Convert.ToDecimal(row["ExtraHourFee_dec"]) != 0) { ///محاسبه مازاد بر اساس قیمت قبلی از ورود تا شروع قیمت جدید double ExtraHour = ts.TotalHours - Convert.ToDouble(row["AllowableHour_int"]); int days = Convert.ToInt32((ExtraHour / Convert.ToInt32(row["ExtraHour_int"]))); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); ///محاسبه مازاد از شروع تاریخ قیمت جدید تا تاریخ خروج Hepsa.Core.Common.MyDateTime stopFeeMiladiStartDate_nvc = new Hepsa.Core.Common.MyDateTime(newStopFeeTable.Rows[0]["StartDate_nvc"].ToString()); string newStopFeeStartDate_nvc = stopFeeMiladiStartDate_nvc.MyDate.ToString("yyyy/MM/dd"); ts = DateTime.Parse(OutDate).AddDays(1).Subtract(DateTime.Parse(newStopFeeStartDate_nvc)); ExtraHour = ts.TotalHours; days = (int)(ExtraHour / (int)newStopFeeTable.Rows[0]["ExtraHour_int"]); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(newStopFeeTable.Rows[0]["ExtraHourFee_dec"])); } } } else { ts = DateTime.Parse(OutDate).Subtract(DateTime.Parse(InDate)); if (ts.TotalHours > Convert.ToInt32(row["AllowableHour_int"])) { if (Convert.ToBoolean(row["TurnAccepted_bit"]) == true) { double ExtraHour = ts.TotalHours; SettingEntity = new BLL.SettingsBLL.BLLSetting_T(); SettingKey.SettingID_int = 1002; SettingEntity = settingsFactory.GetBy(SettingKey); ExtraHour -= Convert.ToDouble(SettingEntity.Value_nvc); if (ExtraHour > 0) { int days = (int)(ExtraHour / Convert.ToInt32(row["ExtraHour_int"])); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); } //else //{ // Price = 0; //} } else { if (Convert.ToDecimal(row["ExtraHourFee_dec"]) != 0) { double ExtraHour = ts.TotalHours - Convert.ToDouble(row["AllowableHour_int"]); int days = (int)(ExtraHour / Convert.ToInt32(row["ExtraHour_int"])); Price += Math.Floor(((decimal)(days)) * Convert.ToDecimal(row["ExtraHourFee_dec"])); } } } } row["AllPayment_dec"] = Convert.ToString(Price);//+ Balanced if (Price == Balanced) { row["Remained_dec"] = "0"; } else { row["Remained_dec"] = Price - Convert.ToDecimal(row["Price_dec"]);// } if ((Price - Balanced) < 0) { row["Remained_dec"] = Convert.ToDecimal(row["Price_dec"]); } } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } } //AllPayment_dec DataSource = TrafficDataTable; Datetxt.DataField = "Date_nvc"; Timetxt.DataField = "Time_nvc"; TurnNumbertxt.DataField = "TurnNumber_bint"; TrafficNumbertxt.DataField = "TrafficNumber_bint"; NumberPlateTextBox.DataField = "NumberPlate_nvc"; PlateCitytxt.DataField = "PlateCityID_intPlateCity_nvc"; SerialPlateTextBox.DataField = "SerialPlate_nvc"; CarCardNumbertxt.DataField = "CarCardNumber_nvc"; DriverCardNumbertxt.DataField = "DriverCardNumber_nvc"; Pricetxt.DataField = "Price_dec"; Usertxt.DataField = "UserName_nvc"; LastNametxt.DataField = "FullName_nvc"; TurnAcceptedchk.DataField = "TurnAccepted_bit"; ServiceType_nvctxt.DataField = "ServiceID_intServiceType_nvc"; DriverCardNumbertxt.DataField = "DriverInfraction_nvc"; CarInfractiontxt.DataField = "CarInfraction_nvc"; payment_dectxt.DataField = "AllPayment_dec"; remained_dectxt.DataField = "Remained_dec"; DateTextBox.Text = TrafficFactory.ServerJalaliDate; TimeTextBox.Text = TrafficFactory.ServerTime; UserNameTextBox.Text = HPS.Common.CurrentUser.user.UserName_nvc; decimal?AllPrice = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["Price_dec"]).Sum(); AllPricetxt.Text = AllPrice.HasValue ? AllPrice.ToString() : "0"; decimal?AllPayment_dec = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["AllPayment_dec"]).Sum(); allPayment_dectxt.Text = AllPayment_dec.HasValue ? AllPayment_dec.ToString() : "0"; decimal?AllRemained_dec = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["Remained_dec"]).Sum(); allRemained_dectxt.Text = AllRemained_dec.HasValue ? AllRemained_dec.ToString() : "0"; }