コード例 #1
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.StopFeeBLL.BLLStopFee_TFactory StopFeeFactory = new HPS.BLL.StopFeeBLL.BLLStopFee_TFactory();

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


                HPS.BLL.StopFeeBLL.BLLStopFee_TFactory StopFee_TFactory = new HPS.BLL.StopFeeBLL.BLLStopFee_TFactory();
                HPS.BLL.StopFeeBLL.BLLStopFee_TKeys    StopFeeKey       = new HPS.BLL.StopFeeBLL.BLLStopFee_TKeys();

                StopFeeKey.StopFeeID_int = (Int32)StopFeeGridView.CurrentRow.Cells["colStopFeeID_int"].Value;
                StopFeeFactory.Delete(StopFeeKey);

                DataRow[] dr = ((DataTable)this.StopFeeGridView.DataSource).Select(HPS.BLL.StopFeeBLL.BLLStopFee_T.StopFee_TField.StopFeeID_int.ToString() + "='" + StopFeeKey.StopFeeID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.StopFeeGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
コード例 #2
0
        protected override void Delete()
        {
            HPS.BLL.StopFeeBLL.BLLStopFee_TFactory StopFeeFactory = new HPS.BLL.StopFeeBLL.BLLStopFee_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    StopFeeFactory.BeginProc();
                    StopFeeFactory.Delete((HPS.BLL.StopFeeBLL.BLLStopFee_TKeys)Key);
                    StopFeeFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.StopFeeBLL.BLLStopFee_T.StopFee_TField.StopFeeID_int.ToString() + "='" + ((HPS.BLL.StopFeeBLL.BLLStopFee_TKeys)Key).StopFeeID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                StopFeeFactory.RollBackProc();
                throw ex;
            }
        }