public ActionResult Create(ProductModels productmodels)
        {
            if (ModelState.IsValid)
            {
                productmodels.CreatedTime = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");

                //将商品加入数据库
                db.ProductModels.Add(productmodels);

                //保存数据库
                db.SaveChanges();

                //转到商品首页
                return RedirectToAction("Index");
            }

            return View(productmodels);
        }
 public ActionResult Edit(ProductModels productmodels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productmodels).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(productmodels);
 }