public ActionResult Edit(SpecialModel model, int id = -1) { SpecialInfo specialInfo = Special.AdminGetModelById(id); if (specialInfo == null) { return(PromptView("专题不存在")); } if (ModelState.IsValid) { specialInfo.Name = model.Name; specialInfo.Title = model.Title; specialInfo.ImgUrl = model.ImgUrl; specialInfo.LogoUrl = model.LogoUrl; specialInfo.IsOut = model.IsOut; specialInfo.OutUrl = model.OutUrl; specialInfo.Body = model.Body; specialInfo.DisplayOrder = model.DisplayOrder; Special.Update(specialInfo); return(PromptView("专题编辑成功")); } Load(); return(View(model)); }
public ActionResult Edit(int id = -1) { SpecialInfo specialInfo = Special.AdminGetModelById(id); if (specialInfo == null) { return(PromptView("专题信息不存在")); } SpecialModel model = new SpecialModel { SpecialID = specialInfo.SpecialID, Name = specialInfo.Name, Title = specialInfo.Title, ImgUrl = specialInfo.ImgUrl, LogoUrl = specialInfo.LogoUrl, IsOut = specialInfo.IsOut, OutUrl = specialInfo.OutUrl, Body = specialInfo.Body, DisplayOrder = specialInfo.DisplayOrder }; Load(); return(View(model)); }