public ActionResult SubmitForm(Sys_Items itemsEntity, string keyValue) { try { bool i = false; if (keyValue == "" || keyValue == null) { itemsEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserCode; itemsEntity.F_CreatorTime = DateTime.Now; itemsEntity.F_Id = System.Guid.NewGuid().ToString(); string[] notstr = { "ChildNodes" }; i = itemsApp.Add(itemsEntity, notstr); } else { itemsEntity.F_Id = keyValue; itemsEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserCode; itemsEntity.F_LastModifyTime = DateTime.Now; string[] notstr = { "ChildNodes", "F_CreatorUserId", "F_CreatorTime", "F_ParentId" }; i = itemsApp.Update(itemsEntity, notstr); } if (i) { return(Success()); } else { return(Warning()); } } catch (Exception ex) { return(Error(ex.Message)); } }
public void SubmitForm(Sys_Items entity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { entity.F_Id = keyValue; var LoginInfo = OperatorProvider.Provider.GetCurrent(); if (LoginInfo != null) { entity.F_LastModifyUserId = LoginInfo.UserId; } entity.F_LastModifyTime = DateTime.Now; service.Update(entity); } else { entity.F_Id = Common.GuId(); var LoginInfo = OperatorProvider.Provider.GetCurrent(); if (LoginInfo != null) { entity.F_CreatorUserId = LoginInfo.UserId; } entity.F_CreatorTime = DateTime.Now; service.Insert(entity); } }
public void SubmitForm(Sys_Items itemsEntity, string keyValue) { OperatorModel op = OperatorProvider.Provider.GetCurrent(); if (!string.IsNullOrEmpty(keyValue)) { //itemsEntity.Modify(keyValue); itemsEntity.F_Id = keyValue; itemsEntity.F_LastModifyTime = DateTime.Now; itemsEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserId; service.Update(itemsEntity); LogHelper.Info("字典:【" + itemsEntity.F_FullName + "】编辑!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OpType.System, null, "", "", ViewLevel.Admin); } else { //itemsEntity.Create(); itemsEntity.F_Id = Common.GuId(); itemsEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserId; itemsEntity.F_CreatorTime = DateTime.Now; service.Insert(itemsEntity); LogHelper.Info("字典:【" + itemsEntity.F_FullName + "】新增!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OpType.System, null, "", "", ViewLevel.Admin); } }
public ActionResult SubmitForm(Sys_Items itemsEntity, string keyValue) { itemsApp.SubmitForm(itemsEntity, keyValue); return(Success("操作成功。")); }
public bool Update(Sys_Items obj, string[] disablestr = null) { return(dal.Update(obj, disablestr)); }
/// <summary> /// 添加 /// </summary> /// <returns></returns> public bool Add(Sys_Items obj, string[] disstr = null) { return(dal.Add(obj, disstr)); }