public List<User> GetConfirmedPhones() { List<User> list = new List<User>(); DataProvider.ExecuteCmd(GetConnection, "dbo.AspNetUsers_SelectConfirmedPhones" , inputParamMapper: delegate (SqlParameterCollection paramCollection) { } , map: delegate (IDataReader reader, short set) { int startingIndex = 0; User u = new User(); u.Handle = reader.GetSafeString(startingIndex++); u.Phone = reader.GetSafeString(startingIndex++); u.UserId = reader.GetSafeString(startingIndex++); if (list == null) { list = new List<User>(); } list.Add(u); }); return list; }
public User GetById(int Id) { User p = new User(); DataProvider.ExecuteCmd(GetConnection, "dbo.Users_SelectById_v2" , inputParamMapper: delegate (SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Id", Id); } , map: delegate (IDataReader reader, short set) { int startingIndex = 0; //startingOrdinal p.Id = reader.GetSafeInt32(startingIndex++); p.FirstName = reader.GetSafeString(startingIndex++); p.LastName = reader.GetSafeString(startingIndex++); p.Email = reader.GetSafeString(startingIndex++); p.Phone = reader.GetSafeString(startingIndex++); p.Income = reader.GetSafeDecimal(startingIndex++); p.Gender = reader.GetSafeInt32(startingIndex++); p.Age = reader.GetSafeInt32(startingIndex++); p.NumberOfChildren = reader.GetSafeInt32(startingIndex++); p.MaritalStatus = reader.GetSafeInt32(startingIndex++); p.UserId = reader.GetSafeString(startingIndex++); p.Expenses = reader.GetSafeDecimal(startingIndex++); p.Savings = reader.GetSafeDecimal(startingIndex++); } ); return p; }
public User GetByUserId(string userId) { User p = new User(); DataProvider.ExecuteCmd(GetConnection, "dbo.Users_SelectByUserId" , inputParamMapper: delegate (SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@UserId", userId); } , map: delegate (IDataReader reader, short set) { int startingIndex = 0; //startingOrdinal //startingIndex++; p.Id = reader.GetSafeInt32(startingIndex++); p.FirstName = reader.GetSafeString(startingIndex++); p.LastName = reader.GetSafeString(startingIndex++); p.Handle = reader.GetSafeString(startingIndex++); p.Avatar = reader.GetSafeString(startingIndex++); p.AboutMe = reader.GetSafeString(startingIndex++); p.Path = reader.GetSafeString(startingIndex++); p.Line1 = reader.GetSafeString(startingIndex++); p.Line2 = reader.GetSafeString(startingIndex++); p.City = reader.GetSafeString(startingIndex++); p.StateProvinceID = reader.GetSafeInt32(startingIndex++); p.StateProvinceCode = reader.GetSafeString(startingIndex++); p.CountryRegionCode = reader.GetSafeString(startingIndex++); p.Name = reader.GetSafeString(startingIndex++); p.TerritoryID = reader.GetSafeInt32(startingIndex++); p.Zip = reader.GetSafeString(startingIndex++); p.Country = reader.GetSafeInt32(startingIndex++); p.Phone = reader.GetSafeString(startingIndex++); p.Email = reader.GetSafeString(startingIndex++); p.Age = reader.GetSafeInt32(startingIndex++); p.FinancialConcern = reader.GetSafeInt32(startingIndex++); p.Gender = reader.GetSafeInt32(startingIndex++); p.MaritalStatus = reader.GetSafeInt32(startingIndex++); p.SharesFinances = reader.GetSafeInt32(startingIndex++); p.HasKids = reader.GetSafeInt32(startingIndex++); p.CollegeStudent = reader.GetSafeInt32(startingIndex++); p.EmploymentStatus = reader.GetSafeInt32(startingIndex++); p.HomeStatus = reader.GetSafeInt32(startingIndex++); p.CreditCardDebt = reader.GetSafeInt32(startingIndex++); p.StudentLoanDebt = reader.GetSafeInt32(startingIndex++); p.Income = reader.GetSafeDecimal(startingIndex++); p.Expenses = reader.GetSafeDecimal(startingIndex++); p.Savings = reader.GetSafeDecimal(startingIndex++); p.LevelOfCollege = reader.GetSafeInt32(startingIndex++); p.OnboardCompleted = reader.GetSafeBool(startingIndex++); } ); return p; }
public List<User> GetAllByStatus(int status) { List<User> list = new List<User>(); DataProvider.ExecuteCmd(GetConnection, "dbo.Users_SelectByStatus" , inputParamMapper: delegate (SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Status", status); } , map: delegate (IDataReader reader, short set) { User p = new User(); int startingIndex = 0; p.FirstName = reader.GetSafeString(startingIndex++); p.LastName = reader.GetSafeString(startingIndex++); p.Phone = reader.GetSafeString(startingIndex++); p.Income = reader.GetSafeDecimal(startingIndex++); p.Gender = reader.GetSafeInt32(startingIndex++); p.Age = reader.GetSafeInt32(startingIndex++); p.NumberOfChildren = reader.GetSafeInt32(startingIndex++); p.MaritalStatus = reader.GetSafeInt32(startingIndex++); p.UserId = reader.GetSafeString(startingIndex++); p.EmailConfirmed = reader.GetSafeBool(startingIndex++); p.Status = reader.GetSafeInt32(startingIndex++); if (list == null) { list = new List<User>(); } list.Add(p); } ); return list; }