示例#1
0
        public ReplayBase DelSysUser(string Id)
        {
            SysManagerService sms = new SysManagerService();

            sms.GetSysUser(Id);
            ReplayBase result = sms.DelSysUser();

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                //发起者
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "删除用户:" + sms.SysUserInfo.FullName + "[" + sms.SysUserInfo.LoginName + "]",
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);

                SysManagerService sms1 = new SysManagerService();//操作员
                sms1.GetSysUser(User.Identity.Name);
                //被记录
                SysUserLogModel log1 = new SysUserLogModel()
                {
                    SysUserId = Id,
                    Describe  = "用户被删除By:" + sms1.SysUserInfo.FullName
                };
                SysManagerService.CreateSysUserLog(log1);
            }

            return(result);
        }
示例#2
0
        public ReplayBase ReSetUserPwd(string Id)
        {
            SysManagerService sms = new SysManagerService();

            sms.GetSysUser(Id);
            ReplayBase result = sms.ReSetUserPwd();

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                //发起者
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "重置用户密码:" + sms.SysUserInfo.FullName,
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);

                SysManagerService sms1 = new SysManagerService();//操作员
                sms1.GetSysUser(User.Identity.Name);
                //被记录
                SysUserLogModel log1 = new SysUserLogModel()
                {
                    SysUserId = Id,
                    Describe  = "用户密码被重置By:" + sms1.SysUserInfo.FullName
                };
                SysManagerService.CreateSysUserLog(log1);
            }

            return(result);
        }
示例#3
0
        public ReplayBase EditSysUser(SysUserModel sysuserinfo)
        {
            SysManagerService sms = new SysManagerService();

            sms.SysUserInfo = sysuserinfo;
            ReplayBase result = sms.SaveUser();

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                //发起者
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "添加/编辑用户:" + sms.SysUserInfo.FullName,
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);

                SysManagerService sms1 = new SysManagerService();//操作员
                sms1.GetSysUser(User.Identity.Name);
                //被记录
                SysUserLogModel log1 = new SysUserLogModel()
                {
                    SysUserId = result.ReturnMessage,
                    Describe  = "用户被创建By" + sms1.SysUserInfo.FullName
                };
                SysManagerService.CreateSysUserLog(log1);
            }

            return(result);
        }
示例#4
0
        public void ActionIndex(SysUserLogModel model)
        {
            // sap xep tu dong
            string orderBy = AutoSort(model.Sort);

            // tao danh sach
            var dbQuery = CPUserLogService.Instance.CreateQuery()
                          .Take(model.PageSize)
                          .OrderBy(orderBy)
                          .Skip(model.PageIndex * model.PageSize);

            ViewBag.Data      = dbQuery.ToList();
            model.TotalRecord = dbQuery.TotalRecord;
            ViewBag.Model     = model;
        }
示例#5
0
        /// <summary>
        /// 创建系统用户日志
        /// </summary>
        /// <param name="condtion"></param>
        /// <returns></returns>
        internal static ReplayBase CreateSysUserLog(SysUserLogModel condtion)
        {
            ReplayBase result = new ReplayBase();

            try
            {
                result = BaseSysTemDataBaseManager.SysCreateSysUserLog(condtion);
            }
            catch (Exception e) {
                result.ReturnCode    = EnumErrorCode.ServiceError;
                result.ReturnMessage = "服务器错误 500";
                SysSaveErrorLogMsg(e.ToString(), condtion);
            }
            return(result);
        }
示例#6
0
        public ReplayBase DelSysLog(DelSysLogRequestModel condtion)
        {
            ReplayBase result = SysManagerService.DelSysLog(condtion);

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "删除了" + condtion.rows.Count.ToString() + "条系统运行日志",
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }
            return(result);
        }
示例#7
0
        public ReplayBase DelSysMenus(string Ids)
        {
            ReplayBase result = SysManagerService.DelSysMenusByIds(Ids);

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "删除系统菜单节点:" + Ids,
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }
            return(result);
        }
        public void ActionIndex(SysUserLogModel model)
        {
            // sap xep tu dong
            string orderBy = AutoSort(model.Sort);

            // tao danh sach
            var dbQuery = CPUserLogService.Instance.CreateQuery()
                                .Take(model.PageSize)
                                .OrderBy(orderBy)
                                .Skip(model.PageIndex * model.PageSize);

            ViewBag.Data = dbQuery.ToList();
            model.TotalRecord = dbQuery.TotalRecord;
            ViewBag.Model = model;
        }
示例#9
0
        public ReplayBase ChangeSysMenuPid(RequestChangeSysMenuPidModel condtion)
        {
            ReplayBase result = SysManagerService.ChangeSysMenuPid(condtion);

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "调整菜单节点位置:" + condtion.MenuId.ToString(),
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }

            return(result);
        }
示例#10
0
        public ReplayBase ChangeSysUserPwd(RequestChangeUserPwdModel condtion)
        {
            condtion.UserId = User.Identity.Name;
            ReplayBase result = SysManagerService.ChangeSysUserPwd(condtion);

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "用户修改登陆密码",
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }

            return(result);
        }
示例#11
0
        public ReplayBase SysUserLogon(RequestUserLogoModel condtion)
        {
            ReplayBase result = SysManagerService.SysUserLogon(condtion);

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                //保存登陆信息
                FormsAuthentication.SetAuthCookie(result.ReturnMessage, true);

                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "用户登录到后台系统,IP地址:" + System.Web.HttpContext.Current.Request.UserHostAddress,
                    SysUserId = result.ReturnMessage
                };
                SysManagerService.CreateSysUserLog(log);
            }
            return(result);
        }
示例#12
0
        public ReplayBase EditSysMenu(SysMenuModel SysMenu)
        {
            SysManagerService sms = new SysManagerService();

            sms.SysMenu = SysMenu;
            ReplayBase result = sms.SaveMenu();

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "添加/编辑菜单:" + SysMenu.Name,
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }

            return(result);
        }
示例#13
0
        public ReplayBase DelSysRole(long Id)
        {
            SysManagerService sms = new SysManagerService();

            sms.GetRole(Id);
            ReplayBase result = sms.DelRole();

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "删除角色:" + sms.UserRole.RoleName,
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }

            return(result);
        }
示例#14
0
        public ReplayBase EditSysRole(SysUserRoleModel SysRole)
        {
            SysManagerService sms = new SysManagerService();

            sms.UserRole = SysRole;
            ReplayBase result = sms.SaveRole();

            if (result.ReturnCode == EnumErrorCode.Success)
            {
                SysUserLogModel log = new SysUserLogModel()
                {
                    Describe  = "添加/编辑角色:" + SysRole.RoleName,
                    SysUserId = User.Identity.Name
                };
                SysManagerService.CreateSysUserLog(log);
            }

            return(result);
        }