private Integration.Mertex.services GetMertexService() { var service = new Integration.Mertex.services(); service.Url = ConfigurationManager.AppSettings["WebtexBaseUrl"] + "/redant/services.asmx"; return(service); }
public ActionResult BasketCommand(string command, string redirectUrl) { string user = Session["B2BUsername"] as string; string password = Session["B2BPassword"] as string; string guid = Session["B2BBasketGUID"] as string; if (!string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(guid)) { var service = new Integration.Mertex.services(); service.Url = ConfigurationManager.AppSettings["WebtexBaseUrl"] + "/redant/services.asmx"; switch (command.ToLowerInvariant()) { case "remove": string customerRef = Request.QueryString["customerRef"]; string lineNumber = Request.QueryString["lineNumber"]; string account = Request.QueryString["account"]; service.B2BRemoveBasketItem(user, password, guid, customerRef, lineNumber, account); return(Redirect(redirectUrl)); break; case "clear": //service.B2BClearBasket(); break; } } return(Redirect(redirectUrl)); }
public ActionResult BasketSummary() { string user = Session["B2BUsername"] as string; string password = Session["B2BPassword"] as string; string guid = Session["B2BBasketGUID"] as string; if (!string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(guid)) { var service = new Integration.Mertex.services(); service.Url = ConfigurationManager.AppSettings["WebtexBaseUrl"] + "/redant/services.asmx"; var baskets = service.B2BGetBasket(user, password, guid); ColonyContext.Response.CurrentTemplate = "b2c"; return(View(baskets.ToList())); } return(RedirectToAction("Login", "B2BAuthentication", new { returnUrl = Url.Action("Index") })); }
public ActionResult Login(B2BLoginInputViewModel model, string returnUrl) { try { var service = new Integration.Mertex.services(); service.Url = ConfigurationManager.AppSettings["WebtexBaseUrl"] + "/redant/services.asmx"; string guid = service.AttemptLogin(model.Email, model.Password); string basketguid = VisitorTrackingContext.CurrentVisitor.TrackedVisitorGuid.ToString(); if (guid.Length > 0) { Guid temp; if (Guid.TryParse(guid, out temp)) { Session["B2BGUID"] = guid; Session["B2BBasketGUID"] = basketguid; Session["B2BUsername"] = model.Email; Session["B2BPassword"] = model.Password; return(Redirect("http://82.113.227.75/raintegration/redant/ssologin.aspx?guid=" + guid + "&site=" + Request.Url.GetLeftPart(UriPartial.Authority) + "&basketguid=" + basketguid + "&page=" + returnUrl)); } } else { ViewBag.ReturnUrl = returnUrl; ColonyContext.Response.CurrentTemplate = "Login"; ModelState.AddModelError("LoginId", "Login ID or password is incorrect."); return(View(model)); } } catch (Exception ex) { ViewBag.ReturnUrl = returnUrl; ColonyContext.Response.CurrentTemplate = "Login"; ModelState.AddModelError("LoginId", "Login ID or password is incorrect."); return(View(model)); } return(new HttpNotFoundResult()); }