Exemple #1
0
        protected override void Delete()
        {
            HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    BoundryFactory.BeginProc();
                    BoundryFactory.Delete((HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key);
                    BoundryFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryID_int.ToString() + "='" + ((HPS.BLL.BoundryBLL.BLLBoundry_TKeys)Key).BoundryID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                BoundryFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #2
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.BoundryBLL.BLLBoundry_TFactory BoundryFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false)
                {
                    return;
                }


                HPS.BLL.BoundryBLL.BLLBoundry_TFactory Boundry_TFactory = new HPS.BLL.BoundryBLL.BLLBoundry_TFactory();
                HPS.BLL.BoundryBLL.BLLBoundry_TKeys    BoundryKey       = new HPS.BLL.BoundryBLL.BLLBoundry_TKeys();

                BoundryKey.BoundryID_int = (Int32)BoundryGridView.CurrentRow.Cells["colBoundryID_int"].Value;
                BoundryFactory.Delete(BoundryKey);

                DataRow[] dr = ((DataTable)this.BoundryGridView.DataSource).Select(HPS.BLL.BoundryBLL.BLLBoundry_T.Boundry_TField.BoundryID_int.ToString() + "='" + BoundryKey.BoundryID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.BoundryGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }