Esempio n. 1
0
 public HomeController()
 {
     userLogic       = new SysUserLogic();
     itemDetailLogic = new SysItemsDetailLogic();
     userLogOnLogic  = new SysUserLogOnLogic();
     permissionLogic = new SysPermissionLogic();
 }
Esempio n. 2
0
        public ActionResult Handle(SysAgentWithdrawalRecordEntity model)
        {
            int row;
            var withModel = sysAgentWithdrawalRecordLogic.Get(model.id);

            if (withModel.Status != 3)
            {
                return(Error("已经处理,不可重复处理!"));
            }
            if (model.Status == 2)//驳回
            {
                row = sysAgentWithdrawalRecordLogic.Reject(model);
            }
            else//成功
            {
                if (model.WithdrawalAmount <= 0)
                {
                    return(Error("提现金额需要大于0!"));
                }
                var agentModel = new SysUserLogic().GetUserByID(withModel.AgentID);
                if (agentModel == null)
                {
                    return(Error("经纪人不存在!"));
                }
                if (agentModel.Balance / 10 < model.WithdrawalAmount)
                {
                    return(Error("提现金额不可大于余额!可提现余额:" + agentModel.Balance / 10));
                }
                row = sysAgentWithdrawalRecordLogic.Update(model, agentModel);
            }
            return(row > 0 ? Success() : Error());
        }
        private List <SysUser> GetUserList(int roleId)
        {
            LoginUserInfo currentLogin = this.WorkContext.CurrentUser;

            if (roleId < 1)
            {
                if (currentLogin.RoleId == 7 || currentLogin.RoleId == 8)
                {
                    roleId = currentLogin.RoleId;
                }
                else
                {
                    roleId = 7;
                }
            }

            //具有国内/国际开发主管角色的登入用户进入该页后,用户名下拉列表只列出自己的名字;
            //具有系统管理员角色或运维角色的登入用户进入该页后,用户名下拉列表列出符合角色下拉列表框中所选中角色的所有用户;
            //具有其他角色的登入用户进入该页后,用户名下拉列表框没有用户可选:
            List <SysUser> userList = new List <SysUser>();

            SysUserLogic sysUserLogic = new SysUserLogic();

            if ((currentLogin.RoleId == 7 || currentLogin.RoleId == 8) && currentLogin.RoleId == roleId)//7表示国内开发主管角色,8表示国际开发主管角色
            {
                userList = sysUserLogic.GetUserList(currentLogin.UserName, currentLogin.RoleId, 0).ToList <SysUser>();
            }
            else if (currentLogin.RoleId == 2 || currentLogin.RoleId == 4)//2表示系统管理员角色,4表示运维角色
            {
                userList = sysUserLogic.GetUserList("", -1, 0).ToList <SysUser>();
                userList = userList.Where(x => x.RoleId == roleId).ToList <SysUser>();
            }

            return(userList);
        }
Esempio n. 4
0
 public UserController()
 {
     userLogic             = new SysUserLogic();
     userRoleRelationLogic = new SysUserRoleRelationLogic();
     userLogOnLogic        = new SysUserLogOnLogic();
     userAnchorLogic       = new SysUserAnchorLogic();
 }
Esempio n. 5
0
        public ActionResult Form(SysAnchorRebateEntity model)
        {
            if (model.TipRebate > 100 || model.HourRebate > 100)
            {
                return(Error("返点不能大于100%"));
            }
            if (model.TipRebate < 0 || model.HourRebate < 0)
            {
                return(Error("返点不能小于0"));
            }
            var agentModel = new SysUserLogic().GetUserRebate(model.UserAccount);

            if (agentModel == null)
            {
                return(Error("上级账号不存在!"));
            }
            var checkTipRebate = 100 - agentModel.TipRebate;

            if (model.TipRebate > checkTipRebate)
            {
                return(Error("平台礼物返点为" + agentModel.TipRebate + ",上级礼物返点必须<=" + checkTipRebate));
            }
            var checkHourRebate = 100 - agentModel.HourRebate;

            if (model.HourRebate > checkHourRebate)
            {
                return(Error("平台工时返点为" + agentModel.HourRebate + ",上级工时返点必须<=" + checkHourRebate));
            }
            if (model.id == 0)
            {
                var userModel = sysAnchorRebateLogic.CheckAnchor(model.AnchorName);
                if (userModel == null)
                {
                    return(Error("当前主播账号不存在,请重新输入"));
                }
                var rebateModel = sysAnchorRebateLogic.GetRebateByAccount(userModel.id);
                if (rebateModel != null)
                {
                    return(Error("主播已有返点信息,不可重复添加"));
                }

                model.ShopID   = 0;
                model.AnchorID = userModel.id;
                model.parentID = agentModel.Id;
                int row = sysAnchorRebateLogic.Insert(model);
                return(row > 0 ? Success() : Error());
            }
            else
            {
                int row = sysAnchorRebateLogic.Update(model);
                return(row > 0 ? Success() : Error());
            }
        }
Esempio n. 6
0
        public ActionResult addShopAnchor(string idList, int userID)
        {
            var agentUser = new SysUserLogic().GetUserByShopID(userID);

            if (agentUser == null)
            {
                return(Error("商户没有经纪人,请先添加经纪人!"));
            }
            var result = sysShopLogic.AddShopAnchor(idList.ToStrArray(), userID, agentUser);

            if (result)
            {
                return(Success());
            }
            return(Error());
        }
Esempio n. 7
0
        public ActionResult Form(SysAgentWithdrawalRecordEntity model)
        {
            var agentModel = new SysUserLogic().GetUserByID(model.AgentID);

            if (agentModel == null)
            {
                return(Error("经纪人不存在!"));
            }
            if (agentModel.Balance / 10 < model.WithdrawalAmount)
            {
                return(Error("提现金额不可大于余额!可提现余额:" + agentModel.Balance / 10));
            }
            int row = sysAgentWithdrawalRecordLogic.Insert(model);

            return(row > 0 ? Success() : Error());
        }
Esempio n. 8
0
        public ActionResult UserJson()
        {
            var logic    = new SysUserLogic();
            var userList = logic.GetUserList(null, -1, -1).ToList();
            var list     = new List <IdNameModel>
            {
                new IdNameModel()
                {
                    Text  = "全部",
                    Value = ""
                }
            };

            list.AddRange(userList.Select(i => new IdNameModel()
            {
                Text = i.UserName, Value = i.UserName
            }));
            return(Content(JsonConvert.SerializeObject(list)));
        }
Esempio n. 9
0
 public ActionResult Form(SysAgentBankEntity model)
 {
     if (model.id == 0)
     {
         var agentModel = new SysUserLogic().CheckUserName(model.AgentName);
         if (agentModel == null)
         {
             return(Error("经纪人不存在!"));
         }
         model.AgentID = agentModel.Id;
         model.ShopID  = agentModel.ShopID;
         int row = sysAgentBankLogic.Insert(model);
         return(row > 0 ? Success() : Error());
     }
     else
     {
         int row = sysAgentBankLogic.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
Esempio n. 10
0
        public ActionResult ConfigServiceRight(int roleId = -1, int userId = 0)
        {
            //具有国内/国际开发主管角色的登入用户进入该页后,角色下拉列表只列出国内/国际开发主管,
            //否则,列出国内开发主管和国际开发主管两角色:
            SysRoleLogic   roleLogic    = new SysRoleLogic();
            List <SysRole> roleList     = roleLogic.GetRoleList().ToList <SysRole>();
            LoginUserInfo  currentLogin = this.WorkContext.CurrentUser;

            //7表示国内开发主管角色,8表示国际开发主管角色
            if (currentLogin.RoleId == 7 || currentLogin.RoleId == 8)
            {
                roleList = roleList.Where(x => x.RoleId == currentLogin.RoleId).ToList <SysRole>();
            }
            else
            {
                roleList = roleList.Where(x => (x.RoleId == 7 || x.RoleId == 8)).ToList <SysRole>();
            }
            ViewBag.RoleId = new SelectList(roleList, "RoleId", "RoleName");
            if (roleId < 1)
            {
                if (currentLogin.RoleId == 7 || currentLogin.RoleId == 8)
                {
                    ViewBag.CurrentRoleId = currentLogin.RoleId;
                }
                else
                {
                    ViewBag.CurrentRoleId = 7;
                }
            }
            else
            {
                ViewBag.CurrentRoleId = roleId;
            }

            List <SysUser> userList = GetUserList(roleId);

            ViewBag.UserId        = new SelectList(userList, "UserId", "RealName");
            ViewBag.CurrentUserId = userId;

            List <SysRoleRight> roleRightList = new List <SysRoleRight>();

            if (roleId > 0)
            {
                SysApplicationLogic appIdMenuLogic = new SysApplicationLogic();

                //求配置中心权限管理模块的各菜单项:
                List <SysApplicationEntity> appIdMenuList = null;
                SysUserLogic sysUserLogic     = new SysUserLogic();
                SysUser      sysUser          = null;
                int?         selectedUserId   = -1;
                string       selectedUserName = string.Empty;
                switch (roleId)
                {
                case 7:    //国内开发主管角色,目前只求针对国内机票产品线的配置中心权限管理模块的各菜单项:
                    sysUser = sysUserLogic.GetUserInfo(userId);
                    if (sysUser != null)
                    {
                        selectedUserName        = sysUser.RealName;
                        ViewBag.CurrentUserName = selectedUserName;
                    }
                    appIdMenuList = appIdMenuLogic.GetSysApplicationList(-1, -1, "", -1, -1, null, new List <int> {
                        1
                    }, selectedUserName).ToList <SysApplicationEntity>();
                    break;

                case 8:     //国际开发主管角色,目前只求针对国际机票产品线的配置中心权限管理模块的各菜单项:
                    sysUser = sysUserLogic.GetUserInfo(userId);
                    if (sysUser != null)
                    {
                        selectedUserName        = sysUser.RealName;
                        ViewBag.CurrentUserName = selectedUserName;
                    }
                    appIdMenuList = appIdMenuLogic.GetSysApplicationList(-1, -1, "", -1, -1, null, new List <int> {
                        2
                    }, selectedUserName).ToList <SysApplicationEntity>();
                    break;

                default:
                    break;
                }
                ViewBag.AppIdMenuList = appIdMenuList;

                selectedUserId = ViewBag.CurrentUserId as int?;
                roleRightList  = logic.GetRoleRightList(roleId, true, (selectedUserId.HasValue ? Convert.ToInt32(selectedUserId) : -1)).ToList <SysRoleRight>();
            }

            return(View(roleRightList));
        }
Esempio n. 11
0
 public RebateController()
 {
     sysRebateLogic = new SysRebateLogic();
     sysUserLogic   = new SysUserLogic();
 }
Esempio n. 12
0
 public AccountController()
 {
     userlogic      = new SysUserLogic();
     userLogOnLogic = new SysUserLogOnLogic();
     logLogic       = new LogLogic();
 }