Exemplo n.º 1
0
        /// <summary>
        /// 设定主账号
        /// </summary>
        /// <returns></returns>
        public ActionResult SettingUser(string ids)
        {
            string     FullName      = "";
            string     LoginName     = "";
            string     usersFullName = "";
            int        id            = ids == "" ? 0 : Convert.ToInt32(ids);
            AgentsInfo agentsInfo    = agentsInfoService.GetOne(id);

            if (agentsInfo != null)
            {
                FullName = agentsInfo.FullName;
                AgentsUsers agentsUsers = agentsUsersService.GetAgentsUsersList(o => o.AgentsId == agentsInfo.AgentsId && o.AgentType == 1).FirstOrDefault();
                if (agentsUsers != null)
                {
                    LoginName     = agentsUsers.LoginName;
                    usersFullName = agentsUsers.FullName;
                }
            }

            //代理商全称
            ViewBag.FullName = FullName;
            //主登录账号
            ViewBag.LoginName = LoginName;
            //姓名
            ViewBag.usersFullName = usersFullName;
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Save(int?id)
        {
            var obj = new AgentsUsers
            {
            };

            if (id.HasValue)
            {
                obj          = agentsUsersService.GetOne(id.Value);
                obj.LoginPwd = "";
            }
            return(View(obj.IsNullThrow()));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 设定主账号
        /// </summary>
        public OpResult SettingUser(System.Collections.Specialized.NameValueCollection nvl)
        {
            //ids
            var ids = (nvl["ids"] ?? "").Trim();
            //主登录账号
            var LoginName = (nvl["LoginName"] ?? "").Trim();
            //密码
            var LoginPwd = (nvl["LoginPwd"] ?? "").Trim();
            //姓名
            var usersFullName = (nvl["usersFullName"] ?? "").Trim();

            var sId        = ids.Split(',').Select(o => int.Parse(o == ""?"0":o));
            var agentsInfo = AgentsInfoRepository.GetQuery(o => sId.Contains(o.Id)).ToList().FirstOrDefault();

            if (agentsInfo != null)
            {
                AgentsUsers agentsUsers = agentsUsersService.GetAgentsUsersList(o => o.AgentType == 1 && o.AgentsId == agentsInfo.AgentsId).FirstOrDefault();
                if (agentsUsers == null)
                {
                    agentsUsers          = new AgentsUsers();
                    agentsUsers.AgentsId = agentsInfo.AgentsId;
                    //主账户
                    agentsUsers.AgentType = 1;
                }
                if (LoginName != "")
                {
                    agentsUsers.LoginName = LoginName;
                }
                if (LoginPwd != "")
                {
                    agentsUsers.LoginPwd = LoginPwd;
                }
                if (usersFullName != "")
                {
                    agentsUsers.FullName = usersFullName;
                }
                agentsUsers.Status = 1;
                return(agentsUsersService.SaveOrUpdate(agentsUsers));
            }
            else
            {
                return(OpResult.Fail("发生错误!"));
            }
        }
Exemplo n.º 4
0
        public ActionResult Save(AgentsUsers agentsUsers)
        {
            var op = agentsUsersService.SaveOrUpdate(agentsUsers);

            return(new OpActionResult(op));
        }