Ejemplo n.º 1
0
 /// <summary>
 /// 注册会员
 /// </summary>
 /// <param name="mobile">手机</param>
 /// <param name="email">邮箱</param>
 /// <param name="loginpwd">登录密码</param>
 /// <param name="usertype">类型</param>
 /// <param name="operateIP">操作IP</param>
 /// <param name="operateID">操作ID</param>
 /// <param name="result">返回状态 1成功 0不成功</param>
 /// <param name="resultdes">返回字符串</param>
 /// <returns></returns>
 public static string AddUsers(string mobile, string email, string loginpwd, UserType usertype, string operateIP, string operateID, out int result, out string resultdes)
 {
     loginpwd = DESEncrypt.GetEncryptionPwd(loginpwd);
     object obj = new UserDAL().AddUsers(mobile, email, loginpwd, (int)usertype, operateIP, operateID, out result, out resultdes);
     if (obj != null && obj != DBNull.Value)
     {
         return obj.ToString();
     }
     return string.Empty;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">姓名</param>
        /// <param name="mobile">手机</param>
        /// <param name="email">邮箱</param>
        /// <param name="loginpwd">密码</param>
        /// <param name="photoPath">照片</param>
        /// <param name="usertype">类型</param>
        /// <param name="keyWords">职称</param>
        /// <param name="desc">描述</param>
        /// <param name="operateIP">操作IP</param>
        /// <param name="operateID">操作ID</param>
        /// <param name="result">返回状态 1成功 0不成功</param>
        /// <param name="resultdes">返回字符串</param>
        /// <returns></returns>
        public static string AddUsers(string name, string mobile, string email, string loginpwd, string photoPath, UserType usertype, string keyWords, string desc, string operateIP, string operateID,out int result,out string resultdes)
        {
            loginpwd = DESEncrypt.GetEncryptionPwd(loginpwd);

            if (!string.IsNullOrEmpty(photoPath) && photoPath != "/modules/images/default.png")
            {
                if (photoPath.IndexOf("?") > 0)
                {
                    photoPath = photoPath.Substring(0, photoPath.IndexOf("?"));
                }
                FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(photoPath));
                photoPath = "/Content/upload_images/" + file.Name;
                file.MoveTo(HttpContext.Current.Server.MapPath(photoPath));
            }

            object obj = new UserDAL().AddUsers(name, mobile, email, loginpwd, photoPath, (int)usertype, keyWords, desc, operateIP, operateID,out result,out resultdes);
            if (obj != null && obj != DBNull.Value)
            {
                return obj.ToString();
            }
            return string.Empty;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 登录并获取会员信息
        /// </summary>
        /// <param name="userName">用户名、Email、手机</param>
        /// <param name="loginpwd">密码</param>
        /// <returns></returns>
        public static UserEntity UserLogin(string userName, string loginpwd)
        {
            loginpwd = DESEncrypt.GetEncryptionPwd(loginpwd);
            DataTable dt = new UserDAL().UserLogin(userName, loginpwd);

            UserEntity model = null;
            if (dt.Rows.Count > 0)
            {
                model = new UserEntity();
                model.FillData(dt.Rows[0]);
            }

            return model;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取等级列表
        /// </summary>
        /// <param name="type">类型</param>
        /// <returns></returns>
        public static List<Entity.UserLevelEntity> GetUserLevelByType(UserType type)
        {
            List<Entity.UserLevelEntity> list = new List<Entity.UserLevelEntity>();
            DataTable dt = new UserDAL().GetUserLevelByType((int)type);

            foreach (DataRow dr in dt.Rows)
            {
                UserLevelEntity model = new UserLevelEntity();
                model.FillData(dr);
                list.Add(model);
            }

            return list;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取等级实体
        /// </summary>
        /// <param name="id">ID</param>
        /// <returns></returns>
        public static Entity.UserLevelEntity GetUserLevelByID(int id)
        {
            DataTable dt = new UserDAL().GetUserLevelByID(id);

            UserLevelEntity model = new UserLevelEntity();
            model.FillData(dt.Rows[0]);
            return model;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取会员信息
        /// </summary>
        /// <param name="userid">会员ID</param>
        /// <returns></returns>
        public static UserEntity GetUserByUserID(string userid)
        {
            DataTable dt = new UserDAL().GetUserByUserID(userid);

            UserEntity model = new UserEntity();
            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
            }

            return model;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取教师列表
        /// </summary>
        /// <returns></returns>
        public static List<Entity.UserEntity> GetTeachers()
        {
            List<Entity.UserEntity> list = new List<Entity.UserEntity>();

            DataTable dt = new UserDAL().GetTeachers();

            foreach (DataRow dr in dt.Rows)
            {
                UserEntity model = new UserEntity();
                model.FillData(dr);
                list.Add(model);
            }

            return list;
        }