protected void Page_Load(object sender, EventArgs e) { try { if (Session["Person_Id"].ToString() == "" || Session["Person_Id"].ToString() == null) { Response.Redirect("LoginForm.aspx", false); } int Count = 0; DataTable dt = CGeneralFunction.filldata("select count(*) from cdb..TRANSACTION_DETAILS where Attr1='1' and Forwarded_To='" + Session["Person_Id"].ToString() + "'"); foreach (DataRow ro in dt.Rows) { Count = int.Parse(ro[0].ToString()); } if (Count > 0) { //imgRequest.ImageUrl = "~/Icons/notifcation-message.png"; //lblCount.Visible = true; //div1.Visible = true; //lblCount.Text = Count.ToString(); } else { //imgRequest.ImageUrl = "~/Icons/notification-on.png"; //lblCount.Visible = false; //div1.Visible = false; } } catch { Response.Redirect("LoginForm.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { try { //if (Session["Person_Id"].ToString() == "" || Session["Person_Id"].ToString() == null) // Response.Redirect("../Pages/LoginForm.aspx", false); //if (Session["Person_Id"].ToString() != "83") //{ // Response.Redirect("../Pages/LoginForm.aspx", false); //} int Count = 0; //DataTable dt = CGeneralFunction.filldata("select count(*) from cdb..TRANSACTION_DETAILS where Attr1='1' and Forwarded_To='" + Session["Person_Id"].ToString() + "'"); //foreach (DataRow ro in dt.Rows) //{ // Count = int.Parse(ro[0].ToString()); //} if (Count > 0) { //imgRequest.ImageUrl = "~/Icons/notifcation-message.png"; //lblCount.Visible = true; //div1.Visible = true; //lblCount.Text = Count.ToString(); LblNotification.Text = Count.ToString(); } else { //imgRequest.ImageUrl = "~/Icons/notification-on.png"; //lblCount.Visible = false; //div1.Visible = false; } // LblPageName.Text = Session["PageName"].ToString(); StringBuilder str = new StringBuilder(); DataTable dtt = CGeneralFunction.filldata("exec SP_Menu"); for (int i = 0; i <= dtt.Rows.Count - 1; i++) { str.Append(dtt.Rows[i][0].ToString()); } ltrlMenu.Text = str.ToString(); } catch (Exception Ex) { // throw Ex; Response.Redirect("../Pages/LoginForm.aspx", false); } }
protected void gvStayBackReason_RowCommand(object sender, GridViewCommandEventArgs e) { if (!isalloweddatedate() && Session["RoleId"].ToString() != "9") { Response.Write("<script LANGUAGE='JavaScript' >alert('This facility is blocked by administration, Contact Admin!!.')</script>"); return; } try { if (e.CommandName == "View") { DataTable dt; string csId = Convert.ToString(e.CommandArgument); dt = CGeneralFunction.filldata("Usp_BatchwiseStatus " + csId); if (dt.Rows.Count != 0) { gridView.DataSource = dt; } else { gridView.DataSource = null; } gridView.DataBind(); ME1.Show(); } else { int ClassSectionId = Convert.ToInt32(e.CommandArgument.ToString()); DataTable dt = CGeneralFunction.filldataattendance("select ClassId,SectionId from tblClassSection where Id='" + ClassSectionId + "'"); Session["Class_Id"] = dt.Rows[0]["ClassId"].ToString(); Session["Div_Id"] = dt.Rows[0]["SectionId"].ToString(); Session["ClassSectionId"] = ClassSectionId; Response.Redirect("Attendance.aspx?CId=" + ClassSectionId + "&&DDate=" + txtDate.Text.Trim(), false); } } catch { } }