protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UsrName"] != null && Session["RoleID"].ToString() == "4") { con = Session["ConnKey"].ToString(); lblUser.Text = Session["Role"].ToString() + " - " + Session["UnitOfficerName"].ToString() + ", Lab Allotted :" + Session["Labname"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; if (!IsPostBack) { random(); BindGrid(); BindProtocol(); DivViewData.Visible = false; } } else { Response.Redirect("~/Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } /*KILL COOKIE & clear Caching*/ PrevBrowCache.enforceNoCache(); if (!IsPostBack) { try { /*CALL REPORT FUNCTION*/ PrintAllReports(Session["ReportName"].ToString()); } catch (Exception ex) { // ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UsrName"] != null && Session["RoleID"].ToString().Trim() == "5" || Session["RoleID"].ToString().Trim() == "6") { con = Session["ConnKey"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; if (Session["RoleID"].ToString().Trim() == "5") { lblUser.Text = Session["Role"].ToString() + " - " + Session["AnalystName"].ToString() + ", Lab Allotted :" + Session["Labname"].ToString(); } if (Session["RoleID"].ToString().Trim() == "6") { lblUser.Text = Session["Role"].ToString() + " - " + Session["JsoName"].ToString() + ", Lab Allotted :" + Session["Labname"].ToString(); } //state = Session["StateCode"].ToString(); // user = Session["UserId"].ToString(); // Department = Session["Department"].ToString(); // dicode = Session["ssoCode"].ToString(); if (!IsPostBack) { try { random(); BindSamples(); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); cf.ShowAlertMessage(ex.ToString()); } } } else { Response.Redirect("~/Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UserId"] != null && (Session["RoleID"].ToString() == "8" || Session["RoleID"].ToString() == "9" || Session["RoleID"].ToString() == "10")) { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); Department = Session["Department"].ToString(); Aocode = Session["AO_Code"].ToString(); lblUser.Text = Session["Role"].ToString() + " - " + Session["DistName"].ToString() + " - " + Session["MandName"].ToString(); if (!IsPostBack) { try { random(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; BindClass(); BindDistrict(); BindCrop(); Bindtestparamertes(); BindGrid(); //lblcodesample.Visible = false; //txtcodesample.Visible = false; } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); cf.ShowAlertMessage(ex.ToString()); } } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UsrName"] != null && Session["RoleID"].ToString() == "3") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); Department = Session["Department"].ToString(); ssoCode = Session["ssoCode"].ToString(); if (!IsPostBack) { try { random(); lblUser.Text = Session["Role"].ToString() + " >> " + Session["ssoName"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; BtnReject.Visible = false; BtnAccept.Visible = false; //regreasonid.Visible = false; BindMemos(); ViewDiv.Visible = false; } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); cf.ShowAlertMessage(ex.ToString()); } } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UserId"] != null && Session["RoleID"].ToString() == "7") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); //Label lbldept = (Label)header.FindControl("lbldept"); //Label lblfooter = (Label)footer.FindControl("lbldept"); //Image img = (Image)footer.FindControl("Image1"); //lbldept.Text = "Department of Agriculture ,"; //lblfooter.Text = "Department of Agriculture."; //img.ImageUrl = "~/Assets/img/doa.png"; if (!IsPostBack) { try { random(); lblUser.Text = Session["Role"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; BindGrid(); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UserId"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); ObjCommon.ShowAlertMessage(ex.ToString()); } } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } //clear Caching PrevBrowCache.enforceNoCache(); //if (Session["UsrName"] == null && Session["Role"].ToString() != "District Agriculture Officer") if (Session["UsrName"] == null && Session["RoleID"].ToString() != "3") { Response.Redirect("~/Error.aspx"); } else { dist = Session["distCode"].ToString(); conkey = Session["ConnKey"].ToString(); } if (!IsPostBack) { random(); lblUsrName.Text = Session["Role"].ToString(); lblDist.Text = Session["district"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; lblyear.Text = cf.getCurrentFinancialYear(); objbe.month = DateTime.Now.Month.ToString(); objbe.Action = "Season"; lblseason.Text = objm.GetSeasonByMonth(objbe, conkey); objbe.season = lblseason.Text; if (lblseason.Text == "Kharif") { lblseason.Text = "VANAKALAM"; } else if (lblseason.Text == "Rabi") { lblseason.Text = "YASANGI"; } BindGrid(); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UsrName"] != null && Session["RoleID"].ToString() == "1") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); Department = Session["Department"].ToString(); dicode = Session["DI_AO_Code"].ToString(); if (!IsPostBack) { try { random(); lblUser.Text = Session["Role"].ToString() + " - " + Session["DIZoneNm"].ToString() + " - " + Session["DIName"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; BindClass(); BindCategory(); BindState(); ddlstate.SelectedValue = state; BindCategory(); BindPaymentType(); BindFirmTypes(); BindDistrict(); BindPriority(); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); errorMsg.Text = ex.Message.ToString(); } } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UserId"] != null || Session["RoleID"].ToString() == "7") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); Department = Session["Department"].ToString(); username = Session["UsrName"].ToString(); if (!IsPostBack) { try { random(); lblUser.Text = Session["Role"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; //BindGrid(); BindCategory(); lbltotal.Visible = false; lbltotquantityAlloted.Visible = false; gridid.Visible = false; ObjCommon.BindFinancialYears(ddlYear); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UserId"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("../Error.aspx"); } } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UserId"] != null && Session["RoleID"].ToString() == "0") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); if (!IsPostBack) { try { txttype.Focus(); random(); lblUser.Text = Session["Role"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; BindGrid(); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UserId"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("../Error.aspx"); } } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UsrName"] != null && Session["RoleID"].ToString().Trim() == "14") { user = Session["CCOAO"].ToString(); con = Session["ConnKey"].ToString(); dept = Session["Department"].ToString(); cate = Session["Category"].ToString(); if (!IsPostBack) { try { random(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; lblUser.Text = Session["Role"].ToString() + " - " + Session["UsrName"].ToString(); BindMemo(); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); cf.ShowAlertMessage(ex.ToString()); } } } else { Response.Redirect("~/Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("../Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UsrName"] != null && Session["RoleID"].ToString() == "5" || Session["RoleID"].ToString().Trim() == "6") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); Department = Session["Department"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; if (Session["RoleID"].ToString().Trim() == "5") { lblUser.Text = Session["Role"].ToString() + " - " + Session["AnalystName"].ToString() + ", Lab Allotted :" + Session["Labname"].ToString(); Analystcode = Session["AnalystCode"].ToString(); } if (Session["RoleID"].ToString().Trim() == "6") { lblUser.Text = Session["Role"].ToString() + " - " + Session["JsoName"].ToString() + ", Lab Allotted :" + Session["Labname"].ToString(); Uocode = Session["Jsocode"].ToString(); } if (!IsPostBack) { random(); span4.Visible = false; } } else { Response.Redirect("../Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } PrevBrowCache.enforceNoCache(); //if (Session["UsrName"] == null && Session["Role"].ToString() != "District Agriculture Officer") if (Session["UsrName"] == null && Session["RoleID"].ToString() != "3") { Response.Redirect("~/Error.aspx"); } else { dist = Session["distCode"].ToString(); state = Session["StateCode"].ToString(); con = Session["ConnKey"].ToString(); } if (!IsPostBack) { lblUsrName.Text = Session["Role"].ToString(); lblDist.Text = Session["district"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; try { getReports(); } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx"); } } PrevBrowCache.enforceNoCache(); if (Session["UserId"] != null && Session["RoleID"].ToString() == "16") { state = Session["StateCode"].ToString(); user = Session["UserId"].ToString(); con = Session["ConnKey"].ToString(); dept = Session["Department"].ToString(); Category = Session["Category"].ToString(); lblDate.Text = DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year; lblUser.Text = Session["Role"].ToString() + " - " + Session["UsrName"].ToString(); if (!IsPostBack) { random(); BindSampleType(); } } else { Response.Redirect("~/Error.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { PrevBrowCache.enforceNoCache(); if ((Request.ServerVariables["HTTP_REFERER"] == null) || (Request.ServerVariables["HTTP_REFERER"] == "")) { Response.Redirect("~/Error.aspx"); } else { string http_ref = Request.ServerVariables["HTTP_REFERER"].Trim(); string http_hos = Request.ServerVariables["HTTP_HOST"].Trim(); int len = http_hos.Length; if (http_ref.IndexOf(http_hos, 0) < 0) { Response.Redirect("~/Error.aspx", false); } } try { ConnKey = Session["ConnKey"].ToString(); Login_DL objLogin = new Login_DL(); if (Session["UsrName"] != null) { try { objLogin.updateUserLoginStatus(Convert.ToInt32(Session["LoginSno"].ToString()), "Logout Success", DateTime.Now, ConnKey); try { HttpCookie aCookie; string cookieName; int limit = Request.Cookies.Count; for (int i = 0; i < limit; i++) { cookieName = Request.Cookies[i].Name; aCookie = new HttpCookie(cookieName); aCookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(aCookie); } } catch { } Session.Abandon(); Session.Clear(); Session.RemoveAll(); DeleteCookie.DelCookie(); if (Request.Cookies["ASP.NET_SessionId"] != null) { Response.Cookies["ASP.NET_SessionId"].Value = string.Empty; Response.Cookies["ASP.NET_SessionId"].Expires = DateTime.Now.AddMonths(-20); } if (Request.Cookies["AuthToken"] != null) { Response.Cookies["AuthToken"].Value = string.Empty; Response.Cookies["AuthToken"].Expires = DateTime.Now.AddMonths(-20); } } catch (Exception ex) { //ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } } } catch (Exception ex) { //ExceptionLogging.SendExcepToDB(ex, "0", Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx", false); } }