コード例 #1
0
        public ActionResult Create(AccountInputModel accountInputModel)
        {
            var account = _mappingEngine.Map<AccountInputModel, Account>(accountInputModel);
            _repository.Create<Account>(account);

            return RedirectToAction("Index", "Sales");
        }
コード例 #2
0
        public ActionResult Edit(AccountInputModel accountInputModel, long id)
        {
            var account = _repository.GetById<Account>(id);
            account = _mappingEngine.Map<AccountInputModel, Account>(accountInputModel);

            Success("User {0} has been updated");
            return View("Create",accountInputModel);
        }
コード例 #3
0
        public ActionResult Create(AccountInputModel accountInputModel)
        {
            var account = Mapper.Map<AccountInputModel, Account>(accountInputModel);

            _repository.Create(account);

            return RedirectToAction("Index","Sale");
        }
コード例 #4
0
 public ActionResult Edit(AccountInputModel model, int id)
 {
     if (ModelState.IsValid)
     {
         var account = _mappingEngine.Map<AccountInputModel, Account>(model);
         _repository.Update(account);
         return RedirectToAction("index");
     }
     return View("Create", model);
 }
コード例 #5
0
        public ActionResult Edit(AccountInputModel model, int id)
        {
            if (ModelState.IsValid)
            {
                var account = _repository.GetById<Account>(model.Id);
                var tempSale = account.Sales;
                account = _mappingEngine.Map<AccountInputModel, Account>(model);
                account.Sales = tempSale;
                _repository.Update(account);

                Success("The model was updated!");
                return RedirectToAction("index");
            }
            return View("Create", model);
        }
コード例 #6
0
 public ActionResult Create(AccountInputModel accountInputModel)
 {
     var account = _mappingEngine.Map<AccountInputModel, Account>(accountInputModel);
     Information("This method is not implemented");
     return View(accountInputModel);
 }