public void SubmitForm(OrganizeEntity organizeEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); service.Update(organizeEntity); try { //添加日志 LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "修改组织机构信息【" + organizeEntity.F_FullName + "】成功!"); } catch { } } else { organizeEntity.Create(); service.Insert(organizeEntity); try { //添加日志 LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "新建组织机构信息【" + organizeEntity.F_FullName + "】成功!"); } catch { } } }
public void SubmitForm(OrganizeEntity organizeEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); service.Update(organizeEntity); } else { organizeEntity.Create(); service.Insert(organizeEntity); } }
/// <summary> /// 保存机构表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="organizeEntity">机构实体</param> /// <returns></returns> public void AddOrganize(string keyValue, OrganizeEntity organizeEntity) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); int res = this.BaseRepository().Update <OrganizeEntity>(organizeEntity); } else { organizeEntity.Create(); int res = this.BaseRepository().Insert <OrganizeEntity>(organizeEntity); } }
/// <summary> /// 保存机构表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="organizeEntity">机构实体</param> /// <returns></returns> public void AddOrganize(string keyValue, OrganizeEntity organizeEntity) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); int res = o.BllSession.OrganizeBll.Update(organizeEntity); } else { organizeEntity.Create(); bool res = o.BllSession.OrganizeBll.Insert(organizeEntity); } }
/// <summary> /// 保存机构表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="organizeEntity">机构实体</param> /// <returns></returns> public void SaveForm(string keyValue, OrganizeEntity organizeEntity) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); Base_Organize organize = Base_Organize.SingleOrDefault("where OrganizeId=@0", keyValue); organize = EntityConvertTools.CopyToModel <OrganizeEntity, Base_Organize>(organizeEntity, organize); organize.OrganizeId = keyValue; organize.Update(); } else { organizeEntity.Create(); Base_Organize organize = EntityConvertTools.CopyToModel <OrganizeEntity, Base_Organize>(organizeEntity, null); organize.Insert(); } }
public void SubmitForm(OrganizeEntity organizeEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); service.Update(organizeEntity); //添加日志 LogHelp.logHelp.WriteDbLog(true, "修改机构信息=>" + organizeEntity.FullName, Enums.DbLogType.Update, "机构管理"); } else { organizeEntity.Create(); service.Insert(organizeEntity); //添加日志 LogHelp.logHelp.WriteDbLog(true, "添加机构信息=>" + organizeEntity.FullName, Enums.DbLogType.Create, "机构管理"); } }
/// <summary> /// 操作一个实体信息 /// </summary> /// <param name="organizeEntity"></param> /// <param name="keyValue"></param> public void SubmitForm(OrganizeEntity organizeEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); ResultClass <int> _ret = service.Update(organizeEntity); if (!_ret.Result) { throw new Exception(_ret.ErrorMessage); } } else { organizeEntity.Create(); ResultClass <int> _ret = service.Insert(organizeEntity); if (!_ret.Result) { throw new Exception(_ret.ErrorMessage); } } }
public void SubmitForm(OrganizeEntity organizeEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { List <OrganizeEntity> SelectEntitys = this.GetSelectEntitys(keyValue, ""); organizeEntity.FIsLeaf = SelectEntitys.Count > 1 ? false : true; organizeEntity.Modify(keyValue); service.Update(organizeEntity); if (organizeEntity.FIsOperation) { if (SelectEntitys.Count > 0) { for (int i = 0; i < SelectEntitys.Count; i++) { if (SelectEntitys[i].FId != keyValue) { OrganizeEntity Entity = new OrganizeEntity(); Entity = GetForm(SelectEntitys[i].FId); Entity.FIsOperation = organizeEntity.FIsOperation; Entity.Modify(Entity.FId); service.Update(Entity); } } } } } else { organizeEntity.Create(); service.Insert(organizeEntity); } }
public Task <int> SubmitForm(OrganizeEntity organizeEntity, string keyValue) { var claimsIdentity = _httpContext.HttpContext.User.Identity as ClaimsIdentity; var claim = claimsIdentity?.FindFirst(t => t.Type.Equals(ClaimTypes.NameIdentifier)); if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.Modify(keyValue); if (claim != null) { organizeEntity.F_LastModifyUserId = claim.Value; } return(_service.UpdateAsync(organizeEntity)); } else { organizeEntity.Create(); if (claim != null) { organizeEntity.F_CreatorUserId = claim.Value; } return(_service.InsertAsync(organizeEntity)); } }