Example #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            CheckBox chkPr;
            int      count = 0;

            try
            {
                foreach (GridViewRow gvr in GVChangeProcess.Rows)
                {
                    chkPr = (CheckBox)gvr.FindControl("chkChangeProcess");
                    if (chkPr.Checked == true)
                    {
                        int ProcessId = 1;
                        int ID        = Convert.ToInt32(GVChangeProcess.DataKeys[gvr.RowIndex].Values["ID"]);
                        int result    = DBLibrary.UpdateProcess(ID, ProcessId);
                        count         = count + 1;
                        chkPr.Checked = false;
                        chkPr.Enabled = true;
                    }
                }
                if (count > 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Updation Successful')", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Select an Item To REintiate')", true);
                }

                GridProcessBind();
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);

                ShowMessage(ex.Message);
            }
        }