/// <summary> /// Maps names /// </summary> /// <param name="data"></param> /// <param name="rowNum"></param> /// <returns></returns> public Names MapNames(SqlReaderWrapper data, int rowNum) { return(new Names() { Name = data.GetString("ChildName") }); }
/// <summary> /// Maps a post to an object /// </summary> /// <param name="data">the record from the database</param> /// <param name="rownum">the row number of the data</param> /// <returns>the data fro mthe database mapped to an object</returns> private Post PostMapper(SqlReaderWrapper data, int rownum) { return(new Post(data.GetInt("PurposeTypeId").ToString(), data.GetString("PostTitle"), data.GetString("PostDescription"), data.GetInt("PostID"), data.GetDate("DatePosted"), (data.GetInt("SubCategoryId")), (data.GetInt("CategoryId")), data.GetDate("DatePosted"), data.GetString("PostedBy"), data.GetInt("PostStatus"))); }
//-------------------------------------------OBJECT MAPPERS------------------------------------------- /// <summary> /// Map the event preview object from the database /// </summary> /// <param name="data"></param> /// <param name="rownum"></param> /// <returns>Event preview object</returns> private EventPreview EventPreviewMapper(SqlReaderWrapper data, int rownum) { return(new EventPreview(data.GetInt("EventId"), data.GetString("EventName"), data.GetDate("EventDate"), data.GetString("Pictures"))); }
/// <summary> /// Maps the data from the database to an object /// </summary> /// <param name="data">the record from the database</param> /// <param name="rownum">the row number of the record</param> /// <returns>the information from the database mapped to an object</returns> private Post PostMapperWithFullName(SqlReaderWrapper data, int rownum) { return(new Post(data.GetInt("PurposeTypeId").ToString(), data.GetString("PostTitle"), data.GetString("PostDescription"), data.GetInt("PostID"), data.GetDate("DatePosted"), data.GetInt("SubCategoryId"), data.GetInt("CategoryId"), data.GetDate("ExpirationDate"), data.GetString("PostedBy"), data.GetInt("PostStatus"), data.GetString("PostedByFullName"), data.GetString("PostedByEmailAddress"))); }
public Category CategoryMapper(SqlReaderWrapper data, int rownum) { return(new Category() { CategoryId = data.GetInt("CategoryID"), CategoryName = data.GetString("CategoryName") }); }
/// <summary> /// Maps Shoes types /// </summary> /// <param name="data"></param> /// <param name="rowNum"></param> /// <returns></returns> public ShoeTypes MapShoeTypes(SqlReaderWrapper data, int rowNum) { return(new ShoeTypes() { Description = data.GetString("Description"), ShoeTypeId = data.GetInt("id") }); }
/// <summary> /// Current user object mapper /// </summary> /// <param name="data"></param> /// <param name="row"></param> /// <returns>Current User object</returns> private CurrentUser MapSecurityUser(SqlReaderWrapper data, int row) { return(new CurrentUser(data.GetString("loginname"), data.GetString("emailaddress"), data.GetString("firstname"), data.GetString("lastname"), data.GetString("fullname"))); }
/// <summary> /// Maps a claim to an object /// </summary> /// <param name="data">the record from the database</param> /// <param name="rownum">the row number of the record</param> /// <returns>the database information mapped to an object</returns> private PostClaim PostClaimMapper(SqlReaderWrapper data, int rownum) { return(new PostClaim(data.GetInt("ClaimedPostId"), data.GetString("ClaimerName"), data.GetString("EmailAddress"), data.GetDate("DateClaimed")) { PostTitle = data.GetString("PostTitle") }); }
public MonthlyBudget MapMonthlyBudget(SqlReaderWrapper data, int rowNum) { return(new MonthlyBudget { FoodDollarAmount = data.GetInt("Food"), GasDollarAmount = data.GetInt("Gas"), ShoppingDollarAmount = data.GetInt("Shopping") }); }
/// <summary> /// Admin object mapper /// </summary> /// <param name="data"></param> /// <param name="row"></param> /// <returns>Admin object</returns> private Admin MapAdmin(SqlReaderWrapper data, int row) { return(new Admin(data.GetInt("AdminId"), data.GetString("Name"), data.GetString("LoginId"), data.GetBoolean("IsActive"), data.GetBoolean("IsSuperAdmin"), data.GetDate("DateAdded"), data.GetString("AddedBy"))); }
/// <summary> /// Maps the information from the database to an object /// </summary> /// <param name="data">the record from the database</param> /// <param name="rownum">the row number of the record</param> /// <returns>the data from the database mapped to an objecct</returns> private PostPreview PostPreviewMapper(SqlReaderWrapper data, int rownum) { return(new PostPreview( data.GetInt("PurposeTypeId").ToString(), data.GetInt("PostID"), data.GetString("PostName"), data.GetString("PictureImagePath"), data.GetString("PostType"), data.GetInt("PostStatus") )); }
/// <summary> /// Maps shoes and description /// </summary> /// <param name="data"></param> /// <param name="rowNum"></param> /// <returns></returns> public ShoeTrackerDto MapShoeAndDescription(SqlReaderWrapper data, int rowNum) { return(new ShoeTrackerDto() { Date = data.GetDate("Date"), Size = data.GetInt("Size"), Price = data.GetDecimal("Price"), ShoeTypeId = data.GetInt("ShoeTypeId"), ChildName = data.GetString("ChildName"), Link = data.GetString("Link"), Description = data.GetString("Description") }); }
/// <summary> /// Maps event object from database /// </summary> /// <param name="data"></param> /// <param name="rownum"></param> /// <returns>An event object</returns> private Event EventMapper(SqlReaderWrapper data, int rownum) { return(new Event(data.GetInt("EventId"), data.GetString("Venue"), data.GetString("EventDescription"), data.GetString("EventName"), data.GetDate("EventDate"), Enumeration.TryFindById <TicketCategoryEnum>(data.GetInt("CategoryId")), data.GetInt("Quantity"), data.GetInt("Claims"), Enumeration.TryFindById <TicketPostStatusEnum>(data.GetInt("PostStatus")), data.GetDate("DatePosted"), data.GetInt("TotalHandsRaised"), data.GetInt("MaxNumberOfWins"), data.GetInt("WinsRemaining"))); }
/// <summary> /// Maps ticket claims object /// </summary> /// <param name="data">the record from the database</param> /// <param name="rownum">the row numberof the record</param> /// <returns>A ticket claims object</returns> private TicketClaims TicketClaimsMapper(SqlReaderWrapper data, int rownum) { TicketClaims claims = new TicketClaims (data.GetInt("TicketClaimsId"), data.GetInt("EventId"), data.GetString("EventName"), data.GetString("FirstName"), data.GetString("LastName"), data.GetString("EmailAddress"), data.GetString("UserName"), data.GetDate("ClaimDate"), data.GetInt("TicketWins"), data.GetInt("HandRaises")); return(claims); }
/// <summary> /// Maps a row from the database to an object /// </summary> /// <param name="data">the data from a row in sthe database.</param> /// <param name="row">the row numbero of the data</param> /// <returns>the email address of one of the non-winners</returns> private string MapGetAllNonWinnersForEvent(SqlReaderWrapper data, int row) { string nonWinner = data.GetString("EmailAddress"); return(nonWinner); }
/// <summary> /// Maps the data returned from the database to an object /// </summary> /// <param name="data">the data returned from the database</param> /// <param name="row">the row number of the data</param> /// <returns>The data from the database row mapped to an object</returns> private string MapGetAllWinnersForEvent(SqlReaderWrapper data, int row) { string winnerEmail = data.GetString("WinnerUserName"); return(winnerEmail); }
/// <summary> /// Maps the picture object from the database /// </summary> /// <param name="data"></param> /// <param name="rownum"></param> /// <returns>A picture object</returns> private Picture PictureMapper(SqlReaderWrapper data, int rownum) { return(new Picture(data.GetInt("PostId"), data.GetString("PictureImagePath"), data.GetInt("EventId"))); }
/// <summary> /// map path /// </summary> /// <param name="data"></param> /// <param name="rowNum"></param> /// <returns></returns> public string MapReceiptPath(SqlReaderWrapper data, int rowNum) { return(data.GetString("ReceiptPath")); }
/// <summary> /// Maps the data from the databas to an object /// </summary> /// <param name="data">the data from one record in the databse.</param> /// <param name="rownum">the row number of the record.</param> /// <returns>the information about an email template mapped to an object.</returns> private EmailTemplate EmailMapper(SqlReaderWrapper data, int rownum) { return(new EmailTemplate(data.GetString("TemplateName"), data.GetString("EmailBody"), data.GetString("EmailSubject"))); }