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); } }
private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.InfractionBLL.BLLInfraction_TFactory InfractionFactory = new HPS.BLL.InfractionBLL.BLLInfraction_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.InfractionBLL.BLLInfraction_TFactory Infraction_TFactory = new HPS.BLL.InfractionBLL.BLLInfraction_TFactory(); HPS.BLL.InfractionBLL.BLLInfraction_TKeys InfractionKey = new HPS.BLL.InfractionBLL.BLLInfraction_TKeys(); InfractionKey.InfractionID_int = (Int32)InfractionGridView.CurrentRow.Cells["colInfractionID_int"].Value; InfractionFactory.Delete(InfractionKey); DataRow[] dr = ((DataTable)this.InfractionGridView.DataSource).Select(HPS.BLL.InfractionBLL.BLLInfraction_T.Infraction_TField.InfractionID_int.ToString() + "='" + InfractionKey.InfractionID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.InfractionGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
public void GetBy(HPS.BLL.InfractionBLL.BLLInfraction_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); } }
public HPS.BLL.InfractionBLL.BLLInfraction_T GetBy(HPS.BLL.InfractionBLL.BLLInfraction_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.InfractionBLL.BLLInfraction_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
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); } }