Example #1
0
        public string upxiaoshou(int id)
        {
            Salest model = new Salest();

            model     = _Salest.GetById(id);
            model.del = 0;
            _Salest.Update(model);
            return("1");
        }
Example #2
0
        public ActionResult addxiaoshou(int?id = 0)
        {
            Salest model = new Salest();

            if (id != 0)
            {
                model = _Salest.GetById((int)id);
            }
            return(View(model));
        }
Example #3
0
 public ActionResult addxiaoshou(Salest model)
 {
     if (model.id != 0)
     {
         Salest models = new Salest();
         models      = _Salest.GetById(model.id);
         models.img  = model.img;
         models.jidu = model.jidu;
         models.yue  = model.yue;
         models.nian = model.nian;
         models.name = model.name;
         _Salest.Update(models);
     }
     else
     {
         model.del = 1;
         _Salest.Insert(model);
     }
     return(RedirectToAction("xiaoshou", "Product"));
 }