protected override void Delete() { HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true) { TurnCancelCommentFactory.BeginProc(); TurnCancelCommentFactory.Delete((HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key); TurnCancelCommentFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelCommentID_int.ToString() + "='" + ((HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys)Key).TurnCancelCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } DataTable.AcceptChanges(); } this.Close(); } } catch (Exception ex) { TurnCancelCommentFactory.RollBackProc(); throw ex; } }
private void DeleteButton_Click(object sender, EventArgs e) { HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelCommentFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory(); try { if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false) { return; } HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory TurnCancelComment_TFactory = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TFactory(); HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys TurnCancelCommentKey = new HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_TKeys(); TurnCancelCommentKey.TurnCancelCommentID_int = (Int32?)TurnCancelCommentGridView.CurrentRow.Cells["colTurnCancelCommentID_int"].Value; TurnCancelCommentFactory.Delete(TurnCancelCommentKey); DataRow[] dr = ((DataTable)this.TurnCancelCommentGridView.DataSource).Select(HPS.BLL.TurnCancelCommentBLL.BLLTurnCancelComment_T.TurnCancelComment_TField.TurnCancelCommentID_int.ToString() + "='" + TurnCancelCommentKey.TurnCancelCommentID_int.ToString() + "'"); if (dr.Length > 0) { dr[0].Delete(); } ((DataTable)this.TurnCancelCommentGridView.DataSource).AcceptChanges(); } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }