예제 #1
0
        public static List <M_Users> GetUsers(int pageSize, int pageIndex, ref int totalCount, ref int pageCount, int type = 2, int status = -1, string keyWords = "", string colmonasc = "", bool isasc = false)
        {
            string whereSql = " a.isfreeze<>9";

            if (type > -1)
            {
                whereSql += " and a.admingid=" + type + " ";
            }
            if (status > -1)
            {
                whereSql += " and a.isfreeze=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.UserName like '%" + keyWords + "%' or a.mobile like'%" + keyWords + "%' or a.email like'%" + keyWords + "%') ";
            }
            string         cstr = @" a.*,convert(varchar(25),b.registertime,120) registertime,convert(varchar(25),b.lastvisittime,120) lastvisittime ";
            DataTable      dt   = CommonBusiness.GetPagerData("Owzx_Users a join owzx_userdetails b on a.uid=b.uid  ", cstr, whereSql, "a.Uid", colmonasc, pageSize, pageIndex, out totalCount, out pageCount, isasc);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                list.Add(model);
            }

            return(list);
        }
예제 #2
0
        public static List <M_Users> GetImgList(string userid, int sex, int pageIndex, int pageSize, ref int totalCount, ref int pageCount)
        {
            string whereSql = " a.Status<>9 and b.ImgCount>0";

            if (sex > -1)
            {
                whereSql += " and a.Sex=" + sex;
            }
            if (!string.IsNullOrEmpty(userid))
            {
                whereSql += " and a.UserID='" + userid + "' ";
            }
            string clumstr = "a.userID,a.Avatar,a.Name,a.Age,a.LoginName,a.MyService,a.Province,a.City,a.District,a.CreateTime,a.Status,a.Sex,a.IsMarry,a.Education," +
                             "a.BHeight,a.Levelid,a.BWeight,a.MyContent,a.MyCharacter,a.TalkTo,a.BPay,a.Account,b.ImgCount,b.IsLogin,b.RecommendCount,b.SeeCount";
            DataTable      dt   = CommonBusiness.GetPagerData("M_Users a join userReport b on a.Userid=b.Userid ", clumstr, whereSql, "a.AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <M_Users> list = new List <M_Users>();

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

            return(list);
        }
예제 #3
0
        public static List <M_Users> GetUsers(string keyWords, string roleID, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string whereSql = " Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and ( Name like '%" + keyWords + "%' or MobilePhone like '%" + keyWords + "%' or Email like '%" + keyWords + "%')";
            }


            if (!string.IsNullOrEmpty(roleID))
            {
                whereSql += " and RoleID='" + roleID + "'";
            }

            DataTable      dt   = CommonBusiness.GetPagerData("M_Users", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);

                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }

                list.Add(model);
            }

            return(list);
        }
예제 #4
0
        /// <summary>
        /// 根据账号密码获取信息
        /// </summary>
        /// <param name="loginname">账号</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public static M_Users GetM_UserByUserName(string loginname, string pwd, string operateip)
        {
            pwd = ProBusiness.Encrypt.GetEncryptPwd(pwd, loginname);
            DataTable dt    = new M_UsersDAL().GetM_UserByUserName(loginname, pwd);
            M_Users   model = null;

            if (dt.Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(dt.Rows[0]);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByID(model.RoleID);
                }
                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ClientMenus;
                }
                else if (model.IsAdmin == 1)
                {
                    model.Menus = CommonBusiness.ClientMenus;
                }
                else
                {
                    model.Menus = model.Role.Menus;
                }
            }
            return(model);
        }
예제 #5
0
        public static List <M_Users> GetUsers(int pageSize, int pageIndex, ref int totalCount, ref int pageCount, int type = -1, int status = -1, string keyWords = "", string colmonasc = "", bool isasc = false)
        {
            string whereSql = " a.Status<>9";

            if (type > -1)
            {
                whereSql += " and a.type=" + type + " ";
            }
            if (status > -1)
            {
                whereSql += " and a.Status=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.UserName like '%" + keyWords + "%' or a.LoginName like'%" + keyWords + "%') ";
            }
            string         cstr = @" a.* ";
            DataTable      dt   = CommonBusiness.GetPagerData("M_Users a  ", cstr, whereSql, "a.AutoID", colmonasc, pageSize, pageIndex, out totalCount, out pageCount, isasc);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                list.Add(model);
            }

            return(list);
        }
예제 #6
0
        public static List <M_Users> GetUsers(int sex, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string address = "", string age = "", int sourcetype = 0, int status = -1, string keyWords = "")
        {
            string whereSql = " a.Status<>9";

            if (sex > -1)
            {
                whereSql += " and a.Sex=" + sex;
            }
            if (status > -1)
            {
                whereSql += " and a.Status=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.Name like '%" + keyWords + "%' or a.LoginName like'%" + keyWords + "%') ";
            }
            if (sourcetype > -1)
            {
                whereSql += " and a.sourcetype=" + sourcetype;
            }
            if (!string.IsNullOrEmpty(address))
            {
                string[] strArr = address.Split(',');
                for (int i = 0; i < strArr.Length; i++)
                {
                    whereSql += (i == 0
                        ? " and a. province='"
                        : i == 1 ? " and a.City='" : i == 2 ? " and a.District='" : "") + strArr[i] + "'";
                }
            }

            if (!string.IsNullOrEmpty(age))
            {
                string[] strArr = age.Split('~');
                for (int i = 0; i < strArr.Length; i++)
                {
                    whereSql += (i == 0? " and a.Age>=": " and a.Age<=") + strArr[i];
                }
            }
            string         cstr = @"a.AuthorBTime,a.AuthorETime,a.AuthorType,a.userID,a.Avatar,a.Name,a.LoginName,a.Age,a.MyService,a.Province,a.City,a.District,a.CreateTime,a.Status,a.Sex,a.IsMarry,a.Education,a.ROleID,
a.BHeight,a.Levelid,a.BWeight,a.MyContent,a.MyCharacter,a.BPay,a.Account,a.TalkTo,a.Description";
            DataTable      dt   = CommonBusiness.GetPagerData("M_Users a", cstr, whereSql, "a.AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                list.Add(model);
            }

            return(list);
        }
예제 #7
0
        public static List <M_Users> GetUsers(int pageSize, int pageIndex, ref int totalCount, ref int pageCount, int type = -1, int status = -1, int sourcetype = -1, string keyWords = "", string colmonasc = "", bool isasc = false,
                                              string rebatemin = "", string rebatemax = "", string accountmin = "", string accountmax = "")
        {
            string whereSql = " a.Status<>9 and isadmin=0 ";

            if (!string.IsNullOrEmpty(rebatemax))
            {
                whereSql += " and a.Rebate<='" + rebatemax + "' ";
            }
            if (!string.IsNullOrEmpty(rebatemin))
            {
                whereSql += " and a.Rebate>'" + rebatemin + "' ";
            }
            if (sourcetype > -1)
            {
                whereSql += " and a.sourcetype=" + sourcetype + " ";
            }
            if (type > -1)
            {
                whereSql += " and a.type=" + type + " ";
            }
            if (!string.IsNullOrEmpty(accountmax))
            {
                whereSql += " and b.AccountFee<='" + accountmax + "' ";
            }
            if (!string.IsNullOrEmpty(accountmin))
            {
                whereSql += " and b.AccountFee>'" + accountmin + "' ";
            }
            if (status > -1)
            {
                whereSql += " and a.Status=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.UserName like '%" + keyWords + "%' or a.LoginName like'%" + keyWords + "%') ";
            }
            string         cstr = @" a.*,b.AccountFee ";
            DataTable      dt   = CommonBusiness.GetPagerData("M_Users a left join UserAccount b on a.UserID=b.UserID ", cstr, whereSql, "a.AutoID", colmonasc, pageSize, pageIndex, out totalCount, out pageCount, isasc);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                list.Add(model);
            }

            return(list);
        }
예제 #8
0
파일: M_UsersBusiness.cs 프로젝트: nuet/CP
        public static List <M_Users> GetUsersRelationList(int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, int type = -1, int status = -1, string keyWords = "", string colmonasc = "a.AutoID", bool isasc = false,
                                                          string rebatemin = "", string rebatemax = "", string accountmin = "", string accountmax = "", bool myselft = false)
        {
            string whereSql = " where a.layers>0 and a.Status<>9  ";

            if (!string.IsNullOrEmpty(rebatemax))
            {
                whereSql += " and a.Rebate<='" + rebatemax + "' ";
            }
            if (!string.IsNullOrEmpty(rebatemin))
            {
                whereSql += " and a.Rebate>'" + rebatemin + "' ";
            }
            if (type > -1)
            {
                whereSql += " and a.type=" + type + " ";
            }
            if (!string.IsNullOrEmpty(accountmax))
            {
                whereSql += " and b.AccountFee<='" + accountmax + "' ";
            }
            if (!string.IsNullOrEmpty(accountmin))
            {
                whereSql += " and b.AccountFee>'" + accountmin + "' ";
            }
            if (status > -1)
            {
                whereSql += " and a.Status=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.UserName like '%" + keyWords + "%' or a.LoginName like'%" + keyWords + "%') ";
            }
            string orswhere = "";

            if (!string.IsNullOrEmpty(userid))
            {
                orswhere = " and ( c.ParentID='" + userid + "' " + (myselft ? " or a.userid='" + userid + "'" : "") + " ) ";;
            }

            string         clumstr = " select  a.*,b.AccountFee  from M_Users a join UserAccount b on a.UserID=b.Userid join UserRelation c on a.UserID=c.UserID  " + orswhere + " " + whereSql;
            DataTable      dt      = M_UsersDAL.GetDataTable(clumstr);
            List <M_Users> list    = new List <M_Users>();
            M_Users        model;

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

            return(list);
        }
예제 #9
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname">账号</param>
        /// <returns></returns>
        public static M_Users GetM_UserByUserName(string loginname)
        {
            DataTable dt    = new M_UsersDAL().GetM_UserByLoginName(loginname);
            M_Users   model = null;

            if (dt.Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(dt.Rows[0]);
            }
            return(model);
        }
예제 #10
0
        public static M_Users GetUserDetail(string userID)
        {
            DataTable dt = M_UsersDAL.BaseProvider.GetUserDetail(userID);

            M_Users model = null;

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

            return(model);
        }
예제 #11
0
        public static M_Users GetUserDetailByLoginName(string loginName)
        {
            DataTable dt = M_UsersDAL.GetDataTable("select *  from M_Users where Status<>9 and LoginName='" + loginName + "'");

            M_Users model = null;

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

            return(model);
        }
예제 #12
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname">账号</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public static M_Users GetM_UserByUserName(string loginname, string pwd, string operateip)
        {
            pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd, loginname);
            DataTable dt = new M_UsersDAL().GetM_UserByUserName(loginname, pwd);
            M_Users model = null;
            if (dt.Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(dt.Rows[0]);
            }

            //记录登录日志
            LogBusiness.AddLoginLog(loginname, model != null, CloudSalesEnum.EnumSystemType.Manage, operateip, "", "", "");

            return model;
        }
예제 #13
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname">账号</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public static M_Users GetM_UserByUserName(string loginname, string pwd, string operateip)
        {
            pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd);
            DataTable dt    = new M_UsersDAL().GetM_UserByUserName(loginname, pwd);
            M_Users   model = null;

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

            //记录登录日志
            LogBusiness.AddLoginLog(loginname, model != null, CloudSalesEnum.EnumSystemType.Manage, operateip);

            return(model);
        }
예제 #14
0
        public static List <M_Users> GetUsersRelationList(string userid, bool myselft = false)
        {
            string         whereSql = myselft ? " or a.userid='" + userid + "'" : "";
            string         clumstr  = " select  a.*  from M_Users a join UserRelation c on a.UserID=c.UserID and ( c.ParentID='" + userid + "' " + whereSql + "  ) where a.layers>0 and a.Status<>9";
            DataTable      dt       = M_UsersDAL.GetDataTable(clumstr);
            List <M_Users> list     = new List <M_Users>();
            M_Users        model;

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

            return(list);
        }
예제 #15
0
        public static List <M_Users> GetUsersReCommen(int sex, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string address = "", string age = "", string cdesc = "")
        {
            string whereSql = " a.Status<>9";

            if (sex > -1)
            {
                whereSql += " and a.Sex=" + sex;
            }

            if (!string.IsNullOrEmpty(address))
            {
                string[] strArr = address.Split(',');
                for (int i = 0; i < strArr.Length; i++)
                {
                    whereSql += (i == 0
                        ? " and a.province='"
                        : i == 1 ? " and a.City='" : i == 2 ? " and a.District='" : "") + strArr[i] + "'";
                }
            }

            if (!string.IsNullOrEmpty(age))
            {
                string[] strArr = age.Split('~');
                for (int i = 0; i < strArr.Length; i++)
                {
                    whereSql += (i == 0 ? " and a.Age>=" : " and a.Age<=") + strArr[i];
                }
            }
            string clumstr = "a.AuthorBTime,a.AuthorETime,a.AuthorType,a.userID,a.Avatar,a.Name,a.Age,a.LoginName,a.MyService,a.Province,a.City,a.District,a.CreateTime,a.Status,a.Sex,a.IsMarry,a.Education," +
                             "a.BHeight,a.Levelid,a.BWeight,a.MyContent,a.MyCharacter,a.TalkTo,a.BPay,a.Account,b.ImgCount,b.IsLogin,b.RecommendCount,b.SeeCount";
            DataTable      dt   = CommonBusiness.GetPagerData("M_Users a left join userReport b on a.Userid=b.Userid ", clumstr, whereSql, "a.AutoID" + (string.IsNullOrEmpty(cdesc) ? "" : "," + cdesc), pageSize, pageIndex, out totalCount, out pageCount);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

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

            return(list);
        }
예제 #16
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname"></param>
        /// <param name="pwd"></param>
        /// <param name="operateip"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static M_Users GetM_UserByProUserName(string loginname, string pwd, string operateip, out int result, EnumUserOperateType type = EnumUserOperateType.Login, int sourceType = 0)
        {
            pwd = ProBusiness.Encrypt.GetEncryptPwd(pwd, loginname);
            DataSet ds    = new M_UsersDAL().GetM_UserByProUserName(loginname, pwd, sourceType, out result);
            M_Users model = null;

            if (ds.Tables.Contains("M_User") && ds.Tables["M_User"].Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(ds.Tables["M_User"].Rows[0]);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else if (model.IsAdmin == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else
                {
                    model.Menus = new List <Menu>();
                    foreach (DataRow dr in ds.Tables["Permission"].Rows)
                    {
                        Menu menu = new Menu();
                        menu.FillData(dr);
                        model.Menus.Add(menu);
                    }
                }
            }
            if (model != null && model.Status == 1)
            {
                LogBusiness.AddLoginLog(loginname, operateip, model != null ? model.UserID : "", type);
                LogBusiness.UpdateLastIP(model != null ? model.UserID : "", operateip);
            }
            return(model);
        }
예제 #17
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname"></param>
        /// <param name="pwd"></param>
        /// <param name="operateip"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static M_Users GetM_UserByProUserName(string loginname, string pwd, string operateip, out int result)
        {
            pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd, loginname);
            DataSet ds    = new M_UsersDAL().GetM_UserByProUserName(loginname, pwd, out result);
            M_Users model = null;

            if (ds.Tables.Contains("M_User") && ds.Tables["M_User"].Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(ds.Tables["M_User"].Rows[0]);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else if (model.IsAdmin == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else
                {
                    model.Menus = new List <Menu>();
                    foreach (DataRow dr in ds.Tables["Permission"].Rows)
                    {
                        Menu menu = new Menu();
                        menu.FillData(dr);
                        model.Menus.Add(menu);
                    }
                }
            }
            //记录登录日志
            LogBusiness.AddLoginLog(loginname, model != null, IntFactoryEnum.EnumSystemType.Manage, operateip, "", "");

            return(model);
        }
예제 #18
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname"></param>
        /// <param name="pwd"></param>
        /// <param name="operateip"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static M_Users GetM_UserByProUserName(string loginname, string pwd, string operateip, out int result)
        {
            pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd, loginname);
            DataSet ds = new M_UsersDAL().GetM_UserByProUserName(loginname, pwd, out result);
            M_Users model = null;
            if (ds.Tables.Contains("M_User") && ds.Tables["M_User"].Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(ds.Tables["M_User"].Rows[0]);
                if (!string.IsNullOrEmpty(model.RoleID))
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else if (model.IsAdmin == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else
                {
                    model.Menus = new List<Menu>();
                    foreach (DataRow dr in ds.Tables["Permission"].Rows)
                    {
                        Menu menu = new Menu();
                        menu.FillData(dr);
                        model.Menus.Add(menu);
                    }
                }
            }
            //记录登录日志
            LogBusiness.AddLoginLog(loginname, model != null, CloudSalesEnum.EnumSystemType.Manage, operateip, "", "", "");

            return model;
        }
예제 #19
0
        public static List <M_Users> GetUsersRelationList(int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, int type = -1, int status = -1, string keyWords = "", string colmonasc = " a.AutoID ", bool isasc = false,
                                                          string accountmin = "", string accountmax = "", bool myselft = false, int sourcetype = -1, int isline = -1)
        {
            string whereSql = " a.layers>0 and a.Status<>9   ";

            if (type > -1)
            {
                whereSql += " and a.type=" + type + " ";
            }
            if (isline > -1)
            {
                whereSql += " and a.isline=" + isline + " ";
            }
            if (!string.IsNullOrEmpty(accountmax))
            {
                whereSql += " and b.AccountFee<='" + accountmax + "' ";
            }
            if (!string.IsNullOrEmpty(accountmin))
            {
                whereSql += " and b.AccountFee>'" + accountmin + "' ";
            }
            if (sourcetype > -1)
            {
                whereSql += " and a.sourcetype=" + sourcetype + " ";
            }
            if (status > -1)
            {
                whereSql += " and a.Status=" + status;
            }
            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and (a.UserName like '%" + keyWords + "%' or a.LoginName like'%" + keyWords + "%') ";
            }
            string orswhere = "";

            if (!string.IsNullOrEmpty(userid))
            {
                orswhere = " and ( c.ParentID='" + userid + "' " + (myselft ? " or a.userid='" + userid + "'" : "") + " ) ";;
            }
            if (string.IsNullOrEmpty(colmonasc))
            {
                colmonasc = " a.AutoID ";
            }
            //string clumstr = @" select  a.*,b.AccountFee,f.*  from M_Users a join UserAccount b on a.UserID=b.Userid left join UserRelation c on a.UserID=c.UserID  " + orswhere + " left join (select  d.userid as uid,d.BackID,d.SSCNum,d.SSCUseNum,d.FCNum,d.FCUseNum,d.X5Num,d.X5UseNum,e.SSCType,e.FCType,e.X5Type,e.WinFee  " +
            //                 "from UserBackSet d join  BackModel e on d.Backid=e.AutoID  where d.type=0) f on f.uid=a.userid  " + whereSql;

            DataTable dt = CommonBusiness.GetPagerData("  M_Users a join UserAccount b on a.UserID=b.Userid left join UserRelation c on a.UserID=c.UserID   left join (select  d.userid as uid,d.BackID,d.SSCNum,d.SSCUseNum,d.FCNum,d.FCUseNum,d.X5Num,d.X5UseNum,e.SSCType,e.FCType,e.X5Type,e.WinFee  " +
                                                       "from UserBackSet d join  BackModel e on d.Backid=e.AutoID  where d.type=0) f on f.uid=a.userid  ", " a.*,b.AccountFee,f.*  ", whereSql + orswhere, colmonasc, pageSize, pageIndex, out totalCount, out pageCount, isasc);
            //DataTable dt = M_UsersDAL.GetDataTable(clumstr);
            List <M_Users> list = new List <M_Users>();
            M_Users        model;

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

            return(list);
        }
예제 #20
0
        public static M_Users GetUserDetail(string userID)
        {
            DataTable dt = M_UsersDAL.BaseProvider.GetUserDetail(userID);

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

            return model;
        }
예제 #21
0
        public static List<M_Users> GetUsers(string keyWords, string roleID, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string whereSql = " Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
                whereSql += " and ( Name like '%" + keyWords + "%' or MobilePhone like '%" + keyWords + "%' or Email like '%" + keyWords + "%')";


            if (!string.IsNullOrEmpty(roleID))
                whereSql += " and RoleID='" + roleID + "'";

            DataTable dt = CommonBusiness.GetPagerData("M_Users", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List<M_Users> list = new List<M_Users>();
            M_Users model;
            foreach (DataRow item in dt.Rows)
            {
                model = new M_Users();
                model.FillData(item);

                if (!string.IsNullOrEmpty(model.RoleID))
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);

                list.Add(model);
            }

            return list;
        }