public string upxiaoshou(int id) { Salest model = new Salest(); model = _Salest.GetById(id); model.del = 0; _Salest.Update(model); return("1"); }
public ActionResult addxiaoshou(int?id = 0) { Salest model = new Salest(); if (id != 0) { model = _Salest.GetById((int)id); } return(View(model)); }
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")); }