コード例 #1
0
        public void Update(HPS.BLL.CarBLL.BLLCar_T businessObject, HPS.BLL.CarBLL.BLLCar_TKeys businessObjectKey)
        {
            try
            {
                if (businessObject.CarID_int == businessObjectKey.CarID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueCarID_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);
            }
        }
コード例 #2
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);
            }
        }
コード例 #3
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.CarBLL.BLLCar_TKeys CarKey = new HPS.BLL.CarBLL.BLLCar_TKeys();
            CarKey.CarID_int = (Int32)this.CarGridView.CurrentRow.Cells["colCarID_int"].Value;
            CarEntityForm Car = new CarEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.CarGridView.DataSource, CarKey);

            Car.ShowDialog();
        }
コード例 #4
0
 public void GetBy(HPS.BLL.CarBLL.BLLCar_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);
     }
 }
コード例 #5
0
 public HPS.BLL.CarBLL.BLLCar_T GetBy(HPS.BLL.CarBLL.BLLCar_TKeys keys)
 {
     try
     {
         return(_dataObject.SelectByPrimaryKey(keys));
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
コード例 #6
0
 public void Delete(HPS.BLL.CarBLL.BLLCar_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
コード例 #7
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();
 }
コード例 #8
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();
 }
コード例 #9
0
 public CarEntityForm(Hepsa.Core.PL.BaseEntityParentForm.enmState State, DataTable DataTable, HPS.BLL.CarBLL.BLLCar_TKeys Key)
     : base(State, DataTable, Key)
 {
     InitializeComponent();
 }