protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(IsPostBack)) { Session[Constant.SESSION_COMMENT_TYPE] = "1"; if (Request.QueryString["AuctionRefNo"] != null) { Session["AuctionRefNo"] = Request.QueryString["AuctionRefNo"].ToString().Trim(); } if (Session["AuctionRefNo"] != null) { hdnAuctionRefNo.Value = Session["AuctionRefNo"].ToString().Trim(); } if (hdnAuctionRefNo.Value.Trim() != "") { AuctionTransaction au = new AuctionTransaction(); AuctionItem ai = au.GetAuctionByAuctionRefNo(connstring, hdnAuctionRefNo.Value.Trim()); CompanyTransaction cmp = new CompanyTransaction(); GroupDeptSecTransaction grp = new GroupDeptSecTransaction(); CategoryTransaction cat = new CategoryTransaction(); OtherTransaction oth = new OtherTransaction(); lblCompany.Text = cmp.GetCompanyName(connstring, ai.CompanyId.ToString().Trim()); lblRequestor.Text = ai.Requestor.ToString().Trim(); lblPRNumber.Text = ai.PRRefNo.ToString().Trim(); lblPRDate.Text = ai.PRDate.ToString().Trim(); lblGroup.Text = grp.GetGroupDeptSecNameById(connstring, ai.GroupDeptSec.ToString().Trim()); lblSubCategory.Text = cat.GetCategoryNameById(connstring, ai.Category.ToString().Trim()); lblDeadline.Text = ai.AuctionDeadline.ToString().Trim(); lblDeliveryDate.Text = ai.DeliveryDate.ToString().Trim(); lblItemDescription.Text = ai.ItemDescription.ToString().Trim(); lblReferenceNumber.Text = hdnAuctionRefNo.Value.Trim(); lblAuctionType.Text = au.GetAuctionTypeNameById(connstring, ai.AuctionType.ToString().Trim()); lblAuctionConfirmationDeadline.Text = ai.AuctionDeadline.ToString().Trim(); lblAuctionEventDate.Text = ai.AuctionStartDate.ToString().Trim(); lblAuctionStartTime.Text = ai.AuctionStartTimeHour.ToString().Trim() + ":" + ai.AuctionStartTimeMin.ToString().Trim() + ":" + ai.AuctionStartTimeSec.ToString().Trim() + " " + ai.AuctionStartTimeAMPM.ToString().Trim(); lblAuctionEndTime.Text = ai.AuctionEndTimeHour.ToString().Trim() + ":" + ai.AuctionEndTimeMin.ToString().Trim() + ":" + ai.AuctionEndTimeSec.ToString().Trim() + " " + ai.AuctionEndTimeAMPM.ToString().Trim(); lblBidCurrency.Text = oth.GetBidCurrency(ai.BidCurrency.ToString().Trim()); ShowSuppliers(); ShowFiles(ai.FileAttachments.ToString().Trim()); ShowAuctionItems(); } } }
protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.Session["clientid"] != null) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); } else { Response.Redirect("../../login.aspx"); } FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (Session[Constant.SESSION_BIDREFNO] == null) { Response.Redirect("bids.aspx"); } if (!(Page.IsPostBack)) { Session[Constant.SESSION_COMMENT_TYPE] = "0"; } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Event Details"); if (CheckVSF() == "2") { btnApprove.Visible = false; lblMessage.Text = "VSF is currently being clarified."; //Response.Write(oStatus); } }
protected void Page_Load(object sender, System.EventArgs e) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BIDOPENINGCOMMITTEE) { Response.Redirect("../unauthorizedaccess.aspx"); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Details"); if (Session[Constant.SESSION_BIDREFNO] == null) { Response.Redirect("bidseventsforopening.aspx"); } if (!IsPostBack) { lnkComparison.NavigateUrl = "javascript://"; lnkComparison.Attributes.Add("onclick", "window.open('../reports/eventtenderscomparison.aspx?brn=" + Session[Constant.SESSION_BIDREFNO].ToString().Trim() + "','r1', 'toolbar=no, menubar=no, width=800; height=600, top=80, left=80, resizable=yes , scrollbars=yes');"); if (IsForOpening() != 0) { lnkComparison.Enabled = false; } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.VENDOR) { Response.Redirect("../unauthorizedaccess.aspx"); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "My Profile"); if (!(Page.IsPostBack)) { if (Session[Constant.SESSION_USERID] != null) { ViewState[Constant.SESSION_USERID] = Session[Constant.SESSION_USERID].ToString().Trim(); itemDetailsV.Visible = false; DisplayCompanyInfo(); DisplayPresentServices(); DisplayReferences(); DisplayEquipments(); DisplayRelatives(); DisplayOthers(); } } }
// this method is called after a user authenticates with forms authentication. // We make a call here to a helper method that sets the thread principal/identity to the authenticated users identity // we can then use System.Threading.Thread.CurrentPrincipal to check for authorization when accessing sensitive areas in the server side code protected void Application_PostAuthenticateRequest(Object sender, EventArgs e) { if (Request.IsAuthenticated) { FormsAuthenticationHelper.SetCurrentPrincipal(); } }
protected void Page_Load(object sender, System.EventArgs e) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BIDOPENINGCOMMITTEE) { Response.Redirect("../unauthorizedaccess.aspx"); } if (Session[Constant.SESSION_BIDDETAILNO] == null) { Response.Redirect("bidsforeval.aspx"); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Bid Item Details"); if (!IsPostBack) { gvBidItemTenders.SelectedIndex = 0; lnkComparison.NavigateUrl = "javascript://"; lnkComparison.Attributes.Add("onclick", "window.open('../reports/bidtendercomparisons.aspx?bdn=' + " + Session[Constant.SESSION_BIDDETAILNO].ToString() + " , 'x', 'toolbar=no, menubar=no, width=800; height=600, top=80, left=80, resizable=yes, scrollbars=yes');"); } lnkComparison.Enabled = !isEnabledComparison(); if (Session["EndorsementMessage"] != null) { lblMessage.Text = Session["EndorsementMessage"].ToString().Trim(); Session["EndorsementMessage"] = null; } }
protected void Page_Load(object sender, System.EventArgs e) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.VENDOR) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!IsPostBack) { PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Contact Buyer"); if (Session["CB_Message"] != null) { lblMessage.Text = Session["CB_Message"].ToString(); Session["CB_Message"] = null; } // TODO: check if default value is provided (CB_BuyerID, CB_Subject) //Session["CB_BuyerID"] = "189"; //Session["CB_Subject"] = "Test Subject"; if ((Session["CB_BuyerID"] != null) && (Session["CB_Subject"] != null)) { ddlRecipient.SelectedValue = Session["CB_BuyerID"].ToString(); txtSubject.Text = Session["CB_Subject"].ToString(); txtSubject.Enabled = ddlRecipient.Enabled = false; Session["CB_BuyerID"] = null; Session["CB_Subject"] = null; } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(Page.IsPostBack)) { if (Session[Constant.SESSION_USERID] != null) { if (Session[Constant.SESSION_AUCTIONREFNO] != null) { ViewState[Constant.SESSION_AUCTIONREFNO] = Session[Constant.SESSION_AUCTIONREFNO].ToString().Trim(); lnkAuctionItem.Text = "Auction Item " + ViewState[Constant.SESSION_AUCTIONREFNO].ToString().Trim(); //PurchasingTransaction auction = new PurchasingTransaction(); //DataTable dtAwardedItems = auction.QueryAwardedItemsbyBidRefNo(connstring, ViewState[Constant.SESSION_AUCTIONREFNO].ToString().Trim()); //DataView dvAwardedItems = new DataView(dtAwardedItems); //gvAwardedItems.DataSource = dvAwardedItems; //gvAwardedItems.DataBind(); } } } }
/// <summary> /// Logins the specified user name. /// </summary> /// <param name="userName">Name of the user.</param> /// <param name="password">The password.</param> /// <returns></returns> public bool Login(string userName, string password) { if (String.IsNullOrEmpty(userName) || String.IsNullOrEmpty(password)) { return(false); } //Put the validation Logic call the web api if (!(userName == "kparekh" && password == "test")) { return(false); } //First SignOut from the current user if already logged in FormsAuthenticationHelper.Logout(); FFGPrincipalSerializationModel userData = new FFGPrincipalSerializationModel() { DisplayName = userName, Roles = new List <string>() { "User" }, Id = new Guid() }; FormsAuthenticationHelper.CreateAuthTicket(userName, userData); return(true); }
protected void Page_Load(object sender, System.EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.VENDOR) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(IsPostBack)) { if (Session[Constant.SESSION_USERID] != null) { ViewState[Constant.SESSION_USERID] = Session[Constant.SESSION_USERID].ToString().Trim(); // Get bid general details if (Session[Constant.SESSION_BIDREFNO] != null) { ViewState[Constant.SESSION_BIDREFNO] = Session[Constant.SESSION_BIDREFNO].ToString().Trim(); } CategoryTransaction catTrans = new CategoryTransaction(); BidItem bidItem = BidItemTransaction.GetBidDetailsByRefNo(ViewState[Constant.SESSION_BIDREFNO].ToString().Trim()); lblPRNumber.Text = bidItem.PRRefNo.ToString(); lblBidReferenceNumber.Text = bidItem.BidRefNo.ToString(); lblCategory.Text = catTrans.GetCategoryByID(bidItem.Category).CategoryName; lblBidSubmissionDeadline.Text = bidItem.Deadline; lblDeliveryDate.Text = bidItem.DeliveryDate; lblBidItemDescription.Text = bidItem.ItemDescription; ShowBidTenders(); } } }
protected void Page_Load(object sender, System.EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (HttpContext.Current.Session["clientid"] != null) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); } else { Response.Redirect("../../login.aspx"); } if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(Page.IsPostBack)) { PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Home"); lblUserName.Text = String.Format("Welcome {0}!", Session[Constant.SESSION_USERFULLNAME].ToString()); DisplayCount(); } //stylesheet3.href = "~/web/themes/" + HttpContext.Current.Session["configTheme"].ToString() + "/css/style.css"; //stylesheet4.href = "~/web/themes/" + HttpContext.Current.Session["configTheme"].ToString() + "/css/style_buyer.css"; }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!IsPostBack) { gvTenders.SelectedIndex = 0; lblPageSize.Text = ConfigurationManager.AppSettings["CommentsPerPage"]; if (Session[Constant.SESSION_BIDDETAILNO] != null) { lnkConvert.CommandArgument = Session[Constant.SESSION_BIDDETAILNO].ToString().Trim(); } lnkComparison.NavigateUrl = "javascript://"; lnkComparison.Attributes.Add("onclick", "window.open('../reports/bidtendercomparisons.aspx?bdn=' + " + Session[Constant.SESSION_BIDDETAILNO].ToString() + " , 'x', 'toolbar=no, menubar=no, width=800; height=600, top=80, left=80, resizable=yes, scrollbars=yes');"); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Endorsement Summary"); }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(IsPostBack)) { Session[Constant.SESSION_COMMENT_TYPE] = "1"; if (Request.QueryString["arn"] != null) { Session["AuctionRefNo"] = Request.QueryString["arn"].ToString().Trim(); } if (Session["AuctionRefNo"] != null) { hdnAuctionRefNo.Value = Session["AuctionRefNo"].ToString().Trim(); DisplaySuppliers(); } else { Response.Redirect("submittedauctionevents.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(Page.IsPostBack)) { if (Session[Constant.SESSION_USERID] != null) { if (Request.QueryString["BidRefNo"] != null) { Session[Constant.SESSION_BIDREFNO] = Request.QueryString["BidRefNo"].ToString().Trim(); } if (Session[Constant.SESSION_BIDREFNO] != null) { ViewState[Constant.SESSION_BIDREFNO] = Session[Constant.SESSION_BIDREFNO].ToString().Trim(); } hdBidRefNo.Value = ViewState[Constant.SESSION_BIDREFNO].ToString().Trim(); displayDetails(); } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!IsPostBack) { Session[Constant.SESSION_LASTPAGE] = Request.AppRelativeCurrentExecutionFilePath; if (Session[Constant.SESSION_USERID] != null) { //FillDropDownList(); //DataTable dtSearchBids = DtSearchedItems(); //d3Search.Visible = false; //if (dtSearchBids.Rows.Count > 0) //{ // DataView dvSearchBids = new DataView(dtSearchBids); // gvSearchedItems.DataSource = dvSearchBids; // gvSearchedItems.DataBind(); //} //else //{ // lblDataIsEmpty.Text = "There are no searchable bid events."; //} } } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Awarded Bid Items"); }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!IsPostBack) { if (Session[Constant.SESSION_USERID] != null) { FillDropDownList(); d3Search.Visible = false; DataTable dtSearchAuctions = DtSearchedItems(); if (dtSearchAuctions.Rows.Count > 0) { d3Search.Visible = true; DataView dvSearchAuctions = new DataView(dtSearchAuctions); gvSearchedItems.DataSource = dvSearchAuctions; gvSearchedItems.DataBind(); } else { lblDataIsEmpty.Text = "There are no searchable auction events."; } } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } Session[Constant.SESSION_LASTPAGE] = Request.AppRelativeCurrentExecutionFilePath; if (!(Page.IsPostBack)) { } if (Session[Constant.SESSION_USERID] == null) { Session.Abandon(); Session.Clear(); FormsAuthentication.SignOut(); string returnUrl = string.Empty; if (Request.RawUrl.Trim() != "") { returnUrl = "?ReturnUrl=" + Request.RawUrl.Trim().Replace("~/", ""); } Response.Redirect(FormsAuthentication.LoginUrl + returnUrl); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Endorsed Bid Events"); //TestShowAllSessions(); }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) Response.Redirect("../unauthorizedaccess.aspx"); if(!IsPostBack) { if (Session[Constant.SESSION_USERID] != null) { if (Session[Constant.SESSION_BIDREFNO] != null) { ViewState[Constant.SESSION_BIDTENDERNOS] = Session["BidTenderNos"].ToString().Trim(); ViewState[Constant.SESSION_BIDREFNO] = Session[Constant.SESSION_BIDREFNO].ToString().Trim(); ViewState[Constant.SESSION_USERTYPE] = Session[Constant.SESSION_USERTYPE].ToString().Trim(); ViewState[Constant.SESSION_USERID] = Session[Constant.SESSION_USERID].ToString().Trim(); InitializeHiddenFields(); string bidTenderNos = ViewState[Constant.SESSION_BIDTENDERNOS].ToString().Trim(); string bidRefNo = ViewState[Constant.SESSION_BIDREFNO].ToString().Trim(); lblBidRefNo.Text = bidRefNo; DataTable dtEndorsed = PurchasingTransaction.QuerySelectedEndorsedItems(connstring, bidRefNo, bidTenderNos); DataView dvEndorsed = new DataView(dtEndorsed); gvEndorsedItems.DataSource = dvEndorsed; gvEndorsedItems.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = HttpContext.Current.Session["ConnectionString"].ToString(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER) { Response.Redirect("../unauthorizedaccess.aspx"); } Session[Constant.SESSION_LASTPAGE] = Request.AppRelativeCurrentExecutionFilePath; PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "View PR"); string connCo1 = ConfigurationManager.ConnectionStrings["ACCPACConnectionString"].ConnectionString; string connCo2 = ConfigurationManager.ConnectionStrings["ACCPACConnectionString_0a"].ConnectionString; string connCo3 = ConfigurationManager.ConnectionStrings["ACCPACConnectionString_0b"].ConnectionString; ArrayList Connections = new ArrayList(); Connections.Add(connCo1); Connections.Add(connCo2); Connections.Add(connCo3); foreach (string Connx in Connections) { //ExtractPRfromACCPAC(Connx); } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!IsPostBack) { PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Add Sub Category"); if (Session["CategoryId"] != null) { ViewState["CategoryId"] = Session["CategoryId"].ToString().Trim(); } CategoryTransaction c = new CategoryTransaction(); ddlCategory.DataSource = c.GetAllCategories(connstring); ddlCategory.DataTextField = "CategoryName"; ddlCategory.DataValueField = "CategoryId"; ddlCategory.DataBind(); ddlCategory.Items.Insert(0, ""); if (ViewState["CategoryId"] != null) { ddlCategory.SelectedIndex = ddlCategory.Items.IndexOf(ddlCategory.Items.FindByValue(ViewState["CategoryId"].ToString().Trim())); } } }
public virtual ActionResult Login(LoginModel loginModel) { if (ModelState.IsValid) { if (MSExchangeHelper.Login(loginModel)) { var isAuthentificated = FormsAuthenticationHelper.Login(loginModel.Email, loginModel.Password, loginModel.IsPersistent); if (isAuthentificated) { if (!string.IsNullOrEmpty(loginModel.ReturnUrl)) { return(Redirect(loginModel.ReturnUrl)); } return(RedirectToAction(MVC.Home.Index())); } ModelState.AddModelError(string.Empty, Constants.LoginorPasswordisUncorrectErrorMessage); } else { ModelState.AddModelError(string.Empty, Constants.UncorrectDataforEnrtytotheSystemofClientMSExchangeErrorMessage); } return(View(loginModel)); } return(View(loginModel)); }
protected void Page_Load(object sender, System.EventArgs e) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); foreach (string key in Session.Keys) { //TEST SHOW ALL SESSIONS //Response.Write(key + " - " + Session[key].ToString() + "<br />"); } FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BIDAWARDINGCOMMITTEE) { Response.Redirect("../unauthorizedaccess.aspx"); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Home"); if (!(Page.IsPostBack)) { if ((Session[Constant.SESSION_USERID] != null) && (Session[Constant.SESSION_USERTYPE] != null)) { lblName.Text = String.Format("Welcome {0}!", Session[Constant.SESSION_USERFULLNAME].ToString()); DisplayCount(); } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (Session[Constant.SESSION_USERID] != null) { //if (Session["ORDERBY"] == null) // Session["ORDERBY"] = "DESC"; //DataTable dtRejectedBids = PurchasingTransaction.QueryRejectedBids(connstring, Session["ORDERBY"].ToString().Trim()); //if (dtRejectedBids.Rows.Count > 0) //{ // DataView dvRejectedBids = new DataView(dtRejectedBids); // gvRejectedBids.DataSource = dvRejectedBids; // gvRejectedBids.DataBind(); //} //else //{ // lblDataIsEmpty.Text = "There are no rejected bid events to display at the moment."; // actions.Visible = false; //} } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Rejected Bid Events"); }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.PURCHASING) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!IsPostBack) { if (Session["IStatus"] == null) { Response.Redirect("auctioninvitations.aspx"); } string header = ""; switch (Session["IStatus"].ToString()) { case "0": header = "Pending"; break; case "1": header = "Confirmed"; break; case "2": header = "Declined"; break; } header = String.Format("{0} Auction Event Invitations", header); lblHeader.Text = header; PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, header); } }
protected void Page_Load(object sender, EventArgs e) { //Response.Write("<span>" + EncryptionHelper.Decrypt("2f9YfrY41yIPUjLY2dKVlKH+ZzbdkbVRrRolu9ejINY=") + "</span><br>"); //Response.Write("<span>" + EncryptionHelper.Decrypt("38Wda9U8nuBfgyMx4ZVYzaufUUlz1/Z4ymX72tsBzxa2iHrTRELdTblJVOT06z6T") + "</span><br>"); //Response.Write("<span>" + EncryptionHelper.Decrypt("vicpnTw0Pilb6TNu07q1Vc3DQC4AySM3TJshBETh0vw=") + "</span><br>"); //Response.Write("<span>" + EncryptionHelper.Decrypt("fACwYAMPVyTb2NVhH8FuoapG2QJEJilvHXPAXbuu03g=") + "</span><br>"); if (Request.QueryString["ReturnUrl"] != null) { Response.Redirect("login.aspx"); } if (!IsPostBack) { if (!String.IsNullOrEmpty(User.Identity.Name)) { FormsAuthenticationHelper.SignOut(); } } else { if (HttpContext.Current.Session["clientid"] != null) { connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); } else { connstring = ConfigurationManager.ConnectionStrings["EBidConnectionString"].ConnectionString; } } Title = String.Format(Constant.TITLEFORMAT, "Login"); }
/// <summary> /// 具体判断方法 /// </summary> /// <param name="httpContext"></param> /// <returns></returns> protected bool AuthorizeCore(HttpContextBase httpContext) { if (httpContext == null) { throw new ArgumentNullException("httpContext"); } string ticket = httpContext.Request["Ticket"]; if (!string.IsNullOrEmpty(ticket)) { //如果认证服务器返回票据,则记录 User user = new User { Name = "Client1" }; FormsAuthenticationTicket authenticationTicket = FormsAuthenticationHelper.CreateAuthenticationTicket(user); FormsAuthenticationHelper.SetAuthCookie(httpContext, authenticationTicket); return(true); } FormsIdentity formsIdentity = httpContext.User.Identity as FormsIdentity; //验证cookie 用户是否有效 if (formsIdentity == null) { return(false); } //这里可以做授权验证 //.... return(true); }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = HttpContext.Current.Session["ConnectionString"].ToString(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.VENDOR) { Response.Redirect("../unauthorizedaccess.aspx"); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Confirm Auction Event Participation"); if (Session[Constant.SESSION_AUCTIONREFNO] == null) { Response.Redirect("auctions.aspx"); } if (!IsPostBack) { if (Session["ERRORMESSAGE"] != null) { lblError.Text = Session["ERRORMESSAGE"].ToString().Trim(); Session["ERRORMESSAGE"] = null; } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); connstring = Client.ConnectionString(HttpContext.Current.Session["clientid"].ToString()); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BUYER) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(IsPostBack)) { string strBidTenderNos = Session["hdnBidTenderNos"].ToString().Trim(); strBidTenderNos = strBidTenderNos.Replace(Convert.ToChar("|"), Convert.ToChar(",")); DataTable dt = new DataTable(); if (strBidTenderNos.ToString().Trim() != "") { BidTenderTransaction bt = new BidTenderTransaction(); dt = bt.GetEndorsedBidTenders(connstring, strBidTenderNos); } gvBids.DataSource = dt; gvBids.DataBind(); lblBidName.Text = BidItemTransaction.GetBidName(connstring, Session["BidRefNo"].ToString().Trim()); } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.BIDOPENINGCOMMITTEE) { Response.Redirect("../unauthorizedaccess.aspx"); } Session[Constant.SESSION_LASTPAGE] = Request.AppRelativeCurrentExecutionFilePath; PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Received Tenders"); if (!IsPostBack) { // set checkbox default checked value if (Session["ShowItemsWithTendersOnly"] != null) { chkShowTenderizedBidsOnly.Checked = bool.Parse(Session["ShowItemsWithTendersOnly"].ToString()); if (chkShowTenderizedBidsOnly.Checked) { dsReceivedItemTenders.FilterExpression = "SubmittedTenderCount >= 1"; } else { dsReceivedItemTenders.FilterExpression = "SubmittedTenderCount >= 0"; } gvReceivedUnlockedTenders.DataSourceID = "dsReceivedItemTenders"; gvReceivedUnlockedTenders.DataBind(); } if (Session["ShowItemsWithPastSubmission"] != null) { chkPastSubmissionDeadline.Checked = bool.Parse(Session["ShowItemsWithPastSubmission"].ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { FormsAuthenticationHelper.AuthenticateUserWithReturnUrl(); if (Int32.Parse(Session[Constant.SESSION_USERTYPE].ToString().Trim()) != (int)Constant.USERTYPE.VENDOR) { Response.Redirect("../unauthorizedaccess.aspx"); } if (!(Page.IsPostBack)) { if (Request.QueryString["VendorID"] != null) { Session["VendorID"] = Request.QueryString["VendorID"].ToString().Trim(); } if (Session["VendorID"] != null) { ViewState["VendorID"] = Session["VendorID"].ToString().Trim(); itemDetails5.Visible = false; DisplayCompanyInfo(); DisplayPresentServices(); DisplayReferences(); DisplayEquipments(); DisplayRelatives(); DisplayOthers(); } } }