Ejemplo n.º 1
0
        /// <summary>
        /// 大型车辆
        /// </summary>
        /// <returns></returns>
        public IActionResult BigTransportCar(string returnUrl = null)
        {
            ViewData["ReturnUrl"] = returnUrl;
            BigCarInfoViewModel bm = new BigCarInfoViewModel();

            return(View(bm));
        }
Ejemplo n.º 2
0
 [ValidateAntiForgeryToken]  //防止跨站请求攻击
 public IActionResult Issue(BigCarInfoViewModel model, string returnUrl = null)
 {
     ViewData["ReturnUrl"] = returnUrl;
     if (ModelState.IsValid)
     {
         //写入数据库  待审核
         //1.数据转换
         var databaseModel = (CarInfo)model;
         databaseModel.JoinTime = DateTimeHelper.GetWeixinDateTime(DateTime.Now);
         //2.写入数据库
     }
     return(View(model));
 }
Ejemplo n.º 3
0
        [ValidateAntiForgeryToken]  //防止跨站请求攻击
        public IActionResult Issue(BigCarInfoViewModel model, string returnUrl = null)
        {
            ViewData["ReturnUrl"] = returnUrl;
            if (ModelState.IsValid)
            {
                //写入数据库  待审核
                //1.数据转换
                var dbModel = (CarInfo)model;

                //2.写入数据库
                _db.Carinfo.Add(dbModel);
                _db.SaveChanges();
                return(RedirectToLocal(returnUrl));
            }
            return(View(model));
        }