Example #1
0
 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.AddCustomerPriceGroupToSession(HttpContext.Current, Convert.ToString(Request["CustPriGrp"]));
             SessionManager.AddSplCustomerPriceGroupToSession(HttpContext.Current, Convert.ToString(Request["SplPriGrp"]));
             SessionManager.AddProductGroupCodeDefault(HttpContext.Current, "DYES");
             SessionManager.AddCustDiscountPercentage(HttpContext.Current, Convert.ToString(Request["DiscGrp"]));
         }
         else if (Request["Customer"] != null && Request["CustPriGrp"] != null)
         {
             SessionManager.AddCustomerToSession(HttpContext.Current, Convert.ToString(Request["Customer"]));
             SessionManager.AddCustomerPriceGroupToSession(HttpContext.Current, Convert.ToString(Request["CustPriGrp"]));
             SessionManager.AddSplCustomerPriceGroupToSession(HttpContext.Current, Convert.ToString(Request["SplPriGrp"]));
             SessionManager.AddCustDiscountPercentage(HttpContext.Current, Convert.ToString(Request["DiscGrp"]));
         }
         else if (Request["Consignee"] != null)
         {
             SessionManager.AddConsigneeToSession(HttpContext.Current, Convert.ToString(Request["Consignee"]));
         }
     }
     catch (Exception ex)
     {
         var message = new JavaScriptSerializer().Serialize(ex.Message.ToString());
         var script  = string.Format("alert({0});window.location='DashBoard.aspx';", message);
         ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true);
     }
 }