protected override void Edit() { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); try { HPS.BLL.TrafficTypeBLL.BLLTrafficType_T TrafficTypeEntity = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_T(); TrafficTypeEntity.TrafficType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficType_nvcTextBox.Text, TypeCode.String).ToString(); if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true) { TrafficTypeFactory.BeginProc(); TrafficTypeFactory.Update(TrafficTypeEntity, (HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key); TrafficTypeFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString() + "='" + ((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key).TrafficTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0][HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TrafficTypeEntity.TrafficType_nvc, TypeCode.String); } DataTable.AcceptChanges(); } } } catch (Exception ex) { TrafficTypeFactory.RollBackProc(); throw ex; } }
private void FillCombo() { try { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeID_intFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); DataTable TrafficTypeID_intDataTable = new DataTable(); TrafficTypeID_intFactory.GetAll(ref TrafficTypeID_intDataTable); this.TrafficTypeID_intComboBox.DisplayMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString(); this.TrafficTypeID_intComboBox.ValueMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString(); this.TrafficTypeID_intComboBox.DataSource = TrafficTypeID_intDataTable; this.TrafficTypeID_intComboBox.SelectedIndex = -1; HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupID_intFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory(); DataTable LaderPivotGroupID_intDataTable = new 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.ServicesBLL.BLLServices_TFactory ServicesID_intFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory(); DataTable ServicesID_intDataTable = new DataTable(); ServicesID_intFactory.GetAll(ref ServicesID_intDataTable); this.ServicesID_intComboBox.DisplayMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesType_nvc.ToString(); this.ServicesID_intComboBox.ValueMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesID_int.ToString(); this.ServicesID_intComboBox.DataSource = ServicesID_intDataTable; this.ServicesID_intComboBox.SelectedIndex = -1; } catch (Exception ex) { throw ex; } }
protected override void Delete() { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true) { TrafficTypeFactory.BeginProc(); TrafficTypeFactory.Delete((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key); TrafficTypeFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString() + "='" + ((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key).TrafficTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } DataTable.AcceptChanges(); } this.Close(); } } catch (Exception ex) { TrafficTypeFactory.RollBackProc(); throw ex; } }
protected override void Insert() { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); try { HPS.BLL.TrafficTypeBLL.BLLTrafficType_T TrafficTypeEntity = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_T(); TrafficTypeEntity.TrafficType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficType_nvcTextBox.Text, TypeCode.String).ToString(); TrafficTypeFactory.BeginProc(); TrafficTypeFactory.Insert(TrafficTypeEntity); TrafficTypeFactory.CommitProc(); if (DataTable != null) { DataRow dr = this.DataTable.NewRow(); dr[HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TrafficTypeEntity.TrafficTypeID_int, TypeCode.Int32); dr[HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(TrafficTypeEntity.TrafficType_nvc, TypeCode.String); DataTable.Rows.Add(dr); DataTable.AcceptChanges(); } this.ClearForm(this); } catch (Exception ex) { TrafficTypeFactory.RollBackProc(); throw ex; } }
private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficType_TFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys TrafficTypeKey = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys(); TrafficTypeKey.TrafficTypeID_int = (Int32?)TrafficTypeGridView.CurrentRow.Cells["colTrafficTypeID_int"].Value; TrafficTypeFactory.Delete(TrafficTypeKey); DataRow[] dr = ((DataTable)this.TrafficTypeGridView.DataSource).Select(HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString() + "='" + TrafficTypeKey.TrafficTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.TrafficTypeGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); HPS.BLL.TrafficTypeBLL.BLLTrafficType_T TrafficTypeEntity = TrafficTypeFactory.GetBy((HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys)Key); if (TrafficTypeEntity == null) { throw new HPS.Exceptions.TrafficTypeNotFound(); } TrafficType_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(TrafficTypeEntity.TrafficType_nvc, TypeCode.String).ToString(); }
private void LoadTrafficType() { try { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); DataTable TrafficTypeDataTable = new DataTable(); TrafficTypeFactory.GetAll(ref TrafficTypeDataTable); this.TrafficTypeGridView.DataSource = TrafficTypeDataTable; } catch (System.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 FillCombo() { try { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeID_intFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); DataTable TrafficTypeID_intDataTable = new DataTable(); TrafficTypeID_intFactory.GetAll(ref TrafficTypeID_intDataTable); this.TrafficTypeID_intComboBox.DisplayMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString(); this.TrafficTypeID_intComboBox.ValueMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString(); this.TrafficTypeID_intComboBox.DataSource = TrafficTypeID_intDataTable; this.TrafficTypeID_intComboBox.SelectedIndex = -1; } catch (Exception ex) { throw ex; } }
private void EditButton_Click(object sender, EventArgs e) { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); string condition = "[TrafficType_T].[TrafficType_nvc]='" + TrafficTypeGridView.CurrentRow.Cells[colTrafficType_nvc.Name].Value + "'"; List <HPS.BLL.TrafficTypeBLL.BLLTrafficType_T> lst = TrafficTypeFactory.GetAllByCondition(condition); int flag = 0; foreach (HPS.BLL.TrafficTypeBLL.BLLTrafficType_T item in lst) { if (item.TrafficTypeID_int == 1 || item.TrafficTypeID_int == 2) { flag = 1; } } if (flag != 1) { HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys TrafficTypeKey = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys(); TrafficTypeKey.TrafficTypeID_int = (Int32?)this.TrafficTypeGridView.CurrentRow.Cells["colTrafficTypeID_int"].Value; TrafficTypeEntityForm TrafficType = new TrafficTypeEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.TrafficTypeGridView.DataSource, TrafficTypeKey); TrafficType.ShowDialog(); } }
private void FillCombo() { try { HPS.BLL.AnnouncementTimeBLL.BLLAnnouncementTime_TFactory AnnouncementTimeID_intFactory = new HPS.BLL.AnnouncementTimeBLL.BLLAnnouncementTime_TFactory(); DataTable AnnouncementTimeID_intDataTable = new DataTable(); AnnouncementTimeID_intFactory.GetAll(ref AnnouncementTimeID_intDataTable); this.AnnouncementTimeID_intComboBox.DisplayMember = HPS.BLL.AnnouncementTimeBLL.BLLAnnouncementTime_T.AnnouncementTime_TField.AnnouncementTime_nvc.ToString(); this.AnnouncementTimeID_intComboBox.ValueMember = HPS.BLL.AnnouncementTimeBLL.BLLAnnouncementTime_T.AnnouncementTime_TField.AnnouncementTimeID_int.ToString(); this.AnnouncementTimeID_intComboBox.DataSource = AnnouncementTimeID_intDataTable; this.AnnouncementTimeID_intComboBox.SelectedIndex = -1; HPS.BLL.CityBLL.BLLCity_TFactory CityID_intFactory = new HPS.BLL.CityBLL.BLLCity_TFactory(); DataTable CityID_intDataTable = new DataTable(); CityID_intFactory.GetAll(ref CityID_intDataTable); this.CityID_intComboBox.DisplayMember = HPS.BLL.CityBLL.BLLCity_T.City_TField.City_nvc.ToString(); this.CityID_intComboBox.ValueMember = HPS.BLL.CityBLL.BLLCity_T.City_TField.CityID_int.ToString(); this.CityID_intComboBox.DataSource = CityID_intDataTable; this.CityID_intComboBox.SelectedIndex = -1; HPS.BLL.GoodBLL.BLLGood_TFactory GoodID_intFactory = new HPS.BLL.GoodBLL.BLLGood_TFactory(); DataTable GoodID_intDataTable = new DataTable(); GoodID_intFactory.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.BoxingBLL.BLLBoxing_TFactory BoxingID_intFactory = new HPS.BLL.BoxingBLL.BLLBoxing_TFactory(); DataTable BoxingID_intDataTable = new DataTable(); BoxingID_intFactory.GetAll(ref BoxingID_intDataTable); this.BoxingID_intComboBox.DisplayMember = HPS.BLL.BoxingBLL.BLLBoxing_T.Boxing_TField.BoxingType_nvc.ToString(); this.BoxingID_intComboBox.ValueMember = HPS.BLL.BoxingBLL.BLLBoxing_T.Boxing_TField.BoxingID_int.ToString(); this.BoxingID_intComboBox.DataSource = BoxingID_intDataTable; this.BoxingID_intComboBox.SelectedIndex = -1; HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceID_intFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory(); DataTable PortPlaceID_intDataTable = new DataTable(); PortPlaceID_intFactory.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.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.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory(); DataTable CompanyID_intDataTable = new DataTable(); CompanyID_intFactory.GetAll(ref CompanyID_intDataTable); 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.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeID_intFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory(); DataTable TrafficTypeID_intDataTable = new DataTable(); TrafficTypeID_intFactory.GetAll(ref TrafficTypeID_intDataTable); this.TrafficTypeID_intComboBox.DisplayMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString(); this.TrafficTypeID_intComboBox.ValueMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString(); this.TrafficTypeID_intComboBox.DataSource = TrafficTypeID_intDataTable; this.TrafficTypeID_intComboBox.SelectedIndex = -1; } catch (Exception ex) { throw ex; } }