Ejemplo n.º 1
0
        protected void BindControl()
        {
            ls_user_bll bll = new ls_user_bll();
            ls_user     usr = bll.GetUserById(LSRequest.GetQueryInt("id"));

            if (usr == null)
            {
                Response.Redirect("user_list.aspx");
            }
            else
            {
                this.hidId.Value             = usr.id.ToString();
                this.txtEmail.Text           = usr.user_email;
                this.txtMobile.Text          = usr.user_mobile;
                this.txtUserName.Text        = usr.user_name;
                this.txtNickName.Text        = usr.nick_name;
                this.rblSex.SelectedIndex    = usr.user_gender;
                this.rblStatus.SelectedIndex = usr.user_status;
                this.txtAvatar.Text          = usr.user_avatar;
                if (usr.user_birth.HasValue)
                {
                    this.txtBirthday.Text = usr.user_birth.Value.ToString("yyyy-MM-dd");
                }
                this.txtAvatar.Text = usr.user_avatar;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        protected void BindUserList(string pageIndex = null)
        {
            string startTime = txtStartTime.Text;
            string endTime   = txtEndTime.Text;

            this.page = LSRequest.GetQueryInt("page", 1);
            if (!string.IsNullOrEmpty(pageIndex))
            {
                this.page = Convert.ToInt32(pageIndex);
            }
            this.pageSize = GetPageSize(10);
            string          name    = txtKeywords.Text;
            int             role_id = Utils.StrToInt(this.ddlRole.SelectedValue, 0);
            int             totalCount;
            IList <ls_user> users = new ls_user_bll().GetPagedUserList(this.page, this.pageSize, name, startTime, endTime, role_id, out totalCount);

            //为Repeater绑定数据
            rptList.DataSource = users;
            rptList.DataBind();
            string pageUrl = Utils.CombUrlTxt("user_list.aspx", "page={0}", "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, totalCount, pageUrl, 8);
        }