Ejemplo n.º 1
0
 public static Models.WebModels.Listing DBToWeb(Models.DatabaseModels.Listing l)
 {
     _webListing           = new Models.WebModels.Listing();
     _webListing.ListingId = l.ListingId;
     _webListing.Item      = new Models.WebModels.Item();
     _webListing.Item.id   = l.ListingId;
     if (l.Item != null)
     {
         if (l.Item.attributes != null)
         {
             _webListing.Item.generalItemAttributes = WebGeneralAttrs(l.Item.attributes);
             _webListing.Item.attributes            = WebAttrs(l.Item.attributes);
         }
         _webListing.Item.categoryId       = l.Item.CategoryId;
         _webListing.Item.subcategoryId    = l.Item.SubcategoryId;
         _webListing.Item.updatedByUserId  = l.Item.updatedByUserId;
         _webListing.Item.createdByUserId  = l.Item.createdByUserId;
         _webListing.Item.createdDateTime  = l.Item.createdDateTime;
         _webListing.Item.updatedDateTime  = l.Item.updatedDateTime;
         _webListing.Item.shortDescription = l.Item.ShortDescription;
         _webListing.Item.longDescription  = l.Item.LongDescription;
         _webListing.Item.measurements     = MapDBMeasurements(l.Item.measurements);
         _webListing.Item.size             = new ItemSize();
         _webListing.Item.size.sizeTypeId  = l.Item.sizeTypeId;
         _webListing.Item.size.sizeValueId = l.Item.sizeValueId;
     }
     return(_webListing);
 }
Ejemplo n.º 2
0
 public static Models.DatabaseModels.Listing WebToDB(Models.WebModels.Listing l)
 {
     _dbListing                       = new Models.DatabaseModels.Listing();
     _dbListing.ListingId             = l.ListingId;
     _dbListing.ItemId                = l.ListingId;
     _dbListing.Item                  = new Models.DatabaseModels.Item();
     _dbListing.Item.attributes       = MapWebAttributes(l.Item.attributes, l.Item.generalItemAttributes);
     _dbListing.Item.measurements     = MapWebMeasurements(l.Item.measurements);
     _dbListing.Item.ItemId           = l.ListingId;
     _dbListing.Item.Listing          = _dbListing;
     _dbListing.Item.ListingId        = l.Item.id;
     _dbListing.Item.createdDateTime  = l.Item.createdDateTime;
     _dbListing.Item.updatedDateTime  = l.Item.updatedDateTime;
     _dbListing.Item.createdByUserId  = l.Item.createdByUserId;
     _dbListing.Item.updatedByUserId  = l.Item.updatedByUserId;
     _dbListing.Item.materialId       = l.Item.generalItemAttributes.material.itemAttributeId;
     _dbListing.Item.SubcategoryId    = l.Item.subcategoryId;
     _dbListing.Item.CategoryId       = l.Item.categoryId;
     _dbListing.Item.ShortDescription = l.Item.shortDescription;
     _dbListing.Item.LongDescription  = l.Item.longDescription;
     _dbListing.Item.sizeTypeId       = l.Item.size.sizeTypeId;
     _dbListing.Item.sizeValueId      = l.Item.size.sizeValueId;
     _dbListing.Item.secondaryColorId = l.Item.generalItemAttributes.secondaryColor.itemAttributeId;
     _dbListing.Item.primaryColorId   = l.Item.generalItemAttributes.primaryColor.itemAttributeId;
     _dbListing.Item.eraId            = l.Item.generalItemAttributes.era.itemAttributeId;
     return(_dbListing);
 }