示例#1
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string      strMessage       = string.Empty;
            string      strCheck         = string.Empty;
            string      strScript        = string.Empty;
            string      strUpdatedBy     = Session["username"].ToString();
            Label       lblitem_acc_code = (Label)GridView1.Rows[e.RowIndex].FindControl("lblitem_acc_code");
            HiddenField hdditem_acc_id   = (HiddenField)GridView1.Rows[e.RowIndex].FindControl("hdditem_acc_id");
            cItem_acc   oItem_acc        = new cItem_acc();

            try
            {
                if (!oItem_acc.SP_ITEM_ACC_DEL(hdditem_acc_id.Value.ToString(), "N", strUpdatedBy, ref strMessage))
                {
                    lblError.Text = strMessage;
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message.ToString();
            }
            finally
            {
                oItem_acc.Dispose();
            }
            BindGridView(0);
        }