Esempio n. 1
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.CountryBLL.BLLCountry_TFactory CountryFactory = new HPS.BLL.CountryBLL.BLLCountry_TFactory();

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


                HPS.BLL.CountryBLL.BLLCountry_TFactory Country_TFactory = new HPS.BLL.CountryBLL.BLLCountry_TFactory();
                HPS.BLL.CountryBLL.BLLCountry_TKeys    CountryKey       = new HPS.BLL.CountryBLL.BLLCountry_TKeys();

                CountryKey.CountryID_int = (Int32?)CountryGridView.CurrentRow.Cells["colCountryID_int"].Value;
                CountryFactory.Delete(CountryKey);

                DataRow[] dr = ((DataTable)this.CountryGridView.DataSource).Select(HPS.BLL.CountryBLL.BLLCountry_T.Country_TField.CountryID_int.ToString() + "='" + CountryKey.CountryID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.CountryGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Esempio n. 2
0
 public void GetBy(HPS.BLL.CountryBLL.BLLCountry_TKeys keys, ref System.Data.DataTable dataTable)
 {
     try{
         _dataObject.SelectByPrimaryKey(keys, ref dataTable);
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Esempio n. 3
0
 public HPS.BLL.CountryBLL.BLLCountry_T GetBy(HPS.BLL.CountryBLL.BLLCountry_TKeys keys)
 {
     try{
         return(_dataObject.SelectByPrimaryKey(keys));
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Esempio n. 4
0
 public void Delete(HPS.BLL.CountryBLL.BLLCountry_TKeys keys)
 {
     try{
         _dataObject.Delete(keys);
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Esempio n. 5
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.CountryBLL.BLLCountry_TKeys CountryKey = new HPS.BLL.CountryBLL.BLLCountry_TKeys();
            CountryKey.CountryID_int = (Int32?)this.CountryGridView.CurrentRow.Cells["colCountryID_int"].Value;
            CountryEntityForm Country = new CountryEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.CountryGridView.DataSource, CountryKey);

            Country.ShowDialog();
        }
Esempio n. 6
0
        public HPS.BLL.CountryBLL.BLLCountry_T SelectByPrimaryKey(HPS.BLL.CountryBLL.BLLCountry_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_Country_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter CountryID_int = new SqlParameter();
                CountryID_int.ParameterName = "@CountryID_int";
                CountryID_int.SqlDbType     = SqlDbType.Int;
                CountryID_int.Direction     = ParameterDirection.Input;
                CountryID_int.IsNullable    = false;
                CountryID_int.Value         = businessObjectKey.CountryID_int;
                this.Command.Parameters.Add(CountryID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.CountryBLL.BLLCountry_T businessObject = new HPS.BLL.CountryBLL.BLLCountry_T();
                if (dataReader.Read())
                {
                    PopulateBusinessObjectFromReader(businessObject, dataReader);
                }
                else
                {
                    businessObject = null;
                }

                if (dataReader.IsClosed == false)
                {
                    dataReader.Close();
                }


                if (ControlConnection)
                {
                    this.Commit();
                }
                return(businessObject);
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Esempio n. 7
0
 private void CountryID_intComboBox_SelectionChangeCommitted(object sender, EventArgs e)
 {
     HPS.BLL.CountryBLL.BLLCountry_TFactory CountryFactory = new HPS.BLL.CountryBLL.BLLCountry_TFactory();
     HPS.BLL.CountryBLL.BLLCountry_TKeys    CountryKey     = new HPS.BLL.CountryBLL.BLLCountry_TKeys();
     CountryKey.CountryID_int = (Int32?)CountryID_intComboBox.SelectedValue;
     countryEntity            = CountryFactory.GetBy(CountryKey);
     if (countryEntity != null && countryEntity.CountryID_int != 0)
     {
         CountryCode_nvcTextBox.Text = countryEntity.CountryCode_nvc;
     }
 }
Esempio n. 8
0
        public void SelectByPrimaryKey(HPS.BLL.CountryBLL.BLLCountry_TKeys businessObjectKey, ref System.Data.DataTable dataTable)
        {
            bool           ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);
            SqlDataAdapter sqlDataAdapter    = new System.Data.SqlClient.SqlDataAdapter(this.Command);

            this.Command.CommandText = "[sp_Country_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter CountryID_int = new SqlParameter();
                CountryID_int.ParameterName = "@CountryID_int";
                CountryID_int.SqlDbType     = SqlDbType.Int;
                CountryID_int.Direction     = ParameterDirection.Input;
                CountryID_int.IsNullable    = false;
                CountryID_int.Value         = businessObjectKey.CountryID_int;
                this.Command.Parameters.Add(CountryID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Esempio n. 9
0
        public void Update(HPS.BLL.CountryBLL.BLLCountry_T businessObject, HPS.BLL.CountryBLL.BLLCountry_TKeys businessObjectKey)
        {
            try{
                if (businessObject.CountryID_int == businessObjectKey.CountryID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueCountryID_int") == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }
                else
                {
                    if (businessObject.IsValid() == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }

                _dataObject.Update(businessObject, businessObjectKey);
            }catch (System.Exception ex) {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }
Esempio n. 10
0
        protected override void Insert()
        {
            HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
            try
            {
                HPS.BLL.CarBLL.BLLCar_T CarEntity = new HPS.BLL.CarBLL.BLLCar_T();
                CarEntity.CarCardDate_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(CarCardDate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.CarCardNumber_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(CarCardNumber_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.PlateType_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(PlateType_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.NumberPlate_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(NumberPlate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.SerialPlate_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(SerialPlate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.PlateCityID_int   = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(PlateCityID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.PlateColorID_int  = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(PlateColorID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.CountryID_int     = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(CountryID_intComboBox.SelectedValue, TypeCode.Int32);

                HPS.BLL.CountryBLL.BLLCountry_TFactory CountryFactory = new HPS.BLL.CountryBLL.BLLCountry_TFactory();
                HPS.BLL.CountryBLL.BLLCountry_TKeys    CountryKey     = new HPS.BLL.CountryBLL.BLLCountry_TKeys();
                CountryKey.CountryID_int = (Int32?)CountryID_intComboBox.SelectedValue;
                HPS.BLL.CountryBLL.BLLCountry_T countryEntity = CountryFactory.GetBy(CountryKey);
                if (countryEntity.CountryID_int != 0)
                {
                    CarEntity.Country_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(countryEntity.Country_nvc, TypeCode.String).ToString();
                    CarEntity.CountryCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(countryEntity.CountryCode_nvc, TypeCode.String).ToString();
                }
                CarEntity.YearType_nvc          = Hepsa.Core.Common.PersentationController.GetEntityValue(YearType_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.ProductionYear_int    = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(ProductionYear_intNumericTextBox.NumericText, TypeCode.Int32);
                CarEntity.LaderTypeID_int       = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.LaderTypeCode_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.SystemCode_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(SystemCode_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.System_nvc            = Hepsa.Core.Common.PersentationController.GetEntityValue(System_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.Capacity_flt          = (Nullable <Double>)Hepsa.Core.Common.PersentationController.GetEntityValue(Capacity_fltNumericTextBox.NumericText, TypeCode.Double);
                CarEntity.InfractionGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroupID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.InsertDate_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(InsertDate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.UpdateDate_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(UpdateDate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.Active_bit            = Active_bitCheckBox.Checked;
                CarEntity.Deleted_bit           = Deleted_bitCheckBox.Checked;
                CarEntity.Active_bit            = Active_bit.Checked;
                CarFactory.BeginProc();
                CarFactory.Insert(CarEntity);
                CarFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarID_int.ToString()]         = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CarID_int, TypeCode.Int32);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarCardDate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CarCardDate_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarCardNumber_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CarCardNumber_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.PlateType_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.PlateType_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.NumberPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.NumberPlate_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.SerialPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.SerialPlate_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.PlateCityID_int.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.PlateCityID_int, TypeCode.Int32);
                    dr["PlateCityID_intPlateCity_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(PlateCityID_intComboBox);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.PlateColorID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.PlateColorID_int, TypeCode.Int32);
                    dr["PlateColorID_intColor_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(PlateColorID_intComboBox);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.CountryID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CountryID_int, TypeCode.Int32);
                    dr["CountryID_intCountry_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(CountryID_intComboBox);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.CountryCode_nvc.ToString()]    = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CountryCode_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.Country_nvc.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Country_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.YearType_nvc.ToString()]       = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.YearType_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.ProductionYear_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.ProductionYear_int, TypeCode.Int32);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.LaderTypeID_int.ToString()]    = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.LaderTypeID_int, TypeCode.Int32);
                    dr["LaderTypeID_intLaderType_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderTypeID_intComboBox);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.LaderTypeCode_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.LaderTypeCode_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.SystemCode_nvc.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.SystemCode_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.System_nvc.ToString()]            = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.System_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.Capacity_flt.ToString()]          = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Capacity_flt, TypeCode.Double);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.InfractionGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.InfractionGroupID_int, TypeCode.Int32);
                    dr["InfractionGroupID_intInfractionGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(InfractionGroupID_intComboBox);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.InsertDate_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.InsertDate_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.UpdateDate_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.UpdateDate_nvc, TypeCode.String);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.Active_bit.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Active_bit, TypeCode.Boolean);
                    dr[HPS.BLL.CarBLL.BLLCar_T.Car_TField.Deleted_bit.ToString()]    = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Deleted_bit, TypeCode.Boolean);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                CarFactory.RollBackProc();
                throw ex;
            }
        }
Esempio n. 11
0
        protected override void Edit()
        {
            HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
            try
            {
                HPS.BLL.CarBLL.BLLCar_T CarEntity = new HPS.BLL.CarBLL.BLLCar_T();
                CarEntity.CarCardDate_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(CarCardDate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.CarCardNumber_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(CarCardNumber_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.PlateType_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(PlateType_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.NumberPlate_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(NumberPlate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.SerialPlate_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(SerialPlate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.PlateCityID_int   = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(PlateCityID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.PlateColorID_int  = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(PlateColorID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.CountryID_int     = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(CountryID_intComboBox.SelectedValue, TypeCode.Int32);
                HPS.BLL.CountryBLL.BLLCountry_TFactory CountryFactory = new HPS.BLL.CountryBLL.BLLCountry_TFactory();
                HPS.BLL.CountryBLL.BLLCountry_TKeys    CountryKey     = new HPS.BLL.CountryBLL.BLLCountry_TKeys();
                CountryKey.CountryID_int = (Int32?)CountryID_intComboBox.SelectedValue;
                countryEntity            = CountryFactory.GetBy(CountryKey);
                if (countryEntity != null && countryEntity.CountryID_int != 0)
                {
                    CarEntity.Country_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(countryEntity.Country_nvc, TypeCode.String).ToString();
                    CarEntity.CountryCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(countryEntity.CountryCode_nvc, TypeCode.String).ToString();
                }
                else
                {
                    CountryKey.CountryID_int = 82;
                    countryEntity            = CountryFactory.GetBy(CountryKey);

                    CarEntity.Country_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(countryEntity.Country_nvc, TypeCode.String).ToString();
                    CarEntity.CountryCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(countryEntity.CountryCode_nvc, TypeCode.String).ToString();
                }
                CarEntity.YearType_nvc          = Hepsa.Core.Common.PersentationController.GetEntityValue(YearType_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.ProductionYear_int    = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(ProductionYear_intNumericTextBox.NumericText, TypeCode.Int32);
                CarEntity.LaderTypeID_int       = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.LaderTypeCode_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.SystemCode_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(SystemCode_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.System_nvc            = Hepsa.Core.Common.PersentationController.GetEntityValue(System_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.Capacity_flt          = (Nullable <Double>)Hepsa.Core.Common.PersentationController.GetEntityValue(Capacity_fltNumericTextBox.NumericText, TypeCode.Double);
                CarEntity.InfractionGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroupID_intComboBox.SelectedValue, TypeCode.Int32);
                CarEntity.InsertDate_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(InsertDate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.UpdateDate_nvc        = Hepsa.Core.Common.PersentationController.GetEntityValue(UpdateDate_nvcTextBox.Text, TypeCode.String).ToString();
                CarEntity.Active_bit            = Active_bitCheckBox.Checked;
                CarEntity.Deleted_bit           = Deleted_bitCheckBox.Checked;
                CarEntity.Active_bit            = Active_bit.Checked;

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    CarFactory.BeginProc();
                    CarFactory.Update(CarEntity, (HPS.BLL.CarBLL.BLLCar_TKeys)Key);
                    CarFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarID_int.ToString() + "='" + ((HPS.BLL.CarBLL.BLLCar_TKeys)Key).CarID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarCardDate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CarCardDate_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarCardNumber_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CarCardNumber_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.PlateType_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.PlateType_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.NumberPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.NumberPlate_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.SerialPlate_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.SerialPlate_nvc, TypeCode.String);
                            dr[0]["PlateCityID_intPlateCity_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(PlateCityID_intComboBox);
                            dr[0]["PlateColorID_intColor_nvc"]    = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(PlateColorID_intComboBox);
                            dr[0]["CountryID_intCountry_nvc"]     = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(CountryID_intComboBox);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.CountryCode_nvc.ToString()]    = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.CountryCode_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.Country_nvc.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Country_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.YearType_nvc.ToString()]       = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.YearType_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.ProductionYear_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.ProductionYear_int, TypeCode.Int32);
                            dr[0]["LaderTypeID_intLaderType_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderTypeID_intComboBox);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.LaderTypeCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.LaderTypeCode_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.SystemCode_nvc.ToString()]    = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.SystemCode_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.System_nvc.ToString()]        = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.System_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.Capacity_flt.ToString()]      = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Capacity_flt, TypeCode.Double);
                            dr[0]["InfractionGroupID_intInfractionGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(InfractionGroupID_intComboBox);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.InsertDate_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.InsertDate_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.UpdateDate_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.UpdateDate_nvc, TypeCode.String);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.Active_bit.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Active_bit, TypeCode.Boolean);
                            dr[0][HPS.BLL.CarBLL.BLLCar_T.Car_TField.Deleted_bit.ToString()]    = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(CarEntity.Deleted_bit, TypeCode.Boolean);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                CarFactory.RollBackProc();
                throw ex;
            }
        }
Esempio n. 12
0
        public void Update(HPS.BLL.CountryBLL.BLLCountry_T businessObject, HPS.BLL.CountryBLL.BLLCountry_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_Country_T_Update]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter CountryCode_nvc = new SqlParameter();
                CountryCode_nvc.ParameterName = "@CountryCode_nvc";
                CountryCode_nvc.SqlDbType     = SqlDbType.NVarChar;
                CountryCode_nvc.Direction     = ParameterDirection.Input;
                CountryCode_nvc.IsNullable    = false;
                CountryCode_nvc.Value         = businessObject.CountryCode_nvc;
                this.Command.Parameters.Add(CountryCode_nvc);

                SqlParameter Country_nvc = new SqlParameter();
                Country_nvc.ParameterName = "@Country_nvc";
                Country_nvc.SqlDbType     = SqlDbType.NVarChar;
                Country_nvc.Direction     = ParameterDirection.Input;
                Country_nvc.IsNullable    = false;
                Country_nvc.Value         = businessObject.Country_nvc;
                this.Command.Parameters.Add(Country_nvc);

                SqlParameter Active_bit = new SqlParameter();
                Active_bit.ParameterName = "@Active_bit";
                Active_bit.SqlDbType     = SqlDbType.Bit;
                Active_bit.Direction     = ParameterDirection.Input;
                Active_bit.IsNullable    = false;
                Active_bit.Value         = businessObject.Active_bit;
                this.Command.Parameters.Add(Active_bit);


                SqlParameter pk_CountryID_int = new SqlParameter();
                pk_CountryID_int.ParameterName = "@pk_CountryID_int";
                pk_CountryID_int.SqlDbType     = SqlDbType.Int;
                pk_CountryID_int.Direction     = ParameterDirection.Input;
                pk_CountryID_int.IsNullable    = false;
                pk_CountryID_int.Value         = businessObjectKey.CountryID_int;
                this.Command.Parameters.Add(pk_CountryID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Esempio n. 13
0
 public CountryEntityForm(Hepsa.Core.PL.BaseEntityParentForm.enmState State, DataTable DataTable, HPS.BLL.CountryBLL.BLLCountry_TKeys Key)
     : base(State, DataTable, Key)
 {
     InitializeComponent();
 }