Esempio n. 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   lblbranch_code = (Label)GridView1.Rows[e.RowIndex].FindControl("lblbranch_code");
            cBranch oBranch        = new cBranch();

            try
            {
                if (!oBranch.SP_DEL_BRANCH(lblbranch_code.Text, "N", strUpdatedBy, ref strMessage))
                {
                    lblError.Text = strMessage;
                }
                else
                {
                    string strScript1 = "RefreshMain('" + ViewState["page"].ToString() + "');";
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "OpenPage", strScript1, true);
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message.ToString();
            }
            finally
            {
                oBranch.Dispose();
            }
            BindGridView();
        }
Esempio n. 2
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   lblbranch_code = (Label)GridView1.Rows[e.RowIndex].FindControl("lblbranch_code");
            cBranch oBranch        = new cBranch();

            try
            {
                if (!oBranch.SP_DEL_BRANCH(lblbranch_code.Text, "N", strUpdatedBy, ref strMessage))
                {
                    lblError.Text = strMessage;
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message.ToString();
            }
            finally
            {
                oBranch.Dispose();
            }
            BindGridView(0);
        }