Пример #1
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();

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


                HPS.BLL.CarBLL.BLLCar_TFactory Car_TFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
                HPS.BLL.CarBLL.BLLCar_TKeys    CarKey       = new HPS.BLL.CarBLL.BLLCar_TKeys();

                CarKey.CarID_int = (Int32)CarGridView.CurrentRow.Cells["colCarID_int"].Value;
                CarFactory.Delete(CarKey);

                DataRow[] dr = ((DataTable)this.CarGridView.DataSource).Select(HPS.BLL.CarBLL.BLLCar_T.Car_TField.CarID_int.ToString() + "='" + CarKey.CarID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.CarGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Пример #2
0
        private void LoadCarTraffic()
        {
            try
            {
                HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
                DataTable CarDataTable = new DataTable();
                CarFactory.GetByPlate(NumberPlate, ref CarDataTable);
                this.CarGridView.DataSource = CarDataTable;

                /*if (CarDataTable != null && CarDataTable.Rows.Count > 0)
                 *  for (int index = 0; index < CarDataTable.Rows.Count; index++)
                 *  {
                 *      if ((Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(CarDataTable.Rows[index][this.colSerialPlate_nvc.DataPropertyName], TypeCode.Int32) == 15)
                 *      {
                 *          this.CarGridView.Rows[index].Selected = true;
                 *          break;
                 *      }
                 *  }
                 * this.CarGridView.Update();*/
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        protected override void Delete()
        {
            HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    CarFactory.BeginProc();
                    CarFactory.Delete((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].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                CarFactory.RollBackProc();
                throw ex;
            }
        }
Пример #4
0
        private void LoadCar()
        {
            HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
            DataTable CarDataTable = new DataTable();

            CarFactory.GetAll(ref CarDataTable);
            this.CarGridView.DataSource = CarDataTable;
            //HPS.Common.FrequentlyUsedData.CarDataTable.DefaultView.RowFilter = "";
            //this.CarGridView.DataSource = HPS.Common.FrequentlyUsedData.CarDataTable;
        }
Пример #5
0
 private void SearhGrid()
 {
     if (CarGridView.CurrentRow != null)
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         HPS.BLL.CarBLL.BLLCar_TKeys    CarKey     = new HPS.BLL.CarBLL.BLLCar_TKeys();
         CarKey.CarID_int = (Int32)CarGridView.CurrentRow.Cells[colCarID_int.Name].Value;
         CarEntity        = CarFactory.GetBy(CarKey);
     }
     this.Close();
 }
Пример #6
0
 private void SearchButton_Click(object sender, EventArgs e)
 {
     if (CarGridView.CurrentRow != null)
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         HPS.BLL.CarBLL.BLLCar_TKeys    CarKey     = new HPS.BLL.CarBLL.BLLCar_TKeys();
         CarKey.CarID_int = (Int32)CarGridView.CurrentRow.Cells[colCarID_int.Name].Value;
         CarEntity        = CarFactory.GetBy(CarKey);
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Пример #7
0
 private void DeleteTransferCarData(string FilePath, string TableName)
 {
     HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
     try
     {
         CarFactory.DeleteTransferCarData(FilePath, TableName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #8
0
 private void LoadCar()
 {
     try
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         DataTable CarDataTable = new DataTable();
         CarFactory.GetAllByCondition(Filters(), ref CarDataTable);
         this.CarGridView.DataSource = CarDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Пример #9
0
 private void TransferCar(string FilePath, string TableName)
 {
     HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
     try
     {
         CarFactory.CommitProc();
         CarFactory.TransferData(FilePath, TableName);
         CarFactory.CommitProc();
     }
     catch (Exception ex)
     {
         CarFactory.RollBackProc();
         throw ex;
     }
 }
Пример #10
0
 private void LoadCarTrafficWithCard()
 {
     try
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         DataTable CarDataTable = new DataTable();
         // string Condition = "AND Car_T.SerialPlate_nvc='" + Serialplate + "' AND Car_T.NumberPlate_nvc='" + NumberPlate + "' ";
         string Condition = "Car_T.SerialPlate_nvc='" + Serialplate + "' AND Car_T.NumberPlate_nvc='" + NumberPlate + "' ";
         CarFactory.GetAllByConditionWithCardReader(Condition, ref CarDataTable);
         this.CarGridView.DataSource = CarDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Пример #11
0
        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);
        }
Пример #12
0
 private void SerarchCar()
 {
     try
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         DataTable CarDataTable = new DataTable();
         string    Condition    = "";
         if (!string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "'";
         }
         else if (string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "'";
         }
         else if (string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "'";
         }
         else if (!string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "' AND Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "'";
         }
         else if (string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "' AND Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "'";
         }
         else if (!string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "' AND Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "'";
         }
         else
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "' AND Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "' AND Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "'";
         }
         CarFactory.GetAllByConditionWithCardReader(Condition, ref CarDataTable);
         this.CarGridView.DataSource = CarDataTable;
     }
     catch (System.Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Пример #13
0
 public static void LoadData()
 {
     HPS.BLL.CarBLL.BLLCar_TFactory       CarFactory    = new HPS.BLL.CarBLL.BLLCar_TFactory();
     HPS.BLL.DriverBLL.BLLDriver_TFactory DriverFactory = new HPS.BLL.DriverBLL.BLLDriver_TFactory();
     try
     {
         if (_CarDataTable == null)
         {
             _CarDataTable = new DataTable();
         }
         CarFactory.GetByPlate(string.Empty, ref _CarDataTable);
         if (_DriverDataTable == null)
         {
             _DriverDataTable = new DataTable();
         }
         DriverFactory.GetByCardNumber(string.Empty, ref _DriverDataTable);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #14
0
 private void CarAllTrafficForm_Load(object sender, EventArgs e)
 {
     HPS.BLL.CarBLL.BLLCar_TFactory factory = new HPS.BLL.CarBLL.BLLCar_TFactory();
 }
Пример #15
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;
            }
        }
Пример #16
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;
            }
        }