private bool CheckInsert()
        {
            var check     = false;
            var _clsCheck = new BllUser();
            var dtCheck   = _clsCheck.GetUser(string.Empty);

            if (dtCheck != null && dtCheck.Rows.Count > 0)
            {
                foreach (DataRow dr in dtCheck.Rows)
                {
                    if (lbID.Text != dr["AccountID"].ToString())
                    {
                        if (txtFullName.Value == dr["FullName"].ToString())
                        {
                            check  = true;
                            _Error =
                                LibAlert.Alert.AlertError("Tên đầy đủ này đã tồn tại.Vui lòng chọn tên đăng nhập khác !");
                        }
                        else if (txtEmail.Value == dr["Email"].ToString())
                        {
                            check  = true;
                            _Error =
                                LibAlert.Alert.AlertError("Email này đã tồn tại.Vui lòng chọn Email !");
                        }
                    }
                }
            }
            return(check);
        }
Пример #2
0
        private void SearchGet()
        {
            var    _html       = string.Empty;
            String sSearch     = Request.Params[0];
            var    _clsGetUser = new BllUser();
            var    _dtGetUser  = _clsGetUser.GetUser(sSearch);

            if (_dtGetUser != null && _dtGetUser.Rows.Count > 0)
            {
                for (int i = 0; i < _dtGetUser.Rows.Count; i++)
                {
                    string FullName   = _dtGetUser.Rows[i]["FullName"].ToString();
                    string Email      = _dtGetUser.Rows[i]["Email"].ToString();
                    string UserName   = _dtGetUser.Rows[i]["UserName"].ToString();
                    string User_Image = _dtGetUser.Rows[i]["User_Image"].ToString();
                    _html += "<div class='display_box' align='left'>";
                    _html += "<img src='" + User_Image +
                             "' style='width:50px; height:50px; float:left; margin-right:6px;' />";
                    _html += "<span class='name'>" + FullName + "</span>&nbsp;<br/>";
                    _html += "<span style='font-size:9px; color:#999999'>" + UserName + "</span>&nbsp;<br/>";
                    _html += "<span style='font-size:9px; color:#999999'>" + Email + "</span>";
                    _html += "</div>";
                    Response.Write(_html);
                    //Response.Write("<div class='display_box' align='left'><img src='" + media + "' style='width:50px; height:50px; float:left; margin-right:6px;' /><span class='name'>" + username + "</span>&nbsp;<br/>" + email + "<br/><span style='font-size:9px; color:#999999'>" + country + "</span></div>");
                }
            }
        }
Пример #3
0
        public void Update()
        {
            UserDS.UserDSDataTable dt = BllUser.GetUser(this._username);
            if (dt.Rows.Count != 0)
            {
                _firstName = dt[0].first_name;
                _lastName  = dt[0].last_name;

                _password     = dt[0].password;
                _passwordSalt = dt[0].password_salt;

                _userRoleId = dt[0].user_role_id;
                _timeZone   = dt[0].time_zone;

                _loginAttempts = dt[0].login_attempts;
                _isLockedOut   = dt[0].is_locked_out;
            }


            this._accessed = DateTime.Now;
        }
Пример #4
0
        public void RefreshAccountInfo()
        {
            UserDS.UserDSDataTable dt = BllUser.GetUser(_username);
            if (dt.Rows.Count > 0)
            {
                _isNew = false;

                _userId = dt[0].user_id;

                _firstName = dt[0].first_name;
                _lastName  = dt[0].last_name;

                _password     = dt[0].password;
                _passwordSalt = dt[0].password_salt;

                _userRoleId = dt[0].user_role_id;
                _timeZone   = dt[0].time_zone;

                _loginAttempts = dt[0].login_attempts;
                _isLockedOut   = dt[0].is_locked_out;
            }
            else
            {
                _userId = 0;

                _firstName = null;
                _lastName  = null;

                _password     = null;
                _passwordSalt = null;

                _userRoleId = 0;
                _timeZone   = null;

                _loginAttempts = 0;
                _isLockedOut   = false;

                _isNew = true;
            }
        }
Пример #5
0
 public static UserDS.UserDSDataTable GetUser(string userName)
 {
     UserDS.UserDSDataTable ds = BllUser.GetUser(userName);
     return(ds);
 }
 private void GetUserFollower()
 {
     if (Session["login"] == null && Session["UserName"] == null && Session["AccountID"] == null)
     {
         var _clsGetUserFollower = new BllUser();
         if (String.IsNullOrEmpty(txtSearchFriend.Value))
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUser(string.Empty);
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
         else
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUser(txtSearchFriend.Value);
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
     }
     else
     {
         var _clsGetUserFollower = new BllUser();
         if (String.IsNullOrEmpty(txtSearchFriend.Value))
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUserFollower(string.Empty,
                                                                          (Session["AccountID"].ToString()));
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
         else
         {
             var _dtGetUserFollower = _clsGetUserFollower.GetUserFollower(txtSearchFriend.Value,
                                                                          (Session["AccountID"].ToString()));
             if (_dtGetUserFollower != null && _dtGetUserFollower.Rows.Count > 0)
             {
                 ListViewAll.DataSource = _dtGetUserFollower;
                 ListViewAll.DataBind();
                 ListViewAll.Visible = true;
             }
             else
             {
                 ListViewAll.Visible = false;
             }
         }
     }
 }