Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("ReadUser", PowerCheckType.Single);
         //this.Sex.DataSource = EnumHelper.ReadEnumList<SexType>();
         //this.Sex.DataValueField = "Value";
         //this.Sex.DataTextField = "ChineseName";
         //this.Sex.DataBind();
         //this.Sex.Items.Insert(0, new ListItem("所有", string.Empty));
         this.status = RequestHelper.GetQueryString <int>("Status");
         UserSearchInfo userSearch = SearchCondition();
         if (companyID >= 0)
         {
             CompanyName.Value = CompanyBLL.ReadCompany(companyID).CompanyName;
         }
         this.UserName.Text = userSearch.UserName;
         this.RealName.Text = userSearch.RealName;
         this.Mobile.Text   = userSearch.Mobile;
         this.Email.Text    = userSearch.Email;
         //this.Sex.SelectedValue = userSearch.Sex.ToString();
         this.StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate");
         this.EndRegisterDate.Text   = RequestHelper.GetQueryString <string>("EndRegisterDate");
         base.BindControl(UserBLL.SearchUserList(base.CurrentPage, base.PageSize, userSearch, ref this.Count), this.RecordList, this.MyPager);
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("StatisticsUser", PowerCheckType.Single);
                Sex.DataSource     = EnumHelper.ReadEnumList <SexType>();
                Sex.DataValueField = "Value";
                Sex.DataTextField  = "ChineseName";
                Sex.DataBind();
                Sex.Items.Insert(0, new ListItem("所有", string.Empty));

                UserSearchInfo userSearch = new UserSearchInfo();
                userSearch.UserName = RequestHelper.GetQueryString <string>("UserName");
                userSearch.Sex      = RequestHelper.GetQueryString <int>("Sex");
                DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate");
                DateTime endDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndDate"));
                UserName.Text  = userSearch.UserName;
                StartDate.Text = RequestHelper.GetQueryString <string>("StartDate");
                EndDate.Text   = RequestHelper.GetQueryString <string>("EndDate");
                Sex.Text       = RequestHelper.GetQueryString <int>("Sex").ToString();
                string userConsumeType = RequestHelper.GetQueryString <string>("UserConsumeType");
                userConsumeType      = (userConsumeType == string.Empty) ? "OrderCount" : userConsumeType;
                UserConsumeType.Text = userConsumeType;
                BindControl(UserBLL.StatisticsUserConsume(CurrentPage, PageSize, userSearch, ref Count, userConsumeType, startDate, endDate), RecordList, MyPager);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 搜索用户
        /// </summary>
        private void SearchUser()
        {
            UserSearchInfo userSearch = new UserSearchInfo();

            userSearch.UserName = RequestHelper.GetQueryString <string>("UserName");
            userList            = UserBLL.SearchList(userSearch);
        }
Beispiel #4
0
        public string CheckMobile()
        {
            string         Result     = string.Empty;
            string         Mobile     = RequestHelper.GetQueryString <string>("mobile");
            UserSearchInfo userSearch = new UserSearchInfo();

            userSearch.Mobile  = Mobile;
            userSearch.GroupId = 36;
            try
            {
                Result = "{\"code\":0,";
                if (UserBLL.SearchUserList(userSearch).Count > 0)
                {
                    Result += "\"data\":false}";
                }
                else
                {
                    Result += "\"data\":true}";
                }
            }
            catch
            {
                Result = "{\"code\":1,\"message\":\"异常错误!\"}";
            }
            return(Result);
        }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         base.CheckAdminPower("StatisticsUser", PowerCheckType.Single);
         this.Sex.DataSource     = EnumHelper.ReadEnumList <SexType>();
         this.Sex.DataValueField = "Value";
         this.Sex.DataTextField  = "ChineseName";
         this.Sex.DataBind();
         this.Sex.Items.Insert(0, new ListItem("Ыљга", string.Empty));
         UserSearchInfo userSearch = new UserSearchInfo();
         userSearch.UserName          = RequestHelper.GetQueryString <string>("UserName");
         userSearch.Sex               = RequestHelper.GetQueryString <int>("Sex");
         userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate");
         userSearch.EndRegisterDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate"));
         this.UserName.Text           = userSearch.UserName;
         this.StartRegisterDate.Text  = RequestHelper.GetQueryString <string>("StartRegisterDate");
         this.EndRegisterDate.Text    = RequestHelper.GetQueryString <string>("EndRegisterDate");
         this.Sex.Text = RequestHelper.GetQueryString <int>("Sex").ToString();
         string queryString = RequestHelper.GetQueryString <string>("UserOrderType");
         queryString             = (queryString == string.Empty) ? "LoginTimes" : queryString;
         this.UserOrderType.Text = queryString;
         base.BindControl(UserBLL.StatisticsUserActive(base.CurrentPage, base.PageSize, userSearch, ref this.Count, queryString), this.RecordList, this.MyPager);
     }
 }
Beispiel #6
0
        protected void UserOutXls_Click(object sender, EventArgs e)
        {
            UserSearchInfo userSearch = SearchCondition();

            userSearch.Condition = "Order by [CompanyId]";
            List <UserInfo> userList = UserBLL.SearchUserList(userSearch);

            ExcelOut(userList);
        }
Beispiel #7
0
        public DataTable StatisticsUserStatus(UserSearchInfo userSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, userSearch);
            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            return(ShopMssqlHelper.ExecuteDataTable(ShopMssqlHelper.TablePrefix + "StatisticsUserStatus", pt));
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int    id     = RequestHelper.GetQueryString <int>("ID");
                string Action = RequestHelper.GetQueryString <string>("Action");
                if (Action == "Search")
                {
                    string   searchName        = RequestHelper.GetQueryString <string>("username");
                    string   searchCompanyName = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("companyname").Trim());
                    string   searchPostName    = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("postname").Trim());
                    DateTime startDate         = RequestHelper.GetQueryString <DateTime>("StartDate");
                    DateTime endDate           = RequestHelper.GetQueryString <DateTime>("EndDate");
                    int      pageCount         = RequestHelper.GetQueryString <int>("PageCount");
                    if (pageCount > 0)
                    {
                        base.PageSize       = pageCount;
                        this.PageCount.Text = pageCount.ToString();
                    }
                    CompanyName.Text = searchCompanyName;
                    SearchName.Text  = searchName;
                    PostName.Text    = searchPostName;
                    if (startDate != DateTime.MinValue)
                    {
                        SearchStartDate.Text = startDate.ToString("d");
                    }
                    if (endDate != DateTime.MinValue)
                    {
                        SearchEndDate.Text = endDate.ToString("d");
                    }

                    base.CheckAdminPower("ReadTestPaper", PowerCheckType.Single);
                    PostPassInfo postpassSearch = new PostPassInfo();
                    postpassSearch.SearchStartDate = startDate;
                    postpassSearch.CreateDate      = ShopCommon.SearchEndDate(endDate);
                    postpassSearch.PostName        = searchPostName;
                    if (!string.IsNullOrEmpty(searchCompanyName))
                    {
                        postpassSearch.InCompanyID = CompanyBLL.ReadCompanyIdStr(searchCompanyName, 1);
                    }

                    if (!string.IsNullOrEmpty(searchName))
                    {
                        UserSearchInfo user = new UserSearchInfo();
                        user.RealName           = searchName;
                        postpassSearch.InUserID = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(user));
                        if (string.IsNullOrEmpty(postpassSearch.InUserID))
                        {
                            postpassSearch.InUserID = "0";
                        }
                    }

                    base.BindControl(PostPassBLL.ReadPostPassList(postpassSearch, base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager);
                }
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadUser", PowerCheckType.Single);
                string action = RequestHelper.GetQueryString <string>("Action");
                int    id     = RequestHelper.GetQueryString <int>("Id");
                if (id > 0)
                {
                    switch (action)
                    {
                    case "Delete":
                        CheckAdminPower("DeleteUser", PowerCheckType.Single);
                        UserBLL.Delete(id);
                        AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("User"), id);
                        break;

                    default:
                        break;
                    }
                }

                //会员类型
                usertype.DataSource     = EnumHelper.ReadEnumList <UserType>();
                usertype.DataTextField  = "ChineseName";
                usertype.DataValueField = "Value";
                usertype.DataBind();
                ListItem lt = new ListItem("--所有会员--", "");
                usertype.Items.Insert(0, lt);

                UserSearchInfo userSearch = new UserSearchInfo();
                userSearch.UserName          = HttpUtility.UrlEncode(RequestHelper.GetQueryString <string>("UserName"), System.Text.Encoding.UTF8);
                userSearch.Mobile            = RequestHelper.GetQueryString <string>("Mobile");
                userSearch.Status            = RequestHelper.GetQueryString <int>("Status");
                userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate");
                userSearch.EndRegisterDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate"));
                userSearch.UserType          = RequestHelper.GetQueryString <int>("Type");

                usertype.SelectedValue = userSearch.UserType.ToString();
                UserName.Text          = HttpUtility.UrlDecode(userSearch.UserName, System.Text.Encoding.UTF8);
                Mobile.Text            = userSearch.Mobile;
                StartRegisterDate.Text = RequestHelper.GetQueryString <string>("StartRegisterDate");
                EndRegisterDate.Text   = RequestHelper.GetQueryString <string>("EndRegisterDate");

                status   = userSearch.Status;
                PageSize = Session["AdminPageSize"] == null ? 20 : Convert.ToInt32(Session["AdminPageSize"]);
                var userList = UserBLL.SearchListAndUserGrade(CurrentPage, PageSize, userSearch, ref Count);
                //Count = userList.Count;

                AdminPageSize.Text = Session["AdminPageSize"] == null ? "20" : Session["AdminPageSize"].ToString();
                userList.ForEach(k => k.UserName = System.Web.HttpUtility.UrlDecode(k.UserName, System.Text.Encoding.UTF8));
                //userList = userList.Skip((CurrentPage - 1) * PageSize).Take(PageSize).ToList();

                BindControl(userList, RecordList, MyPager);
            }
        }
Beispiel #10
0
        public DataTable StatisticsUserCount(UserSearchInfo userSearch, DateType dateType)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, userSearch);
            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar), new SqlParameter("@dateType", SqlDbType.Int) };
            pt[0].Value = mssqlCondition.ToString();
            pt[1].Value = (int)dateType;
            return(ShopMssqlHelper.ExecuteDataTable(ShopMssqlHelper.TablePrefix + "StatisticsUserCount", pt));
        }
Beispiel #11
0
 public void PrepareCondition(MssqlCondition mssqlCondition, UserSearchInfo userSearch)
 {
     mssqlCondition.Add("[UserName]", userSearch.UserName, ConditionType.Like);
     mssqlCondition.Add("[Email]", userSearch.Email, ConditionType.Like);
     mssqlCondition.Add("[Sex]", userSearch.Sex, ConditionType.Equal);
     mssqlCondition.Add("[RegisterDate]", userSearch.StartRegisterDate, ConditionType.MoreOrEqual);
     mssqlCondition.Add("[RegisterDate]", userSearch.EndRegisterDate, ConditionType.Less);
     mssqlCondition.Add("[Status]", userSearch.Status, ConditionType.Equal);
     mssqlCondition.Add("[ID]", userSearch.InUserID, ConditionType.In);
 }
Beispiel #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.ClearCache();
            UserSearchInfo user = new UserSearchInfo();

            user.UserName            = RequestHelper.GetQueryString <string>("UserName");
            this.userList            = UserBLL.SearchUserList(base.CurrentPage, base.PageSize, user, ref this.Count);
            this.MyPager.CurrentPage = base.CurrentPage;
            this.MyPager.PageSize    = base.PageSize;
            this.MyPager.Count       = base.Count;
        }
Beispiel #13
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            string action = RequestHelper.GetQueryString <string>("Action");

            switch (action)
            {
            case "Add":
                PostProductReply();
                break;

            default:
                break;
            }
            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize  = 8;
            int count     = 0;
            int commentID = RequestHelper.GetQueryString <int>("CommentID");

            productReplyList = ProductReplyBLL.ReadProductReplyList(commentID, currentPage, pageSize, ref count, int.MinValue);

            ajaxPagerClass.CurrentPage = currentPage;
            ajaxPagerClass.PageSize    = pageSize;
            ajaxPagerClass.Count       = count;
            ajaxPagerClass.DisCount    = false;
            ajaxPagerClass.ListType    = false;

            string strUserID = string.Empty;

            foreach (ProductReplyInfo productReply in productReplyList)
            {
                if (strUserID == string.Empty)
                {
                    strUserID = productReply.UserID.ToString();
                }
                else
                {
                    strUserID += "," + productReply.UserID.ToString();
                }
            }
            if (strUserID != string.Empty)
            {
                UserSearchInfo userSearch = new UserSearchInfo();
                userSearch.InUserID = strUserID;
                userList            = UserBLL.SearchUserList(userSearch);
            }
        }
Beispiel #14
0
        /// <summary>
        /// 统计用户状态
        /// </summary>
        public DataTable StatisticsUserStatus(UserSearchInfo userSearch)
        {
            string condition = PrepareCondition(userSearch).ToString();

            SqlParameter[] parameters =
            {
                new SqlParameter("@type",      SqlDbType.VarChar),
                new SqlParameter("@condition", SqlDbType.NVarChar)
            };
            parameters[0].Value = "StatisticsUserStatus";
            parameters[1].Value = condition;
            return(ShopMssqlHelper.ExecuteDataTable("usp_Usr", parameters));
        }
Beispiel #15
0
        /// <summary>
        /// 用户数是否超限
        /// </summary>
        /// <param name="companyID"></param>
        /// <returns></returns>
        public static bool IsUserNumOverflow(int companyID)
        {
            bool           isOverflow = false;
            UserSearchInfo userSearch = new UserSearchInfo();

            userSearch.InCompanyID   = companyID.ToString();
            userSearch.StatusNoEqual = (int)UserState.Del;
            if (SearchUserList(userSearch).Count >= CompanyBLL.ReadCompany(companyID).UserNum)
            {
                isOverflow = true;
            }
            return(isOverflow);
        }
Beispiel #16
0
        public List <UserInfo> SearchUserList(UserSearchInfo userSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, userSearch);
            List <UserInfo> userList = new List <UserInfo>();

            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchUserList", pt))
            {
                this.PrepareUserModel(reader, userList);
            }
            return(userList);
        }
Beispiel #17
0
        /// <summary>
        /// 获取userlist 包括usergrade
        /// </summary>
        /// <param name="searchInfo"></param>
        /// <returns></returns>
        public List <UserInfo> SearchListAndUserGrade(UserSearchInfo searchInfo)
        {
            using (var conn = new SqlConnection(connectString))
            {
                string sql = "select * from View_UserGrade";

                string condition = PrepareCondition(searchInfo).ToString();
                if (!string.IsNullOrEmpty(condition))
                {
                    sql += " where " + condition;
                }

                sql += " Order by Id desc";
                return(conn.Query <UserInfo>(sql).ToList());
            }
        }
Beispiel #18
0
        protected override void PageLoad()
        {
            base.PageLoad();
            string queryString = RequestHelper.GetQueryString <string>("Action");

            if ((queryString != null) && (queryString == "Delete"))
            {
                UserFriendBLL.DeleteUserFriend(RequestHelper.GetQueryString <string>("ID"), base.UserID);
                ResponseHelper.Write("ok");
                ResponseHelper.End();
            }
            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize = 0x19;
            int count    = 0;
            UserFriendSearchInfo userFriend = new UserFriendSearchInfo();

            userFriend.UserID   = base.UserID;
            this.userFriendList = UserFriendBLL.SearchUserFriendList(currentPage, pageSize, userFriend, ref count);
            this.commonPagerClass.CurrentPage = currentPage;
            this.commonPagerClass.PageSize    = pageSize;
            this.commonPagerClass.Count       = count;
            string str3 = string.Empty;

            foreach (UserFriendInfo info2 in this.userFriendList)
            {
                if (str3 == string.Empty)
                {
                    str3 = info2.FriendID.ToString();
                }
                else
                {
                    str3 = str3 + "," + info2.FriendID.ToString();
                }
            }
            if (str3 != string.Empty)
            {
                UserSearchInfo user = new UserSearchInfo();
                user.InUserID = str3;
                this.userList = UserBLL.SearchUserList(user);
            }
        }
Beispiel #19
0
        public DataTable StatisticsUserActive(int currentPage, int pageSize, UserSearchInfo userSearch, ref int count, string orderField)
        {
            List <UserInfo>     list   = new List <UserInfo>();
            ShopMssqlPagerClass class2 = new ShopMssqlPagerClass();
            {
                class2.TableName   = ShopMssqlHelper.TablePrefix + "View_UserActive";
                class2.Fields      = "[ID],[UserName],[Sex],[RegisterDate],[LoginTimes],[CommentCount],[ReplyCount],[MessageCount]";
                class2.CurrentPage = currentPage;
                class2.PageSize    = pageSize;
            }
            string str = orderField;

            if (str != null)
            {
                if (!(str == "LoginTimes"))
                {
                    if (str == "CommentCount")
                    {
                        class2.OrderField = "[CommentCount],[ID]";
                        goto Label_00C1;
                    }
                    if (str == "ReplyCount")
                    {
                        class2.OrderField = "[ReplyCount],[ID]";
                        goto Label_00C1;
                    }
                    if (str == "MessageCount")
                    {
                        class2.OrderField = "[MessageCount],[ID]";
                        goto Label_00C1;
                    }
                }
                else
                {
                    class2.OrderField = "[LoginTimes],[ID]";
                    goto Label_00C1;
                }
            }
            class2.OrderField = "[LoginTimes],[ID]";
Label_00C1:
            class2.OrderType = OrderType.Desc;
            this.PrepareCondition(class2.MssqlCondition, userSearch);
            class2.Count = count;
            count        = class2.Count;
            return(class2.ExecuteDataTable());
        }
Beispiel #20
0
        protected override void PageLoad()
        {
            base.PageLoad();
            string queryString = RequestHelper.GetQueryString <string>("Action");

            if ((queryString != null) && (queryString == "Add"))
            {
                this.PostProductReply();
            }
            int currentPage = RequestHelper.GetQueryString <int>("Page");

            if (currentPage < 1)
            {
                currentPage = 1;
            }
            int pageSize  = 8;
            int count     = 0;
            int commentID = RequestHelper.GetQueryString <int>("CommentID");

            this.productReplyList           = ProductReplyBLL.ReadProductReplyList(commentID, currentPage, pageSize, ref count, -2147483648);
            this.ajaxPagerClass.CurrentPage = currentPage;
            this.ajaxPagerClass.PageSize    = pageSize;
            this.ajaxPagerClass.Count       = count;
            this.ajaxPagerClass.DisCount    = false;
            this.ajaxPagerClass.ListType    = false;
            string str2 = string.Empty;

            foreach (ProductReplyInfo info in this.productReplyList)
            {
                if (str2 == string.Empty)
                {
                    str2 = info.UserID.ToString();
                }
                else
                {
                    str2 = str2 + "," + info.UserID.ToString();
                }
            }
            if (str2 != string.Empty)
            {
                UserSearchInfo user = new UserSearchInfo();
                user.InUserID = str2;
                this.userList = UserBLL.SearchUserList(user);
            }
        }
Beispiel #21
0
        private UserSearchInfo SearchCondition()
        {
            UserSearchInfo userSearch = new UserSearchInfo();

            if (companyID >= 0)
            {
                userSearch.InCompanyID = companyID.ToString();
            }
            userSearch.RealName          = RequestHelper.GetQueryString <string>("RealName");
            userSearch.UserName          = RequestHelper.GetQueryString <string>("UserName");
            userSearch.Email             = RequestHelper.GetQueryString <string>("Email");
            userSearch.Mobile            = RequestHelper.GetQueryString <string>("Mobile");
            userSearch.Sex               = RequestHelper.GetQueryString <int>("Sex");
            userSearch.StartRegisterDate = RequestHelper.GetQueryString <DateTime>("StartRegisterDate");
            userSearch.EndRegisterDate   = ShopCommon.SearchEndDate(RequestHelper.GetQueryString <DateTime>("EndRegisterDate"));
            userSearch.Status            = RequestHelper.GetQueryString <int>("Status");
            return(userSearch);
        }
Beispiel #22
0
        private MssqlCondition PrepareCondition(UserSearchInfo userSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            mssqlCondition.Add("[UserName]", userSearch.UserName, ConditionType.Like);
            mssqlCondition.Add("[Mobile]", userSearch.Mobile, ConditionType.Like);
            mssqlCondition.Add("[Email]", userSearch.Email, ConditionType.Like);
            mssqlCondition.Add("[Sex]", userSearch.Sex, ConditionType.Equal);
            mssqlCondition.Add("[RegisterDate]", userSearch.StartRegisterDate, ConditionType.MoreOrEqual);
            mssqlCondition.Add("[RegisterDate]", userSearch.EndRegisterDate, ConditionType.Less);
            mssqlCondition.Add("[Status]", userSearch.Status, ConditionType.Equal);
            mssqlCondition.Add("[Id]", userSearch.InUserId, ConditionType.In);
            mssqlCondition.Add("[UserType]", userSearch.UserType, ConditionType.Equal);
            mssqlCondition.Add("[CardNo]", userSearch.CardNo, ConditionType.Like);
            mssqlCondition.Add("[ProviderNo]", userSearch.ProviderNo, ConditionType.Like);
            mssqlCondition.Add("[Distributor_Status]", userSearch.Distributor_Status, ConditionType.Equal);
            return(mssqlCondition);
        }
Beispiel #23
0
        private void SendCode()
        {
            string Mobile = RequestHelper.GetQueryString <string>("Mobile");

            if (!string.IsNullOrEmpty(Mobile))
            {
                UserSearchInfo userSearch = new UserSearchInfo();
                userSearch.Mobile = Mobile;
                List <UserInfo> userList = UserBLL.SearchUserList(userSearch);
                if (userList.Count > 0)
                {
                    YXTSMS.YXTSMS api       = new YXTSMS.YXTSMS();
                    string        CheckCode = api.MakeCode();

                    SMSInfo SMSModel = new SMSInfo();
                    SMSModel.Mobile  = Mobile;
                    SMSModel.Content = new string[] { "找回密码", CheckCode, "2" };
                    if (api.SendSMS(SMSModel))
                    {
                        SMSRecordInfo SMSRecordModel = new SMSRecordInfo();
                        SMSRecordModel.Mobile         = SMSModel.Mobile;
                        SMSRecordModel.VerCode        = CheckCode;
                        SMSRecordModel.DataCreateDate = DateTime.Now;
                        SMSRecordBLL.AddSMSRecord(SMSRecordModel);

                        //验证码加密后写入Cookies中
                        CookiesHelper.AddCookie("SMSCheckCode", StringHelper.Encode(CheckCode, "SMS"), 2, TimeType.Minute);
                        ResponseHelper.Write("0|发送成功!");
                    }
                    else
                    {
                        ResponseHelper.Write("1|发送失败!");
                    }
                }
                else
                {
                    ResponseHelper.Write("2|手机号码不存在!");
                }
            }
            else
            {
                ResponseHelper.Write("1|号码获取失败!");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CheckAdminPower("ReadUser", PowerCheckType.Single);
                string action = RequestHelper.GetQueryString <string>("Action");
                int    id     = RequestHelper.GetQueryString <int>("Id");
                if (id > 0)
                {
                    switch (action)
                    {
                    case "Delete":
                        CheckAdminPower("DeleteUser", PowerCheckType.Single);
                        if (ProductBLL.CountByShop(id) > 0)
                        {
                            ScriptHelper.Alert("该供应商存在相关产品,不能删除。");
                        }
                        else
                        {
                            UserBLL.Delete(id);
                            AdminLogBLL.Add(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("User"), id);
                        }
                        break;

                    default:
                        break;
                    }
                }

                UserSearchInfo userSearch = new UserSearchInfo();
                userSearch.UserName   = RequestHelper.GetQueryString <string>("UserName");
                userSearch.ProviderNo = RequestHelper.GetQueryString <string>("ProviderNo");
                UserName.Text         = userSearch.UserName;
                ProviderNo.Text       = userSearch.ProviderNo;

                var userList = UserBLL.SearchList(new UserSearchInfo {
                    UserName = userSearch.UserName, ProviderNo = userSearch.ProviderNo, UserType = (int)UserType.Provider
                });
                Count    = userList.Count;
                userList = userList.Skip((CurrentPage - 1) * PageSize).Take(PageSize).ToList();

                BindControl(userList, RecordList, MyPager);
            }
        }
Beispiel #25
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "最小学习量达成分析表";
            base.CheckUserPower("ReadEMSReport", PowerCheckType.Single);

            TestPaperInfo testPaperSearch = new TestPaperInfo();

            testPaperSearch.TestMinDate = startDate;
            testPaperSearch.TestMaxDate = ShopCommon.SearchEndDate(endDate);
            testPaperSearch.Scorse      = score;
            testPaperSearch.IsPass      = isPass;
            testPaperSearch.PaperName   = courseName;
            if (companyID < 0)
            {
                testPaperSearch.CompanyIdCondition = base.ExistsSonCompany ? base.SonCompanyID : base.UserCompanyID.ToString();
            }
            else
            {
                testPaperSearch.CompanyIdCondition = companyID.ToString();
            }

            if (!string.IsNullOrEmpty(realName) || !string.IsNullOrEmpty(userName))
            {
                UserSearchInfo user = new UserSearchInfo();
                user.RealName    = realName;
                user.UserName    = userName;
                user.InCompanyID = testPaperSearch.CompanyIdCondition;
                testPaperSearch.UserIdCondition = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(user));
                if (string.IsNullOrEmpty(testPaperSearch.UserIdCondition))
                {
                    testPaperSearch.UserIdCondition = "0";
                }
            }

            //if (!string.IsNullOrEmpty(courseName))
            //{
            //    testPaperSearch.Condition = "[CateID] in (select ID from [_Product] where [Name] like '%" + courseName + "%')";
            //}
            testPaperList = TestPaperBLL.ReadList(testPaperSearch, base.CurrentPage, base.PageSize, ref this.Count);
            base.BindPageControl(ref base.CommonPager);
        }
Beispiel #26
0
        /// <summary>
        /// 获取userlist 包括usergrade
        /// </summary>
        /// <param name="searchInfo"></param>
        /// <returns></returns>
        public List <UserInfo> SearchListAndUserGrade(int currentPage, int pageSize, UserSearchInfo searchModel, ref int count)
        {
            using (var conn = new SqlConnection(connectString))
            {
                ShopMssqlPagerClass pc = new ShopMssqlPagerClass()
                {
                    TableName      = "[View_UserGrade]",
                    Fields         = "*",
                    CurrentPage    = currentPage,
                    PageSize       = pageSize,
                    MssqlCondition = PrepareCondition(searchModel),
                    OrderField     = "[Id]",
                    OrderType      = OrderType.Desc
                };
                count = pc.Count;
                var data = conn.Query <UserInfo>(pc).ToList();

                return(data);
            }
        }
Beispiel #27
0
        public List <UserInfo> SearchUserList(int currentPage, int pageSize, UserSearchInfo userSearch, ref int count)
        {
            List <UserInfo>     userList = new List <UserInfo>();
            ShopMssqlPagerClass class2   = new ShopMssqlPagerClass();

            class2.TableName   = "[" + ShopMssqlHelper.TablePrefix + "User]";
            class2.Fields      = "[ID],[UserName],[UserPassword],[Email],[Sex],[Introduce],[Photo],[MSN],[QQ],[Tel],[Mobile],[RegionID],[Address],[Birthday],[RegisterIP],[RegisterDate],[LastLoginIP],[LastLoginDate],[LoginTimes],[SafeCode],[FindDate],[Status],[OpenID],[GroupID],[RealName],[CompanyID],[WorkingPostID],[StudyPostID],[WorkingPostName],[Department],[IDCard],[PostStartDate],[EntryDate]";
            class2.CurrentPage = currentPage;
            class2.PageSize    = pageSize;
            class2.OrderField  = "[ID]";
            class2.OrderType   = OrderType.Desc;
            this.PrepareCondition(class2.MssqlCondition, userSearch);
            class2.Count = count;
            count        = class2.Count;
            using (SqlDataReader reader = class2.ExecuteReader())
            {
                this.PrepareUserModel(reader, userList);
            }
            return(userList);
        }
Beispiel #28
0
        public List <UserInfo> SearchReportUserList(UserSearchInfo userSearch)
        {
            List <UserInfo> userList = new List <UserInfo>();
            StringBuilder   sql      = new StringBuilder();

            sql.Append("select [ID],[UserName],[UserPassword],[Email],[Sex],[Introduce],[Photo],[MSN],[QQ],[Tel],[Mobile],[RegionID],[Address],[Birthday],[RegisterIP],[RegisterDate],[LastLoginIP],[LastLoginDate],[LoginTimes],[SafeCode],[FindDate],[Status],[OpenID],[GroupID],[RealName],[CompanyID],[WorkingPostID],[StudyPostID],[WorkingPostName],[Department],[IDCard],[PostStartDate],[EntryDate] from [" + ShopMssqlHelper.TablePrefix + "User] ");
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, userSearch);
            if (mssqlCondition.ToString() != string.Empty)
            {
                sql.Append("where " + mssqlCondition.ToString());
                sql.Append(" Order by [CompanyID] Desc, [Department],[WorkingPostID],[WorkingPostName],[StudyPostID],[RegisterDate]");
                using (SqlDataReader reader = DbSQLHelper.ExecuteReader(sql.ToString()))
                {
                    this.PrepareUserModel(reader, userList);
                }
            }
            return(userList);
        }
Beispiel #29
0
        /// <summary>
        /// 用户消费分析
        /// </summary>
        public DataTable StatisticsUserConsume(int currentPage, int pageSize, UserSearchInfo userSearch, ref int count, string orderField, DateTime startDate, DateTime endDate)
        {
            List <UserInfo> userList       = new List <UserInfo>();
            string          orderCondition = string.Empty;
            MssqlCondition  orderCh        = new MssqlCondition();

            orderCh.Add("[AddDate]", startDate, ConditionType.MoreOrEqual);
            orderCh.Add("[AddDate]", endDate, ConditionType.Less);
            orderCondition = orderCh.ToString();
            if (!string.IsNullOrEmpty(orderCondition))
            {
                orderCondition = " AND " + orderCondition;
            }
            ShopMssqlPagerClass pc = new ShopMssqlPagerClass();

            pc.TableName   = "(SELECT Id,UserName,Sex,ISNULL(OrderCount,0) AS OrderCount,ISNULL(OrderMoney,0) AS OrderMoney ";
            pc.TableName  += "FROM Usr ";
            pc.TableName  += "LEFT OUTER JOIN (SELECT UserId, COUNT(*) AS OrderCount,Sum(ProductMoney-FavorableMoney+ShippingMoney+OtherMoney-CouponMoney) AS OrderMoney FROM [Order] WHERE OrderStatus=6 " + orderCondition + " GROUP BY UserId) AS TEMP3 ON Usr.Id = TEMP3.UserId where Usr.status = 2) AS PageTable";
            pc.Fields      = "[Id],[UserName],[Sex],[OrderCount],[OrderMoney]";
            pc.CurrentPage = currentPage;
            pc.PageSize    = pageSize;
            switch (orderField)
            {
            case "OrderCount":
                pc.OrderField = "[OrderCount],[Id]";
                break;

            case "OrderMoney":
                pc.OrderField = "[OrderMoney],[Id]";
                break;

            default:
                pc.OrderField = "[OrderCount],[Id]";
                break;
            }
            pc.OrderType      = OrderType.Desc;
            pc.MssqlCondition = PrepareCondition(userSearch);
            pc.Count          = count;
            count             = pc.Count;
            return(pc.ExecuteDataTable());
        }
Beispiel #30
0
        /// <summary>
        /// 是否存在手机号码(只验证非删除的考试人员)
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static bool IsExistMobile(string mobile, int userID)
        {
            bool isExist = false;

            if (!string.IsNullOrEmpty(mobile))
            {
                UserSearchInfo userSearch = new UserSearchInfo();
                userSearch.Mobile        = mobile;
                userSearch.StatusNoEqual = (int)UserState.Del;
                userSearch.GroupId       = 36;
                if (userID > 0)
                {
                    userSearch.OutUserID = userID.ToString();
                }
                if (UserBLL.SearchUserList(userSearch).Count > 0)
                {
                    isExist = true;
                }
            }
            return(isExist);
        }