示例#1
0
        public dynamic Login()
        {
            string     name     = Fun.Query("name");
            string     password = Fun.Query("password");
            LoginBLL   bll      = new LoginBLL();
            S_UserInfo user     = bll.Login(name, password);

            if (user == null)
            {
                return("失败");
            }
            UserInfo u = new UserInfo();

            u.id   = user.user_id;
            u.name = user.user_name.Trim();
            ManagerBLL    m       = new ManagerBLL();
            S_ManagerInfo manager = m.GetManagerByLoginId(user.user_id);

            if (manager != null)
            {
                return(new { data = u, manager = manager });
            }
            else
            {
                CustomerBLL    c        = new CustomerBLL();
                C_CustomerInfo customer = c.GetCustomerByLoginId(user.user_id);
                return(new { data = u, customer = customer });
            }
        }
示例#2
0
        public int Register(string name, string password, string openId)
        {
            DateTime   time = DateTime.Now;
            S_UserInfo user = new S_UserInfo();

            user.user_name  = name;
            user.user_pwd   = password;
            user.user_state = 1;
            user.user_time  = time;
            user.user_wx_id = openId;
            if (ms.Insert(user))
            {
                return(user.user_id);
            }
            else
            {
                return(0);
            }
        }