/// <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; ViewState["OCCUPATIONID"] = ((Literal)gr.FindControl("litOCCUPATIONID")).Text; OccupationBLL OccupationBLLOBJ = new OccupationBLL(); message = OccupationBLLOBJ.ObsoleteOccupation(Convert.ToInt32(ViewState["OCCUPATIONID"]), Convert.ToString(chk.Checked)); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data updated successfully"; } AllClear(); BindGrid(true, true); SetUpdateMode(false); if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } } catch (Exception ex) { throw ex; } }