protected void btnFreeze_Click(object sender, EventArgs e) { try { int userid = Convert.ToInt32(Session["UserID"]); string Ismanage = Session["IsManage"].ToString(); string location = ViewState["Location"].ToString(); Attendance.BAL.Report obj = new Report(); // DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]); // DateTime StartOfMonth = GeneralFunction.GetFirstDayOfWeekDate(TodayDate); DateTime FreezeDate = Convert.ToDateTime(hdnFreeze.Value); bool bnew = obj.UpdateFreeze(userid, location, FreezeDate); if (bnew) { // mdlFeeze.Hide(); System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('Attendance is freezed upto " + FreezeDate.ToString("MM/dd/yyyy") + " ');", true); } } catch (Exception ex) { } }