private void BindResult()
        {
            BLL.MembershipBLL account = new BLL.MembershipBLL();
            DateTime? dateFrom = null, dateTo = null;
            if (!String.IsNullOrEmpty(txtCreatedFrom.Text))
            {
                dateFrom = Helper.Date.ToDate(txtCreatedFrom.Text);
            }
            if (!String.IsNullOrEmpty(txtCreatedTo.Text))
            {
                dateTo = Helper.Date.ToDate(txtCreatedTo.Text);
            }
            int? status = null;
            if (!String.IsNullOrEmpty(lstAccountStatus.SelectedValue))
                status = Helper.TypeConverter.ToInt32(lstAccountStatus.SelectedValue);
            account.Search(txtEmail.Text, dateFrom, dateTo, lstRoles.SelectedValue,status);

            grdMemberResult.DataSource = account.DefaultView;
            grdMemberResult.DataBind();
        }
Exemplo n.º 2
0
 protected void btnUpdateUserName_Click(object sender, EventArgs e)
 {
     TextBox txtNewUserName = (TextBox)dtlAccountInfo.FindControl("txtUsername");
     BLL.Member member = new BLL.Member();
     if (member.GetMemberByUserName(MemberUserName))
     {
         member.Name = txtNewUserName.Text;
     }
     BLL.MembershipBLL membership = new BLL.MembershipBLL();
     string msg;
     if (membership.ChangeUsername(MemberUserName, txtNewUserName.Text, Membership.ApplicationName, out msg))
     {
         member.Save();
         Response.Redirect(Request.Url.AbsolutePath + "?search=" + txtNewUserName.Text);
     }
     else
     {
         txtNewUserName.Text = MemberUserName;
         lblErrorMessage.Text = msg;
     }
 }