public ActionResult SubmitForm(Sys_ItemsDetail itemsDetailEntity, string keyValue) { try { bool i = false; Sys_User uInfo = ViewData["Account"] as Sys_User; if (keyValue == "" || keyValue == null) { itemsDetailEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserCode; itemsDetailEntity.F_CreatorTime = DateTime.Now; itemsDetailEntity.F_Id = System.Guid.NewGuid().ToString(); i = itemsDetailApp.Add(itemsDetailEntity); } else { itemsDetailEntity.F_Id = keyValue; itemsDetailEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserCode; itemsDetailEntity.F_LastModifyTime = DateTime.Now; string[] notstr = { "F_CreatorUserId", "F_CreatorTime", "F_ParentId", "F_ItemId" }; i = itemsDetailApp.Update(itemsDetailEntity, notstr); } if (i) { return(Success()); } else { return(Warning()); } } catch (Exception ex) { return(Error(ex.Message)); } }
public ActionResult SubmitForm(Sys_ItemsDetailModel itemsDetailEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { itemsDetailEntity.F_Id = keyValue; var LoginInfo = OperatorProvider.Provider.GetCurrent(); if (LoginInfo != null) { itemsDetailEntity.F_LastModifyUserId = LoginInfo.UserId; } itemsDetailEntity.F_LastModifyTime = DateTime.Now; idbll.Update(itemsDetailEntity); } else { itemsDetailEntity.F_Id = Common.GuId(); var LoginInfo = OperatorProvider.Provider.GetCurrent(); if (LoginInfo != null) { itemsDetailEntity.F_CreatorUserId = LoginInfo.UserId; } itemsDetailEntity.F_CreatorTime = DateTime.Now; idbll.Add(itemsDetailEntity); } return(Success("操作成功。")); }