private void AssignToSession() { try { if (Request["CustomerId"] != null && Request["CustPriGrp"] != null) { SessionManager.AddCustomerToSession(HttpContext.Current, Convert.ToString(Request["CustomerId"])); SessionManager.AddConsigneeToSession(HttpContext.Current, Convert.ToString(Request["CustomerId"])); SessionManager.AddProductGroupCodeDefault(HttpContext.Current, "DYES"); } else if (Request["Customer"] != null && Request["CustPriGrp"] != null) { SessionManager.AddConsigneeToSession(HttpContext.Current, Convert.ToString(Request["Consignee"])); SessionManager.AddCustomerToSession(HttpContext.Current, Convert.ToString(Request["CustomerId"])); SessionManager.AddProductGroupCodeDefault(HttpContext.Current, "DYES"); } else if (Request["Consignee"] != null) { SessionManager.AddConsigneeToSession(HttpContext.Current, Convert.ToString(Request["Consignee"])); SessionManager.AddProductGroupCodeDefault(HttpContext.Current, "DYES"); //SessionManager.AddCustomerToSession(HttpContext.Current, Convert.ToString(Request["CustomerId"])); //SessionManager.AddCustomerPriceGroupToSession(HttpContext.Current, Convert.ToString(Request["CustPriGrp"])); //SessionManager.AddProductGroupCodeDefault(HttpContext.Current, "DYES"); //SessionManager.AddCustDiscountPercentage(HttpContext.Current, Convert.ToString(Request["DiscGrp"])); } } catch (Exception ex) { var message = new JavaScriptSerializer().Serialize(ex.Message.ToString()); var script = string.Format("alert({0});", message); ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true); } }
protected void Page_Load(object sender, EventArgs e) { try { l_Error.Visible = false; if (!Page.IsPostBack) { if (Session["userName"] == null) { Response.Redirect("Login.aspx"); } else { } if (Request["CompanyCode"] != null) { SessionManager.AddCompanyToSession(HttpContext.Current, Convert.ToString(Request["CompanyCode"])); } if (Request["CustomerId"] != null) { SessionManager.AddCustomerToSession(HttpContext.Current, Convert.ToString(Request["CustomerId"])); } AssignToSession(); BindAgentCustomer(); } } catch (Exception ex) { var message = new JavaScriptSerializer().Serialize(ex.Message.ToString()); var script = string.Format("alert({0});", message); ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true); } }