public ActionResult _Insert(FailCode failCode) { if (ModelState.IsValid) { IList<FailCode> failCodeList = genericMgr.FindAll<FailCode>("from FailCode as f where f.Code=?", failCode.Code); if (failCodeList.Count > 0) { SaveErrorMessage(Resources.EXT.ControllerLan.Con_CodeAlreadyExists); } else { genericMgr.CreateWithTrim(failCode); } } IList<FailCode> FailCodeList = genericMgr.FindAll<FailCode>(); return PartialView(new GridModel(FailCodeList)); }
public ActionResult _Insert(FailCode failCode) { if (ModelState.IsValid) { IList<FailCode> failCodeList = base.genericMgr.FindAll<FailCode>("from FailCode as f where f.Code=?", failCode.Code); if (failCodeList.Count > 0) { SaveErrorMessage("代码已经存在"); } else { base.genericMgr.Create(failCode); } } IList<FailCode> FailCodeList = base.genericMgr.FindAll<FailCode>(); return PartialView(new GridModel(FailCodeList)); }
public ActionResult _Update(FailCode failCode,string id) { ModelState.Remove("Code"); FailCode newFailCode = genericMgr.FindById<FailCode>(id); newFailCode.Code = id; newFailCode.ENGDescription = failCode.ENGDescription; newFailCode.CHNDescription = failCode.CHNDescription; genericMgr.UpdateWithTrim(newFailCode); IList<FailCode> FailCodeList = genericMgr.FindAll<FailCode>(); return PartialView(new GridModel(FailCodeList)); }