示例#1
0
        /// <summary>
        /// Update Database Make data as Obsoluted
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void IsObsolete_CheckedChanged(Object sender, EventArgs e)
        {
            string message = string.Empty;

            try
            {
                CheckBox    chk        = (CheckBox)sender;
                GridViewRow gr         = (GridViewRow)chk.Parent.Parent;
                string      BANK_ID    = ((Literal)gr.FindControl("litBankID")).Text;
                BankBLL     objBankBLL = new BankBLL();
                message = objBankBLL.ObsoleteBank(Convert.ToInt32(BANK_ID), Convert.ToString(chk.Checked));
                if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                {
                    message = "Data updated successfully";
                }

                ClearDetails();
                BindBanks(false, true);
                if (message != "")
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }