コード例 #1
0
        public ActionResult CreatePhone(CreatePhoneInputModel inputModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(null);
            }
            var phone = this.phonesServices.CreatePhone(inputModel, this.User.Identity.GetUserId());

            return(this.RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult CreatePhone()
        {
            var viewModel = new CreatePhoneInputModel();
            var list      = new List <SelectListItem>();

            for (int i = 2000; i < DateTime.Now.Year; i++)
            {
                list.Add(new SelectListItem()
                {
                    Value = i.ToString(),
                    Text  = i.ToString()
                });
            }

            viewModel.AvaivableYears = list;
            return(this.View(viewModel));
        }