public ActionResult resellersignup(User user) { Site Site = GetSite(user.SiteID); string AuthToken = ""; if (ModelState.IsValid) { user.RecordStatusID = NeedApproveReseller ? (int)RecordStatus.INACTIVE : (int)RecordStatus.ACTIVE; user.PasswordSalt = WBHelper.CreateSalt(); user.PasswordHash = WBHelper.CreatePasswordHash(user.PasswordHash, user.PasswordSalt); int result = _service.SaveReseller(user, Site.ID, WBHelper.CurrentLangID(), SiteCacher.SiteSMTPDetail().ID, WBHelper.SiteAdminEmail(Site)); if (result.Equals(1)) { if (!NeedApproveReseller) { AuthToken = HttpUtility.UrlEncode(CryptorEngine.Encrypt("true" + SettingConstants.Seprate + user.Email + SettingConstants.Seprate + "NA" + SettingConstants.Seprate + "true", true)); } else { AuthToken = HttpUtility.UrlEncode(CryptorEngine.Encrypt("true" + SettingConstants.Seprate + user.Email + SettingConstants.Seprate + "NA" + SettingConstants.Seprate + "false", false)); } } else if (result.Equals(-1)) { AuthToken = HttpUtility.UrlEncode(CryptorEngine.Encrypt("false" + SettingConstants.Seprate + "NA" + SettingConstants.Seprate + "-1" + SettingConstants.Seprate + "false", true)); } else { AuthToken = HttpUtility.UrlEncode(CryptorEngine.Encrypt("false" + SettingConstants.Seprate + "NA" + SettingConstants.Seprate + "-2" + SettingConstants.Seprate + "false", true)); } } else { AuthToken = HttpUtility.UrlEncode(CryptorEngine.Encrypt("false" + SettingConstants.Seprate + "NA" + SettingConstants.Seprate + "-3" + SettingConstants.Seprate + "false", true)); } // If we got this far, something failed, redisplay form string url = "http://" + (string.IsNullOrEmpty(Site.Alias) ? Site.CName : Site.Alias) + "/staticpage/resellersignupresult?authtoken=" + AuthToken; return(Redirect301(url, (string.IsNullOrEmpty(Site.Alias) ? Site.CName : Site.Alias))); }
public ActionResult CancellationRequest(SupportRequest supportrequest, FormCollection collection) { if (ModelState.IsValid && collection != null) { Audit audit = new Audit(); audit.ByUserID = user.ID; audit.DateCreated = System.DateTimeWithZone.Now; audit.DateModified = System.DateTimeWithZone.Now; audit.HttpHeaderDump = HttpUtility.UrlDecode(System.Web.HttpContext.Current.Request.Headers.ToString()); audit.IP = System.Web.HttpContext.Current.Request.UserHostAddress; SupportRequest sr = new SupportRequest(); sr.isOpen = true; sr.OrderDetailID = Convert.ToInt32(collection["requestid"]); sr.RefundStatusID = Convert.ToInt16(collection["RefundStatusID"]); sr.SiteID = Site.ID; sr.SupportTypeID = (int)SupportType.REFUNDREQUEST; sr.UserID = user.ID; sr.ExternalIncidentID = string.Empty; sr.AuditDetails = audit; sr.Subject = @WBSSLStore.Resources.GeneralMessage.Message.RefundRequest_Caption + "-" + @WBSSLStore.Resources.GeneralMessage.Message.Invoice_Header + "#" + (collection["IncidentID"]); sr.User = user; sr.Reason = collection["ddlReason"]; SupportDetail sd = new SupportDetail(); sd.AuditDetails = audit; sd.SupportRequest = sr; sd.StaffNote = ""; sd.Comments = "<span><b>" + user.FirstName + " " + user.LastName + " ( " + DateTimeWithZone.Now + " )</b></span><p>" + collection["txtcomment"] + "<p/>"; _viewModel.Add(sd); _unitOfWork.Commit(); var _newsupportdetail = _viewModel.Find(d => d.ID == sd.ID) .EagerLoad(d => d.SupportRequest, d => d.SupportRequest.User, d => d.SupportRequest.OrderDetail) .FirstOrDefault(); _newsupportdetail.SupportRequest.OrderDetail.InvoiceNumber = WBHelper.InvoicePrefix(Site) + _newsupportdetail.SupportRequest.OrderDetail.OrderID; var _emailService = DependencyResolver.Current.GetService <IEmailQueueService>(); if (sd.SupportRequest.User.UserType == UserType.RESELLER) { _emailService.PrepareEmailQueue(Site.ID, LangID, EmailType.RESELLER_SUPPORT_NOTIFICATION, SMTPID, sd.SupportRequest.User.Email, _newsupportdetail); } else { _emailService.PrepareEmailQueue(Site.ID, LangID, EmailType.CUSTOMER_SUPPORT_NOTIFICATION, SMTPID, sd.SupportRequest.User.Email, _newsupportdetail); } //send mail to admin _emailService.PrepareEmailQueue(Site.ID, LangID, EmailType.ADMIN_SUPPORT_NOTIFICATION, SMTPID, WBHelper.SiteAdminEmail(Site), _newsupportdetail); _unitOfWork.Commit(); } return(RedirectToAction("index")); }