Ejemplo n.º 1
0
 public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
 {
     try
     {
         roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
         return(Success("操作成功。"));
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
Ejemplo n.º 2
0
        public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                var role = roleApp.GetForm(keyValue);
                role.F_OrganizeId  = roleEntity.F_OrganizeId;
                role.F_FullName    = roleEntity.F_FullName;
                role.F_EnCode      = roleEntity.F_EnCode;
                role.F_Type        = roleEntity.F_Type;
                role.F_SortCode    = roleEntity.F_SortCode;
                role.F_EnabledMark = roleEntity.F_EnabledMark;
                role.F_AllowEdit   = roleEntity.F_AllowEdit;
                role.F_AllowDelete = roleEntity.F_AllowDelete;
                role.F_Description = roleEntity.F_Description;
                roleApp.SubmitForm(role, permissionIds.Split(','), keyValue);
            }
            else
            {
                roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
            }

            return(Success("操作成功。"));
        }
Ejemplo n.º 3
0
        public ActionResult SubmitForm(OrganizeEntity organizeEntity, string F_Account, string permissionIds, string keyValue)
        {
            var roleKey = "";
            var userKey = "";

            organizeEntity.F_CategoryId  = "Company";
            organizeEntity.F_ParentId    = "0";
            organizeEntity.F_Layers      = 1;
            organizeEntity.F_DeleteMark  = false;
            organizeEntity.F_AllowDelete = false;
            _organizeApp.SubmitForm(organizeEntity, keyValue);
            var roleEntity = new RoleEntity
            {
                F_Category    = 0,
                F_FullName    = "系统管理员",
                F_OrganizeId  = organizeEntity.F_Id,
                F_AllowDelete = false,
            };

            if (!string.IsNullOrEmpty(keyValue))
            {
                roleKey = _roleApp.GetDefaultCompanyRole(keyValue).F_Id;
            }
            _roleApp.SubmitForm(roleEntity, permissionIds.Split(','), roleKey);
            if (!string.IsNullOrEmpty(keyValue))
            {
                userKey = _userApp.GetDefaultUser(keyValue).F_Id;
            }
            var userEntity = new UserEntity
            {
                F_DeleteMark      = false,
                F_EnabledMark     = true,
                F_Description     = "系统内置账户",
                F_IsAdministrator = false,
                F_MobilePhone     = organizeEntity.F_MobilePhone,
                F_NickName        = organizeEntity.F_ManagerId,
                F_RealName        = organizeEntity.F_ManagerId,
                F_Email           = organizeEntity.F_Email,
                F_ManagerId       = organizeEntity.F_ManagerId,
                F_Account         = F_Account,
                F_OrganizeId      = organizeEntity.F_Id,
                F_AllowDelete     = false,
                F_RoleId          = roleEntity.F_Id,
            };

            _userApp.SubmitForm(userEntity, new UserLogOnEntity {
                F_UserPassword = F_Account
            }, userKey);
            return(Success("操作成功。"));
        }
Ejemplo n.º 4
0
        public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
        {
            roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);

            if (!string.IsNullOrEmpty(keyValue))
            {
                base.OperateLog("角色编辑:F_Id:" + keyValue, "/SystemManage/Role/SubmitForm", "角色管理", Application.DbLogType.Update);
            }
            else
            {
                base.OperateLog("新增角色:" + roleEntity.F_FullName, "/SystemManage/Role/SubmitForm", "角色管理", Application.DbLogType.Create);
            }

            return(Success("操作成功。"));
        }
Ejemplo n.º 5
0
        public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
        {
            var       module     = new ModuleApp().GetList().Where(a => a.F_Layers == 1 && a.F_EnCode == moduleName).FirstOrDefault();
            var       moduleitem = new ModuleApp().GetList().Where(a => a.F_Layers > 1 && a.F_EnCode == className.Substring(0, className.Length - 10)).FirstOrDefault();
            LogEntity logEntity;

            if (string.IsNullOrEmpty(keyValue))
            {
                roleEntity.F_DeleteMark  = false;
                roleEntity.F_AllowEdit   = false;
                roleEntity.F_AllowDelete = false;
                logEntity = new LogEntity(module.F_FullName, moduleitem.F_FullName, DbLogType.Create.ToString());
                logEntity.F_Description += DbLogType.Create.ToDescription();
            }
            else
            {
                logEntity = new LogEntity(module.F_FullName, moduleitem.F_FullName, DbLogType.Update.ToString());
                logEntity.F_Description += DbLogType.Update.ToDescription();
                logEntity.F_KeyValue     = keyValue;
            }
            try
            {
                logEntity.F_Account  = OperatorProvider.Provider.GetCurrent().UserCode;
                logEntity.F_NickName = OperatorProvider.Provider.GetCurrent().UserName;
                roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
                logEntity.F_Description += "操作成功";
                new LogApp().WriteDbLog(logEntity);
                return(Success("操作成功。"));
            }
            catch (Exception ex)
            {
                logEntity.F_Result       = false;
                logEntity.F_Description += "操作失败," + ex.Message;
                new LogApp().WriteDbLog(logEntity);
                return(Error(ex.Message));
            }
        }
Ejemplo n.º 6
0
 public ActionResult SubmitForm(RoleEntity roleEntity, string permissionIds, string keyValue)
 {
     roleApp.SubmitForm(roleEntity, permissionIds.Split(','), keyValue);
     return(Success("操作成功。"));
 }