public ActionResult Save(SaveGameKaDetail savemodel) { if (ModelState.IsValid) { if (savemodel.ID == null) { var model = new GameKaDetail { KaID = savemodel.KaID, IsUser = savemodel.IsUser, UseAccount = savemodel.UseAccount, UsedDate = savemodel.UsedDate, Code = savemodel.Code, }; _gamekadetailTask.Add(model); } else { var model = _gamekadetailTask.GetById((int)savemodel.ID); if (model == null) { return(AlertMsg("参数错误", HttpContext.Request.UrlReferrer.PathAndQuery)); } model.KaID = savemodel.KaID; model.IsUser = savemodel.IsUser; model.UseAccount = savemodel.UseAccount; model.UsedDate = savemodel.UsedDate; model.Code = savemodel.Code; _gamekadetailTask.Update(model); } return(AlertMsg("保存成功", HttpContext.Request.UrlReferrer.PathAndQuery)); } return(View(savemodel)); }
public void Update(GameKaDetail model) { _dao.Update(model); }
public void Add(GameKaDetail model) { _dao.Add(model); }