public ActionResult Checkout() { var createOrderCommand = new CreateOrderCommand(Cart.ProductsIdsWithCount); Gate.Dispatch(createOrderCommand); return(RedirectToAction("ConfirmOrder", new { orderId = createOrderCommand.OrderId })); }
public ActionResult ProfileImage(HttpPostedFileBase file) { var userId = User.TryGetPrincipal().UserId; var folderPath = userId + "/Profile"; var url = _storage.SaveImage(file, folderPath); if (url != null) { _gate.Dispatch(new AddProfileImageCommand(userId, url, folderPath, file.FileName)); } return(Json(url)); }
public int SalaryDeductionsInsert(SalaryDeductionsDto salaryDeductionsDto) { var addDeductionsSalary = new AddDeductionsSalaryCommand(salaryDeductionsDto); _gate.Dispatch(addDeductionsSalary); return(addDeductionsSalary.ReturnValue); }
public ActionResult Apply(Guid id, string partnerEmail) { if (!string.IsNullOrEmpty(partnerEmail) && !_securityUserReader.UserExists(partnerEmail)) { return(new HttpStatusCodeResult(HttpStatusCode.NotAcceptable)); } _gate.Dispatch( new ApplyForDinnerCommand(User.TryGetPrincipal().UserId, id) { PartnerEmail = partnerEmail, ConfirmUrl = Url.Action("ConfirmAttending", "Membership", null, Request.Url.Scheme) }); if (partnerEmail != null) { _gate.Dispatch(new RunMailerCommand()); } return(new HttpStatusCodeResult(HttpStatusCode.Accepted)); }
public ActionResult EditProfile(PrivateProfileModel model) { _gate.Dispatch( new AlterPrivateProfileCommand( User.TryGetPrincipal().UserId, model.FirstName, model.LastName, model.Address, model.Suburb, model.City, model.Country, model.Postcode, model.Gender, model.Orientation, model.Romance, model.Friendship) { Description = model.Description, Age = model.Age, }); return(RedirectToAction("Index")); }
public ActionResult Activate(string token) { var userdto = _securityUserReader.GetUserFromToken(token); if (userdto != null) { _gate.Dispatch(new ActivateUserCommand(token)); _authenticationService.LogIn(userdto.Email, true, userdto.UserId, userdto.Roles, userdto.HasDetails, true); TempData["SuccessMessage"] = "Your email has been activated."; return(RedirectToAction("Index", "Profile")); } TempData["ErrorMessage"] = "That appears to be an invalid activation token"; return(RedirectToAction("Index", "Home")); }
public ActionResult Mailer() { _gate.Dispatch(new RunMailerCommand()); return(new HttpStatusCodeResult(HttpStatusCode.OK)); }
public ActionResult AcceptApplicant(Guid dinnerId, Guid applicationId) { _gate.Dispatch(new AcceptApplicantCommand(applicationId, User.TryGetPrincipal().UserId)); return(new HttpStatusCodeResult(HttpStatusCode.Accepted)); }