示例#1
0
        public void Update(HPS.BLL.InfractionBLL.BLLInfraction_T businessObject, HPS.BLL.InfractionBLL.BLLInfraction_TKeys businessObjectKey)
        {
            try
            {
                if (businessObject.InfractionID_int == businessObjectKey.InfractionID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueInfractionID_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 EditButton_Click(object sender, EventArgs e)
 {
     try
     {
         HPS.BLL.InfractionBLL.BLLInfraction_TKeys InfractionKey = new HPS.BLL.InfractionBLL.BLLInfraction_TKeys();
         InfractionKey.InfractionID_int = (Int32)this.InfractionGridView.CurrentRow.Cells["colInfractionID_int"].Value;
         HPS.BLL.InfractionBLL.BLLInfraction_TFactory InfractionFactory = new HPS.BLL.InfractionBLL.BLLInfraction_TFactory();
         HPS.BLL.InfractionBLL.BLLInfraction_T        InfractionEntity  = InfractionFactory.GetBy(InfractionKey);
         if (!string.IsNullOrEmpty(InfractionEntity.RegisterUserName_nvc) && !string.IsNullOrEmpty(InfractionEntity.RegisterDate_nvc))
         {
             registered = true;
         }
         InfractionEntityForm Infraction = new InfractionEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.InfractionGridView.DataSource, InfractionKey, registered);
         Infraction.ShowDialog();
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }