示例#1
0
        public static User Login(string userEmail)
        {
            BLLUser bllUser = new BLLUser();
            User user = new User();
            user = bllUser.GetUserByEmail(userEmail);

            return user;
        }
示例#2
0
 public User GetUserByEmail(string email)
 {
     dal.OpenConn();
     SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM [User] WHERE [Email]='" + email + "'", dal.OpenConn());
     DataSet ds = new DataSet();
     int affected = adp.Fill(ds);
     dal.CloseConn();
     User user = new User();
     user.UserId = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0].ToString());
         user.UserName=ds.Tables[0].Rows[0].ItemArray[1].ToString();
         user.Email = ds.Tables[0].Rows[0].ItemArray[2].ToString();
         user.Password=ds.Tables[0].Rows[0].ItemArray[3].ToString();
         user.Mobile=ds.Tables[0].Rows[0].ItemArray[4].ToString();
         user.Gender = Convert.ToChar(ds.Tables[0].Rows[0].ItemArray[5].ToString());
         user.Verified = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[6].ToString());
         user.Image = ds.Tables[0].Rows[0].ItemArray[7].ToString();
     return user;
 }