private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelComment_TFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory(); HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys LadeCancelCommentKey = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys(); LadeCancelCommentKey.LadeCanceltCommentID_int = (Int32?)LadeCancelCommentGridView.CurrentRow.Cells["colLadeCanceltCommentID_int"].Value; LadeCancelCommentFactory.Delete(LadeCancelCommentKey); DataRow[] dr = ((DataTable)this.LadeCancelCommentGridView.DataSource).Select(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString() + "='" + LadeCancelCommentKey.LadeCanceltCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.LadeCancelCommentGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
private void EditButton_Click(object sender, EventArgs e) { HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys LadeCancelCommentKey = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys(); LadeCancelCommentKey.LadeCanceltCommentID_int = (Int32?)this.LadeCancelCommentGridView.CurrentRow.Cells["colLadeCanceltCommentID_int"].Value; LadeCancelCommentEntityForm LadeCancelComment = new LadeCancelCommentEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.LadeCancelCommentGridView.DataSource, LadeCancelCommentKey); LadeCancelComment.ShowDialog(); }
public void GetBy(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_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.LadeCancelCommentBLL.BLLLadeCancelComment_T GetBy(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void SelectByPrimaryKey(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_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_LadeCancelComment_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try{ this.Command.Parameters.Clear(); SqlParameter LadeCanceltCommentID_int = new SqlParameter(); LadeCanceltCommentID_int.ParameterName = "@LadeCanceltCommentID_int"; LadeCanceltCommentID_int.SqlDbType = SqlDbType.Int; LadeCanceltCommentID_int.Direction = ParameterDirection.Input; LadeCanceltCommentID_int.IsNullable = false; LadeCanceltCommentID_int.Value = businessObjectKey.LadeCanceltCommentID_int; this.Command.Parameters.Add(LadeCanceltCommentID_int); if (ControlConnection) { this.BeginTransaction(); } sqlDataAdapter.Fill(dataTable); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public void Update(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T businessObject, HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LadeCancelComment_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try{ this.Command.Parameters.Clear(); SqlParameter LadeCancelComment_nvc = new SqlParameter(); LadeCancelComment_nvc.ParameterName = "@LadeCancelComment_nvc"; LadeCancelComment_nvc.SqlDbType = SqlDbType.NVarChar; LadeCancelComment_nvc.Direction = ParameterDirection.Input; LadeCancelComment_nvc.IsNullable = false; LadeCancelComment_nvc.Value = businessObject.LadeCancelComment_nvc; this.Command.Parameters.Add(LadeCancelComment_nvc); SqlParameter UserGroupID_int = new SqlParameter(); UserGroupID_int.ParameterName = "@UserGroupID_int"; UserGroupID_int.SqlDbType = SqlDbType.Int; UserGroupID_int.Direction = ParameterDirection.Input; UserGroupID_int.IsNullable = false; if (businessObject.UserGroupID_int.HasValue == false) { UserGroupID_int.Value = DBNull.Value; } else { UserGroupID_int.Value = businessObject.UserGroupID_int; } this.Command.Parameters.Add(UserGroupID_int); SqlParameter pk_LadeCanceltCommentID_int = new SqlParameter(); pk_LadeCanceltCommentID_int.ParameterName = "@pk_LadeCanceltCommentID_int"; pk_LadeCanceltCommentID_int.SqlDbType = SqlDbType.Int; pk_LadeCanceltCommentID_int.Direction = ParameterDirection.Input; pk_LadeCanceltCommentID_int.IsNullable = false; pk_LadeCanceltCommentID_int.Value = businessObjectKey.LadeCanceltCommentID_int; this.Command.Parameters.Add(pk_LadeCanceltCommentID_int); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T SelectByPrimaryKey(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LadeCancelComment_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try{ this.Command.Parameters.Clear(); SqlParameter LadeCanceltCommentID_int = new SqlParameter(); LadeCanceltCommentID_int.ParameterName = "@LadeCanceltCommentID_int"; LadeCanceltCommentID_int.SqlDbType = SqlDbType.Int; LadeCanceltCommentID_int.Direction = ParameterDirection.Input; LadeCanceltCommentID_int.IsNullable = false; LadeCanceltCommentID_int.Value = businessObjectKey.LadeCanceltCommentID_int; this.Command.Parameters.Add(LadeCanceltCommentID_int); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T businessObject = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_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; } }
public LadeCancelCommentEntityForm(Hepsa.Core.PL.BaseEntityParentForm.enmState State, DataTable DataTable, HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys Key) : base(State, DataTable, Key) { InitializeComponent(); }
public void Update(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T businessObject, HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys businessObjectKey) { try { if (businessObject.LadeCanceltCommentID_int == businessObjectKey.LadeCanceltCommentID_int) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLadeCanceltCommentID_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); } }