public void SubmitForm(OrganizeColumnEntity moduleEntity, string keyValue) { if (!service.IsExistAndMarkName(keyValue, "FullName", moduleEntity.FullName, "OrganizeId", moduleEntity.OrganizeId, true)) { string organizeId = SysLoginObjHelp.sysLoginObjHelp.GetOperator().OrganizeId; if (!string.IsNullOrEmpty(keyValue)) { OrganizeColumnEntity organizeColumnEntity = GetForm(keyValue); if (organizeColumnEntity != null && !string.IsNullOrEmpty(organizeColumnEntity.Id)) { if (organizeId != organizeColumnEntity.OrganizeId) { throw new Exception("当前组织不合法,请联系管理员!"); } } moduleEntity.OrganizeId = organizeId; moduleEntity.Modify(keyValue); service.Update(moduleEntity); //添加日志 LogHelp.logHelp.WriteDbLog(true, "修改组织栏目信息=>" + moduleEntity.FullName, Enums.DbLogType.Update, "组织栏目管理"); } else { moduleEntity.OrganizeId = organizeId; moduleEntity.Create(); service.Insert(moduleEntity); //添加日志 LogHelp.logHelp.WriteDbLog(true, "添加组织栏目信息=>" + moduleEntity.FullName, Enums.DbLogType.Create, "组织栏目管理"); } } else { throw new Exception("名称已存在,请重新输入!"); } }
//[ValidateAntiForgeryToken] public ActionResult SubmitForm(OrganizeColumnEntity userEntity, string keyValue) { organizeColumnApp.SubmitForm(userEntity, keyValue); return(Success("操作成功。")); }