public static VendorDetails MapFromObject(Vendor obj, ResponseGenerator responseGenerator) { var materials = new List <MaterialVendorListing>(); foreach (var material in obj.Materials) { materials.Add(MaterialVendorListing.MapFromObject(material)); } return(new VendorDetails() { VendorId = obj.VendorId, Name = obj.Name, ContractStart = obj.ContractStart, ContractEnd = obj.ContractEnd, ContractNumber = obj.ContractNumber, PointOfContact = obj.PointOfContact, PhoneNumber = obj.PhoneNumber, Email = obj.Email, Website = obj.Website, Status = (obj.Active) ? "Active" : "Inactive", Active = obj.Active, Invoices = responseGenerator.GenerateBasicInvoicesList(obj.Invoices), Tickets = responseGenerator.GenerateBasicTicketList(obj.Tickets), Materials = materials }); }
public static MonthlyBreakdown MapFromObject(core.Models.MonthlyBreakdown obj, ResponseGenerator responseGenerator) { return(new MonthlyBreakdown() { Month = obj.Month, TotalExpense = obj.TotalExpense, Invoices = responseGenerator.GenerateBasicInvoicesList(obj.Invoices), Tickets = responseGenerator.GenerateBasicTicketList(obj.Tickets), Transfers = responseGenerator.GenerateBasicTransferList(obj.Transfers), }); }