예제 #1
0
        public ActionResult Checkout()
        {
            var createOrderCommand = new CreateOrderCommand(Cart.ProductsIdsWithCount);

            Gate.Dispatch(createOrderCommand);

            return(RedirectToAction("ConfirmOrder", new { orderId = createOrderCommand.OrderId }));
        }
예제 #2
0
        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));
        }
예제 #3
0
        public int SalaryDeductionsInsert(SalaryDeductionsDto salaryDeductionsDto)
        {
            var addDeductionsSalary = new AddDeductionsSalaryCommand(salaryDeductionsDto);

            _gate.Dispatch(addDeductionsSalary);

            return(addDeductionsSalary.ReturnValue);
        }
예제 #4
0
        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));
        }
예제 #5
0
 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"));
 }
예제 #6
0
        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"));
        }
예제 #7
0
 public ActionResult Mailer()
 {
     _gate.Dispatch(new RunMailerCommand());
     return(new HttpStatusCodeResult(HttpStatusCode.OK));
 }
예제 #8
0
 public ActionResult AcceptApplicant(Guid dinnerId, Guid applicationId)
 {
     _gate.Dispatch(new AcceptApplicantCommand(applicationId, User.TryGetPrincipal().UserId));
     return(new HttpStatusCodeResult(HttpStatusCode.Accepted));
 }