Пример #1
0
        public Msg UserLogin(User user)
        {
            Msg msg = new Msg();

            msg.status = 0;
            if (string.IsNullOrEmpty(user.UserPwd) || user.UserPwd.Length < 6)
            {
                msg.status   = 0;
                msg.discript = "登录失败:密码不能为空或小于6位!";
                return(msg);
            }
            User entity = new DAL.UserDAL().Login(user.UserNum, user.UserPwd);

            if (entity == null)
            {
                msg.status   = 0;
                msg.discript = "登录失败";
                return(msg);
            }
            else
            {
                if (entity.UserPwd != user.UserPwd)
                {
                    msg.status   = 0;
                    msg.discript = "登录失败:账号密码错误!";
                    return(msg);
                }
                else
                {
                    msg.status   = 1;
                    msg.discript = "登录成功!正在跳转中...";
                    return(msg);
                }
            }
        }
Пример #2
0
 public CRMService()
 {
     TaskDAL taskdal = new TaskDAL();
     UserDAL  userdal = new UserDAL();
     CustomerDAL customerdal = new CustomerDAL();
     container.RegisterInstance<TaskDAL>(taskdal);
     container.RegisterInstance<UserDAL>(userdal);
     container.RegisterInstance<CustomerDAL>(customerdal);
 }
Пример #3
0
        public User users(User user)
        {
            User entity = new DAL.UserDAL().Login(user.UserNum, user.UserPwd);

            return(entity);
        }
Пример #4
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public bool getUser(User user)
 {
     DAL.UserDAL userdal = new DAL.UserDAL();
     return(userdal.getUser(user));
 }