protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["Account"] == null) { if (Session["Name"] == null) { Response.Redirect("Default.aspx"); } else { if (Convert.ToString(Login.GetPermission(Session["Name"].ToString())) == "2".Trim()) { DateTime tmp = DateTime.Now; String gkt = tmp.ToString("MM/dd/yyyy"); if (Manage.CheckDate(gkt) == true) { Response.AddHeader("refresh", "0;url=ChamCong.aspx"); } else { Response.AddHeader("refresh", "0;url=QuanLyChamCong.aspx"); } } else { Response.Redirect("Default.aspx"); } } } else { if (Request.Cookies["Account"]["Permission"].ToString() == "2".Trim()) { if (Session["Name"] == null) { DateTime tmp = DateTime.Now; String gkt = tmp.ToString("MM/dd/yyyy"); if (Manage.CheckDate(gkt) == true) { Response.AddHeader("refresh", "0;url=ChamCong.aspx"); } else { Response.AddHeader("refresh", "0;url=QuanLyChamCong.aspx"); } } else { DateTime tmp = DateTime.Now; String gkt = tmp.ToString("MM/dd/yyyy"); if (Manage.CheckDate(gkt) == true) { Response.AddHeader("refresh", "0;url=ChamCong.aspx"); } else { Response.AddHeader("refresh", "0;url=QuanLyChamCong.aspx"); } } } else { Response.Redirect("Default.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["Account"] == null) { if (Session["Name"] == null) { Response.Redirect("Default.aspx"); } else { if (Convert.ToString(Login.GetPermission(Session["Name"].ToString())) == "2".Trim()) { lblStt.Text = "Chào " + Session["Name"].ToString() + " |"; Session["Room"] = Manage.getRoom(Session["Name"].ToString()); DateTime tmp = DateTime.Now; String gkt = tmp.ToString("MM/dd/yyyy"); if (Manage.CheckDate(gkt) == true) { lblDetail.Text = "Chấm công ngày : " + gkt; } else { Response.AddHeader("refresh", "0;url=Redirect.aspx"); } } else { Response.Redirect("Default.aspx"); } } } else { if (Request.Cookies["Account"]["Permission"].ToString() == "2".Trim()) { if (Session["Name"] == null) { Session["Name"] = Request.Cookies["Account"]["Username"].ToString(); lblStt.Text = "Chào " + Session["Name"].ToString() + "|"; Session["Room"] = Manage.getRoom(Session["Name"].ToString()); DateTime tmp = DateTime.Now; String gkt = tmp.ToString("MM/dd/yyyy"); if (Manage.CheckDate(gkt) == true) { lblDetail.Text = "Chấm công ngày : " + gkt; } else { Response.AddHeader("refresh", "1;url=Redirect.aspx"); } } else { lblStt.Text = "Chào " + Session["Name"].ToString() + "|"; Session["Room"] = Manage.getRoom(Session["Name"].ToString()); DateTime tmp = DateTime.Now; String gkt = tmp.ToString("MM/dd/yyyy"); if (Manage.CheckDate(gkt) == true) { lblDetail.Text = "Chấm công ngày : " + gkt; } else { Response.AddHeader("refresh", "0;url=Redirect.aspx"); } } } else { Response.Redirect("Default.aspx"); } } }