Esempio n. 1
0
 /// <summary>
 /// Defaults username using any of url variable: user, userId, or userEmail
 /// </summary>
 private void DefaultUserName()
 {
     if (!String.IsNullOrEmpty(Request.QueryString["user"]))
     {
         _username = Request.QueryString["user"];
     }
     else if (!String.IsNullOrEmpty(Request.QueryString["userId"]))
     {
         User user = new User();
         user.Get(int.Parse(Request.QueryString["userId"]));
         _username = user[Caisis.BOL.User.UserName].ToString();
     }
     else if (!String.IsNullOrEmpty(Request.QueryString["userEmail"]))
     {
         UserDa    userDa = new UserDa();
         DataTable dt     = userDa.GetByEmail(Request.QueryString["userEmail"].ToString());
         if (dt.Rows.Count > 0)
         {
             _username = dt.Rows[0][Caisis.BOL.User.UserName].ToString();
         }
     }
     if (!_username.Equals(""))
     {
         this.userName.Value = _username;
         this.focusElementId = "password";
     }
 }