public DeptorsReadersModel Map(ReaderHistory o) { if (o == null) { return(null); } DeptorsReadersModel deptorsReadersBusiness = new DeptorsReadersModel(); ReaderMapper readerMapper = new ReaderMapper(); InventoryMapper inventoryMapper = new InventoryMapper(); ReaderBusinessModel readerBusinessModel = readerMapper.Map(o.Reader); InventoryBusinessModel invertoryBusinessModel = inventoryMapper.Map(o.Inventory); deptorsReadersBusiness.readerId = readerBusinessModel.ReaderId; deptorsReadersBusiness.FirstName = readerBusinessModel.FirstName; deptorsReadersBusiness.LastName = readerBusinessModel.LastName; deptorsReadersBusiness.Address = readerBusinessModel.Address; deptorsReadersBusiness.Phone = readerBusinessModel.Phone; if (o.Inventory != null) { deptorsReadersBusiness.ItemName = invertoryBusinessModel.Item.Name; } deptorsReadersBusiness.StartDate = o.StartDate; deptorsReadersBusiness.FinishDate = o.FinishDate; return(deptorsReadersBusiness); }
public TagScore Map(TagScoreBusinessModel source) { TagScore destination = new TagScore(); if (source.Item is BookBusinessModel) { BookWithoutTagsMapper bookMapper = new BookWithoutTagsMapper(); destination.Item = bookMapper.Map(source.Item as BookBusinessModel); } if (source.Item is DiskBusinessModel) { DiskMapper diskMapper = new DiskMapper(); destination.Item = diskMapper.Map(source.Item as DiskBusinessModel); } if (source.Item is MagazineBusinessModel) { MagazineMapper magazineMapper = new MagazineMapper(); destination.Item = magazineMapper.Map(source.Item as MagazineBusinessModel); } ReaderMapper readerMapper = new ReaderMapper(); destination.Reader = readerMapper.Map(source.Reader); destination.Score = source.Score; return(destination); }
public HistoryBusinessModelForGrid Map(ReaderHistory o) { if (o == null) { return(null); } HistoryBusinessModelForGrid readerHistoryBusiness = new HistoryBusinessModelForGrid(); ReaderMapper readerMapper = new ReaderMapper(); InventoryMapper inventoryMapper = new InventoryMapper(); ReaderBusinessModel readerBusinessModel = readerMapper.Map(o.Reader); InventoryBusinessModel invertoryBusinessModel = inventoryMapper.Map(o.Inventory); readerHistoryBusiness.ReaderName = readerBusinessModel.FirstName; readerHistoryBusiness.ItemName = invertoryBusinessModel.Item.Name; readerHistoryBusiness.StartDate = o.StartDate; readerHistoryBusiness.FinishDate = o.FinishDate; return(readerHistoryBusiness); }
public ReaderHistory Map(ReaderHistoryBusinessModel o) { if (o == null) { return(null); } ReaderHistory readerHistory = new ReaderHistory(); ReaderMapper readerMapper = new ReaderMapper(); InventoryMapper inventoryMapper = new InventoryMapper(); Reader reader = readerMapper.Map(o.ReaderBusiness); Inventory invertory = inventoryMapper.Map(o.InventoryBusiness); readerHistory.ReaderHistoryId = o.Id; readerHistory.StartDate = o.StartDate; readerHistory.ReturnDate = o.ReturnDate; readerHistory.FinishDate = o.FinishDate; readerHistory.Reader = reader; readerHistory.Inventory = invertory; return(readerHistory); }
public ReaderHistoryBusinessModel Map(ReaderHistory o) { if (o == null) { return(null); } ReaderHistoryBusinessModel readerHistoryBusiness = new ReaderHistoryBusinessModel(); ReaderMapper readerMapper = new ReaderMapper(); InventoryMapper inventoryMapper = new InventoryMapper(); ReaderBusinessModel readerBusinessModel = readerMapper.Map(o.Reader); InventoryBusinessModel invertoryBusinessModel = inventoryMapper.Map(o.Inventory); readerHistoryBusiness.Id = o.ReaderHistoryId; readerHistoryBusiness.StartDate = o.StartDate; readerHistoryBusiness.ReturnDate = o.ReturnDate; readerHistoryBusiness.FinishDate = o.FinishDate; readerHistoryBusiness.ReaderBusiness = readerBusinessModel; readerHistoryBusiness.InventoryBusiness = invertoryBusinessModel; return(readerHistoryBusiness); }