示例#1
0
        protected override void Insert()
        {
            HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
            try
            {
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T InfractionGroupEntity = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T();
                InfractionGroupEntity.InfractionGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroup_nvcTextBox.Text, TypeCode.String).ToString();
                InfractionGroupEntity.Active_bit          = Active_bitCheckBox.Checked;

                InfractionGroupFactory.BeginProc();
                InfractionGroupFactory.Insert(InfractionGroupEntity);
                InfractionGroupFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.InfractionGroupID_int, TypeCode.Int32);
                    dr[HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroup_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.InfractionGroup_nvc, TypeCode.String);
                    dr[HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.Active_bit.ToString()]            = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.Active_bit, TypeCode.Boolean);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                InfractionGroupFactory.RollBackProc();
                throw ex;
            }
        }
示例#2
0
        protected override void Edit()
        {
            HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
            try
            {
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T InfractionGroupEntity = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T();
                InfractionGroupEntity.InfractionGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroup_nvcTextBox.Text, TypeCode.String).ToString();
                InfractionGroupEntity.Active_bit          = Active_bitCheckBox.Checked;

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    InfractionGroupFactory.BeginProc();
                    InfractionGroupFactory.Update(InfractionGroupEntity, (HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys)Key);
                    InfractionGroupFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString() + "='" + ((HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys)Key).InfractionGroupID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroup_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.InfractionGroup_nvc, TypeCode.String);
                            dr[0][HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.Active_bit.ToString()]          = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.Active_bit, TypeCode.Boolean);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                InfractionGroupFactory.RollBackProc();
                throw ex;
            }
        }
示例#3
0
        protected override void Delete()
        {
            HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    InfractionGroupFactory.BeginProc();
                    InfractionGroupFactory.Delete((HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys)Key);
                    InfractionGroupFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString() + "='" + ((HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys)Key).InfractionGroupID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                InfractionGroupFactory.RollBackProc();
                throw ex;
            }
        }
示例#4
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false)
                {
                    return;
                }


                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroup_TFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys    InfractionGroupKey       = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys();

                InfractionGroupKey.InfractionGroupID_int = (Int32?)InfractionGroupGridView.CurrentRow.Cells["colInfractionGroupID_int"].Value;
                InfractionGroupFactory.Delete(InfractionGroupKey);

                DataRow[] dr = ((DataTable)this.InfractionGroupGridView.DataSource).Select(HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString() + "='" + InfractionGroupKey.InfractionGroupID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.InfractionGroupGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
示例#5
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.CityBLL.BLLCity_TFactory CityID_intFactory = new HPS.BLL.CityBLL.BLLCity_TFactory();
                DataTable CityID_intDataTable = new DataTable();
                string    condition           = "City_T.Active_bit='True'";
                CityID_intFactory.GetAllByCondition(condition, 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.CityBLL.BLLCity_TFactory LicenceCityID_intFactory = new HPS.BLL.CityBLL.BLLCity_TFactory();
                DataTable LicenceCityID_intDataTable = new DataTable();
                LicenceCityID_intFactory.GetAllByCondition(condition, ref LicenceCityID_intDataTable);
                this.LicenceCityID_intComboBox.DisplayMember = HPS.BLL.CityBLL.BLLCity_T.City_TField.City_nvc.ToString();
                this.LicenceCityID_intComboBox.ValueMember   = HPS.BLL.CityBLL.BLLCity_T.City_TField.CityID_int.ToString();
                this.LicenceCityID_intComboBox.DataSource    = LicenceCityID_intDataTable;
                this.LicenceCityID_intComboBox.SelectedIndex = -1;

                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupID_intFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
                DataTable InfractionGroupID_intDataTable = new DataTable();
                string    InfractionGroupCondition       = "InfractionGroup_T.Active_bit='True'";
                InfractionGroupID_intFactory.GetAllByCondition(InfractionGroupCondition, 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;
            }
        }
示例#6
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupID_intFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
                string    condition = "[InfractionGroup_T].[Active_bit]='true'";
                DataTable InfractionGroupID_intDataTable = new DataTable();
                InfractionGroupID_intFactory.GetAllByCondition(condition, 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;

                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupID_intFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
                DataTable InfractionSurveyGroupID_intDataTable = new DataTable();
                InfractionSurveyGroupID_intFactory.GetAll(ref InfractionSurveyGroupID_intDataTable);
                this.InfractionSurveyGroupID_intComboBox.DisplayMember = HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroup_nvc.ToString();
                this.InfractionSurveyGroupID_intComboBox.ValueMember   = HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString();
                this.InfractionSurveyGroupID_intComboBox.DataSource    = InfractionSurveyGroupID_intDataTable;
                this.InfractionSurveyGroupID_intComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#7
0
        private void FillCombo()
        {
            try
            {
                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;

                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.CompanyGroupBLL.BLLCompanyGroup_TFactory GroupID_intFactory = new HPS.BLL.CompanyGroupBLL.BLLCompanyGroup_TFactory();
                DataTable GroupID_intDataTable = new DataTable();
                GroupID_intFactory.GetAll(ref GroupID_intDataTable);
                this.CompanyGroupComboBox.DisplayMember = "GroupName_nvc";
                this.CompanyGroupComboBox.ValueMember   = "GroupID_int";
                this.CompanyGroupComboBox.DataSource    = GroupID_intDataTable;
                this.CompanyGroupComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#8
0
 protected override void ShowForm()
 {
     this.FillCombo();
     HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
     HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T        InfractionGroupEntity  = InfractionGroupFactory.GetBy((HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TKeys)Key);
     if (InfractionGroupEntity == null)
     {
         throw new HPS.Exceptions.InfractionGroupNotFound();
     }
     InfractionGroup_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroupEntity.InfractionGroup_nvc, TypeCode.String).ToString();
     Active_bitCheckBox.Checked      = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroupEntity.Active_bit, TypeCode.Boolean);
 }
示例#9
0
 private void LoadInfractionGroup()
 {
     try
     {
         HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
         DataTable InfractionGroupDataTable = new DataTable();
         InfractionGroupFactory.GetAll(ref InfractionGroupDataTable);
         this.InfractionGroupGridView.DataSource = InfractionGroupDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
示例#10
0
        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;
            }
        }