public string update(int id) { sjth.Model.newstype models = new sjth.Model.newstype(); models = newstypeBLL.GetById(id); models.del = 0; newstypeBLL.Update(models); return("1"); }
public ActionResult addtype(int?id = 0) { sjth.Model.newstype model = new sjth.Model.newstype(); if (id != 0) { model = newstypeBLL.GetById((int)id); } return(View(model)); }
public ActionResult addtype(sjth.Model.newstype model) { if (model.id == 0) { model.datatimes = DateTime.Now; model.del = 1; newstypeBLL.Insert(model); return(RedirectToAction("newstype", "Product")); } else { sjth.Model.newstype models = new sjth.Model.newstype(); models = newstypeBLL.GetById(model.id); models.typename = model.typename; newstypeBLL.Update(models); return(RedirectToAction("newstype", "Product")); } }