Exemple #1
0
        protected override void Delete()
        {
            HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory LadeCancelCommentFactory = new HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    LadeCancelCommentFactory.BeginProc();
                    LadeCancelCommentFactory.Delete((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key);
                    LadeCancelCommentFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T.LadeCancelComment_TField.LadeCanceltCommentID_int.ToString() + "='" + ((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_TKeys)Key).LadeCanceltCommentID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                LadeCancelCommentFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #2
0
        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);
            }
        }