示例#1
0
        public frmIPP_Add(ACMSLogic.IPP Ipp, string aTerminalBranchCode)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection = new SqlConnection(connectionString);
            IPPs = Ipp;
            strTerminalBranchCode = aTerminalBranchCode;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            ucMemberID1.StrBranchCode = aTerminalBranchCode;
        }
示例#2
0
        private void btnDeleteIPP_Click(object sender, System.EventArgs e)
        {
            IPPs = new IPP();
            DataTable dt;
            ACMS.XtraUtils.GridViewUtils.UpdateData(IPPGridView);
            DataRow row = IPPGridView.GetDataRow(IPPGridView.FocusedRowHandle);
            if (row != null)
            {
                string strSQL="select * from tblReceiptPayment where nIPPId = " + Convert.ToInt32(row["nIPPId"]);
                DataSet _ds = new DataSet();

                SqlHelper.FillDataset(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"table"}, new SqlParameter("@strSQL", strSQL) );
                dt = _ds.Tables["table"];

                if (dt.Rows.Count > 0)
                {
                    MessageBox.Show(this, "Cannot be deleted. Please unlink all the receipt from the IPP.");
                    return;
                }

                DialogResult result = MessageBox.Show(this, "Do you really want to delete record with IPP ID = " + row["NIPPID"].ToString() + "?",
                    "Delete?", MessageBoxButtons.YesNo);

                if (result == DialogResult.Yes)
                {
                    if (IPPs.Delete(ACMS.Convert.ToInt32(row["NIPPID"])))
                    {
                        MessageBox.Show(this, "Record deleted");
                    }
                }
            }
            LoadIPP();
        }