コード例 #1
0
        public ActionResult Checkout()
        {
            var createOrderCommand = new CreateOrderCommand(Cart.ProductsIdsWithCount);

            Gate.Dispatch(createOrderCommand);

            return(RedirectToAction("ConfirmOrder", new { orderId = createOrderCommand.OrderId }));
        }
コード例 #2
0
ファイル: UploadController.cs プロジェクト: jladuval/MyPlace
        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
ファイル: DinnerController.cs プロジェクト: jladuval/MyPlace
        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));
 }