private void ComboBoxRawProduct_SelectionChanged(object sender, SelectionChangedEventArgs e) { int comboBoxNumber = ComboBoxRawProduct.SelectedIndex - 1; if (comboBoxNumber != -1) { TextBoxName.Width = 181; Loss.Visibility = Visibility.Visible; TextBoxLoss.Visibility = Visibility.Visible; TextBoxLoss.Text = "20"; rawProduct = rawProducts[comboBoxNumber]; TextBoxName.Text = rawProduct.RawProductName; TextBoxWeight.Text = rawProduct.RawProductWeight.ToString(); } else { TextBoxName.Width = 273; Loss.Visibility = Visibility.Hidden; TextBoxLoss.Visibility = Visibility.Hidden; TextBoxName.Text = ""; TextBoxWeight.Text = "0"; } }
public static async Task AddProductFromRaw(RawProduct raw, int count) { List <string> ProductName = new List <string>(); List <int?> ProductPrice = new List <int?>(); List <int?> ProductStock = new List <int?>(); foreach (string value in RawProduct.ProductNames.Values) { ProductName.Add(value); } foreach (int?value in RawProduct.ProductPrices.Values) { ProductPrice.Add(value); } foreach (int?value in RawProduct.ProductStockQuantity.Values) { ProductStock.Add(value); } for (int i = 0; i < count; i++) { Product product = new Product(); product.name = ProductName[i]; product.regular_price = ProductPrice[i]; product.manage_stock = true; product.stock_quantity = ProductStock[i]; await Rest.wc.Product.Add(product).ConfigureAwait(true); } }
private void AddButton_Click(object sender, RoutedEventArgs e) { RawProduct rawProduct = new RawProduct(); WindowShowDialog wsd = new WindowShowDialog(); rawProduct.RawProductName = TextBoxName.Text.ToString(); if (double.TryParse(TextBoxWeight.Text, out double resultWeight) && TextBoxDateOfPurchase.SelectedDate != null) { rawProduct.RawProductWeight = double.Parse(TextBoxWeight.Text); rawProduct.DateOfPurchase = DateTime.Parse(TextBoxDateOfPurchase.Text); rawProductRepository.AddRawProduct(rawProduct); wsd.LabelShowDialog.Content = "Råvaren blev tilføjet"; wsd.ShowDialog(); this.Close(); } else { wsd.LabelShowDialog.Content = "Der var en fejl i 'Vægt' eller 'Indkøbsdato'"; wsd.ShowDialog(); } }
public WindowEditRawProduct(int rawProductID) { rawProduct = rawProductRepository.DisplayRawProduct(rawProductID); InitializeComponent(); TextBoxName.Text = rawProduct.RawProductName; TextBoxWeight.Text = rawProduct.RawProductWeight.ToString(); TextBoxDateOfPurchase.Text = rawProduct.DateOfPurchase.ToString(); }
private void ButtonSearch_Click(object sender, RoutedEventArgs e) { RawProduct rawProduct = new RawProduct(); WindowShowDialog wsd = new WindowShowDialog(); rawProduct.RawProductName = TextBoxName.Text.ToString(); if (double.TryParse(TextBoxWeight.Text, out double resultWeight) || TextBoxDateOfPurchase.SelectedDate != null) { if (double.TryParse(TextBoxWeight.Text, out resultWeight) == false) { rawProduct.RawProductWeight = 0; } else { rawProduct.RawProductWeight = double.Parse(TextBoxWeight.Text); } if (TextBoxDateOfPurchase.SelectedDate == null) { rawProduct.DateOfPurchase = new DateTime(1973, 1, 1, 12, 0, 0); } else { rawProduct.DateOfPurchase = DateTime.Parse(TextBoxDateOfPurchase.Text); } eventSendList(rawProductRepository.DisplaySpecificRawProducts(rawProduct)); this.Close(); } else if (TextBoxWeight.Text == string.Empty || TextBoxDateOfPurchase.SelectedDate == null) { rawProduct.DateOfPurchase = new DateTime(1973, 1, 1, 12, 0, 0); eventSendList(rawProductRepository.DisplaySpecificRawProducts(rawProduct)); this.Close(); } else { wsd.LabelShowDialog.Content = "Der var en fejl i 'Vægt' eller 'Indkøbsdato'"; wsd.ShowDialog(); } }
static void Main(string[] args) { // Initialize Milkshake helpers into memory Store.Initialize(); // Reset the index Search.Reset(); ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("10.0.0.40:6379"); redis.PreserveAsyncOrder = true; //ISubscriber sub = redis.GetSubscriber(); IDatabase db = redis.GetDatabase(); //sub.Subscribe("milkshake_newproduct", (channel, message) => //{ //var context = TaskScheduler.FromCurrentSynchronizationContext(); while (true) { RedisValue item = db.ListLeftPop("milkshake_product_parse_queue"); if (item.HasValue && !item.IsNullOrEmpty) { try { //Console.Write("Deserializing product..."); Stopwatch sw = new Stopwatch(); //sw.Start(); RawProduct p = JsonConvert.DeserializeObject <RawProduct>(item); //sw.Stop(); //Console.WriteLine("Deserialize: " + sw.ElapsedMilliseconds + "ms"); //sw.Reset(); //// // Step 1: Check if store exists, if not, create it! //// sw.Start(); Store s = Store.Get(p.Store); if (s == null) { s = new Store(); s.Name = p.Store; if (!String.IsNullOrEmpty(p.StoreWebsite)) { s.Website = p.StoreWebsite; } else { s.Website = p.Store; } Store.Create(s); } p.StoreId = s.Id; p.Store = s.Name; sw.Stop(); //Console.WriteLine("Store: " + sw.ElapsedMilliseconds + "ms"); //sw.Reset(); // Step 2: Check if brand exists, if not, create it //sw.Start(); //Brand b = Brand.Get(p.Brand); /*if (b == null) * { * b = new Brand(); * b.Name = p.Brand; * * Brand.Create(b); * }*/ //if (b!=null) // p.Brand = b.Name; //sw.Stop(); //Console.WriteLine("Brand: " + sw.ElapsedMilliseconds + "ms"); //sw.Reset(); // Step 3: Check if manufacturer exists, if not, create it //sw.Start(); //Manufacturer m = Manufacturer.Get(p.Manufacturer); /*if (m == null) * { * m = new Manufacturer(); * m.Name = p.Manufacturer; * * Manufacturer.Create(m); * }*/ //if (m!=null) // p.Manufacturer = m.Name; //sw.Stop(); //Console.WriteLine("Manufacturer: " + sw.ElapsedMilliseconds + "ms"); //sw.Reset(); try { sw.Start(); ProductManager.AddProduct(p).Wait(); sw.Stop(); Console.WriteLine("Indexed product in " + sw.ElapsedMilliseconds + "ms"); sw.Reset(); } catch (Exception e) { Console.WriteLine("Unhandled exception occurred in Milkshake database pipeline: " + e.ToString()); } } catch (Exception e) { Console.WriteLine("Unhandled exception while deserializing RawProduct from JSON: " + e.ToString()); } } } //}); //while (true) //{ // Thread.Sleep(1); //} }
public List <RawProduct> DisplaySpecificRawProducts(RawProduct rawProduct) { return(rawProducts = rawProduct.GetSpecificRawProducts(rawProduct.RawProductName, rawProduct.RawProductWeight, rawProduct.DateOfPurchase)); }
public void EditRawProduct(RawProduct rawProduct) { rawProduct.EditRawProduct(rawProduct.RawProductID, rawProduct.RawProductName, rawProduct.RawProductWeight, rawProduct.DateOfPurchase); }
//Metods public void AddRawProduct(RawProduct rawProduct) { rawProduct.AddRawProduct(rawProduct.RawProductName, rawProduct.RawProductWeight, rawProduct.DateOfPurchase); }
public static void GetProductDictionary(RawProduct raw) { var s = raw.GetProductNames(); var d = raw.GetProductPrice(); var n = raw.GetStickQuantity(); }
public override RawProduct Parse(XElement node) { RawProduct p = new RawProduct(); p.Source = RawProduct.ProductDataSource.Linkshare; try { p.Store = _storeName; } catch { } try { p.StoreWebsite = ""; } catch { } try { p.LinkshareMID = _storeId; } catch { } try { p.LinkshareProductId = node.Attribute("product_id").Value; } catch { } try { p.Name = node.Attribute("name").Value; } catch { } try { p.SKU = node.Attribute("sku_number").Value; } catch { } try { p.Manufacturer = node.Attribute("manufacturer_name").Value; } catch { } try { p.MPN = node.Attribute("part_number").Value; } catch { } try { p.PrimaryCategory = node.Element("category").Element("primary").Value; } catch { } try { p.SecondaryCategory = node.Element("category").Element("secondary").Value; } catch { } try { p.Url = node.Element("URL").Element("product").Value; } catch { } try { p.Image = node.Element("URL").Element("productImage").Value; } catch { } try { p.BuyUrl = node.Element("URL").Element("buyLink").Value; } catch { } try { p.ShortDescription = node.Element("description").Element("short").Value; } catch { } try { p.LongDescription = node.Element("description").Element("long").Value; } catch { } try { p.Currency = node.Element("price").Attribute("currency").Value; } catch { } try { p.SalePrice = node.Element("price").Element("sale").Value; } catch { } try { p.SaleStartDate = node.Element("price").Element("sale").Attribute("begin_date").Value; } catch { } try { p.SaleEndDate = node.Element("price").Element("sale").Attribute("end_date").Value; } catch { } try { p.RetailPrice = node.Element("price").Element("retail").Value; } catch { } try { p.Brand = node.Element("brand").Value; } catch { } try { p.StandardShippingCost = node.Element("shipping").Element("cost").Element("amount").Value; } catch { } try { p.ShippingInformation = node.Element("shipping").Element("information").Value; } catch { } try { p.Availability = node.Element("shipping").Element("availability").Value; } catch { } try { p.Keywords = node.Element("keywords").Value; } catch { } try { p.UPC = node.Element("upc").Value; } catch { } try { p.LinkshareM1 = node.Element("m1").Value; } catch { } try { p.ImpressionUrl = node.Element("pixel").Value; } catch { } try { p.LinkshareClassId = (LinkshareAttributeClass)Enum.Parse(typeof(LinkshareAttributeClass), node.Element("attributes").Attribute("class_id").Value, true); } catch { } // NO attributes, simply return product if (!Enum.IsDefined(typeof(LinkshareAttributeClass), p.LinkshareClassId)) { return(p); } // Linkshare Attribute Miscellaneous is there regardless of class try { p.Miscellaneous = node.Element("attributes").Element("Miscellaneous").Value; } catch { } // Linkshare Attributes switch (p.LinkshareClassId) { case LinkshareAttributeClass.Books: try { p.Title = node.Element("attributes").Element("Title").Value; } catch { } try { p.Author = node.Element("attributes").Element("Author").Value; } catch { } try { p.ISBN = node.Element("attributes").Element("ISBN").Value; } catch { } try { p.Publisher = node.Element("attributes").Element("Publisher").Value; } catch { } try { p.PublishDate = node.Element("attributes").Element("Publish_Date").Value; } catch { } break; case LinkshareAttributeClass.Music: try { p.Genre = node.Element("attributes").Element("Genre").Value; } catch { } try { p.Artist = node.Element("attributes").Element("Artist").Value; } catch { } try { p.Format = node.Element("attributes").Element("Format").Value; } catch { } try { p.Album = node.Element("attributes").Element("Album").Value; } catch { } try { p.SongTitle = node.Element("attributes").Element("SongTitle").Value; } catch { } try { p.Label = node.Element("attributes").Element("Label").Value; } catch { } try { p.ReleaseDate = node.Element("attributes").Element("ReleaseDate").Value; } catch { } break; case LinkshareAttributeClass.Movies: try { p.Genre = node.Element("attributes").Element("Genre").Value; } catch { } try { p.Title = node.Element("attributes").Element("Title").Value; } catch { } try { p.Format = node.Element("attributes").Element("Format").Value; } catch { } try { p.Director = node.Element("attributes").Element("Director").Value; } catch { } try { p.Actor = node.Element("attributes").Element("Actor").Value; } catch { } try { p.MovieRating = node.Element("attributes").Element("Rating").Value; } catch { } try { p.Studio = node.Element("attributes").Element("Studio").Value; } catch { } try { p.ReleaseDate = node.Element("attributes").Element("Release_Date").Value; } catch { } break; case LinkshareAttributeClass.ComputerHardware: try { p.Platform = node.Element("attributes").Element("Platform").Value; } catch { } try { p.RAM = node.Element("attributes").Element("Ram").Value; } catch { } try { p.HardDrive = node.Element("attributes").Element("Hard_Drive").Value; } catch { } try { p.Processor = node.Element("attributes").Element("Processor").Value; } catch { } try { p.MonitorSize = node.Element("attributes").Element("Monitor_Size").Value; } catch { } try { p.Modem = node.Element("attributes").Element("Modem").Value; } catch { } try { p.Drive = node.Element("attributes").Element("Drive").Value; } catch { } break; case LinkshareAttributeClass.ComputerSoftware: try { p.Platform = node.Element("attributes").Element("Platform").Value; } catch { } try { p.Category = node.Element("attributes").Element("Category").Value; } catch { } try { p.Age = node.Element("attributes").Element("Age").Value; } catch { } break; case LinkshareAttributeClass.ClothingAndAccessories: try { p.ProductType = node.Element("attributes").Element("Product_Type").Value; } catch { } try { p.Size = node.Element("attributes").Element("Size").Value; } catch { } try { p.Material = node.Element("attributes").Element("Material").Value; } catch { } try { p.Color = node.Element("attributes").Element("Color").Value; } catch { } try { p.Gender = node.Element("attributes").Element("Gender").Value; } catch { } try { p.Style = node.Element("attributes").Element("Style").Value; } catch { } try { p.Age = node.Element("attributes").Element("Age").Value; } catch { } break; case LinkshareAttributeClass.Art: try { p.ProductType = node.Element("attributes").Element("Product_Type").Value; } catch { } try { p.Artist = node.Element("attributes").Element("Artist").Value; } catch { } try { p.Title = node.Element("attributes").Element("Title").Value; } catch { } try { p.Dimensions = node.Element("attributes").Element("Dimensions").Value; } catch { } break; case LinkshareAttributeClass.Toys: try { p.Age = node.Element("attributes").Element("Age").Value; } catch { } try { p.Gender = node.Element("attributes").Element("Gender").Value; } catch { } try { p.Theme = node.Element("attributes").Element("Theme").Value; } catch { } break; case LinkshareAttributeClass.Pets: try { p.PetType = node.Element("attributes").Element("Pet_Type").Value; } catch { } try { p.ProductType = node.Element("attributes").Element("Product_type").Value; } catch { } break; case LinkshareAttributeClass.Games: try { p.Format = node.Element("attributes").Element("Format").Value; } catch { } try { p.Title = node.Element("attributes").Element("Title").Value; } catch { } try { p.Publisher = node.Element("attributes").Element("Publisher").Value; } catch { } try { p.Age = node.Element("attributes").Element("Age").Value; } catch { } try { p.ReleaseDate = node.Element("attributes").Element("Release_date").Value; } catch { } break; case LinkshareAttributeClass.FoodAndDrink: try { p.ProductType = node.Element("attributes").Element("Product_Type").Value; } catch { } try { p.Region = node.Element("attributes").Element("Region").Value; } catch { } try { p.Size = node.Element("attributes").Element("Size").Value; } catch { } break; case LinkshareAttributeClass.GiftsAndFlowers: try { p.Occasion = node.Element("attributes").Element("Occasion").Value; } catch { } try { p.Recipient = node.Element("attributes").Element("Recipient").Value; } catch { } break; case LinkshareAttributeClass.Auto: try { p.Make = node.Element("attributes").Element("Make").Value; } catch { } try { p.Model = node.Element("attributes").Element("Genre").Value; } catch { } try { p.MPN = node.Element("attributes").Element("Part_Number").Value; } catch { } try { p.SubCategory = node.Element("attributes").Element("Category").Value; } catch { } try { p.Color = node.Element("attributes").Element("Color").Value; } catch { } break; case LinkshareAttributeClass.Electronics: try { p.Category = node.Element("attributes").Element("Category").Value; } catch { } try { p.Model = node.Element("attributes").Element("Model").Value; } catch { } try { p.FeaturesAndSpecifications = node.Element("attributes").Element("Genre").Value; } catch { } try { p.Color = node.Element("attributes").Element("Color").Value; } catch { } try { p.Dimensions = node.Element("attributes").Element("Dimensions").Value; } catch { } try { p.PowerType = node.Element("attributes").Element("Power_Type").Value; } catch { } try { p.Warranty = node.Element("attributes").Element("Warranty").Value; } catch { } break; case LinkshareAttributeClass.CreditCards: try { p.CardType = node.Element("attributes").Element("Card_Type").Value; } catch { } try { p.IntroAPR = node.Element("attributes").Element("Intro_APR").Value; } catch { } try { p.RegularAPR = node.Element("attributes").Element("Regular_APR").Value; } catch { } try { p.AnnualFee = node.Element("attributes").Element("Annual_Fee").Value; } catch { } try { p.Incentive = node.Element("attributes").Element("Incentive").Value; } catch { } try { p.BalanceTransfer = node.Element("attributes").Element("Balance_Transfer").Value; } catch { } try { p.Benefits = node.Element("attributes").Element("Benefits").Value; } catch { } try { p.TermsURL = node.Element("attributes").Element("TermsURL").Value; } catch { } break; } return(p); }
public override RawProduct Parse(XElement node) { RawProduct p = new RawProduct(); p.Source = RawProduct.ProductDataSource.CommissionJunction; try { p.Store = node.Element("programname").Value; } catch { } try { p.StoreWebsite = node.Element("programurl").Value; } catch { } try { p.Name = node.Element("name").Value; } catch { } try { p.Keywords = node.Element("keywords").Value; } catch { } try { p.Description = node.Element("description").Value; } catch { } try { p.SKU = node.Element("sku").Value; } catch { } try { p.Manufacturer = node.Element("manufacturer").Value; } catch { } try { p.ManufacturerID = node.Element("manufacturerid").Value; } catch { } // Unique Identifiers try { p.UPC = node.Element("upc").Value; } catch { } try { p.ISBN = node.Element("isbn").Value; } catch { } try { p.Currency = node.Element("currency").Value; } catch { } try { p.Price = node.Element("price").Value; } catch { } try { p.SalePrice = node.Element("saleprice").Value; } catch { } try { p.RetailPrice = node.Element("retailprice").Value; } catch { } try { p.FromPrice = node.Element("fromprice").Value; } catch { } try { p.Url = node.Element("buyurl").Value; } catch { } try { p.BuyUrl = node.Element("buyurl").Value; } catch { } try { p.ImpressionUrl = node.Element("impressionurl").Value; } catch { } try { p.Image = node.Element("imageurl").Value; } catch { } try { p.AdvertiserCategory = node.Element("advertisercategory").Value; } catch { } try { p.ThirdPartyId = node.Element("thirdpartyid").Value; } catch { } try { p.ThirdPartyCategory = node.Element("thirdpartycategory").Value; } catch { } try { p.Author = node.Element("author").Value; } catch { } try { p.Artist = node.Element("artist").Value; } catch { } try { p.Title = node.Element("title").Value; } catch { } try { p.Publisher = node.Element("publisher").Value; } catch { } try { p.Label = node.Element("label").Value; } catch { } try { p.Format = node.Element("format").Value; } catch { } try { p.Special = node.Element("special").Value; } catch { } try { p.Gift = node.Element("gift").Value; } catch { } try { p.PromotionalText = node.Element("promotionaltext").Value; } catch { } try { p.StartDate = node.Element("startdate").Value; } catch { } try { p.EndDate = node.Element("enddate").Value; } catch { } try { p.Offline = node.Element("offline").Value; } catch { } try { p.Online = node.Element("online").Value; } catch { } try { p.InStock = node.Element("instock").Value; } catch { } try { p.Condition = node.Element("condition").Value; } catch { } try { p.Condition = node.Element("condition").Value; } catch { } try { p.Warranty = node.Element("warranty").Value; } catch { } try { p.StandardShippingCost = node.Element("standardshippingcost").Value; } catch { } return(p); }
public override RawProduct Parse(CsvReader reader) { RawProduct p = new RawProduct(); p.Source = RawProduct.ProductDataSource.Pepperjam; try { p.ProgramId = reader["program_id"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Store = reader["program_name"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Currency = reader["currency"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.AgeRange = reader["age_range"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Artist = reader["artist"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.AspectRatio = reader["aspect_ratio"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Author = reader["author"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.BatteryLife = reader["battery_life"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Binding = reader["binding"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Url = reader["buy_url"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.BuyUrl = reader["buy_url"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Color = reader["color"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ColorOutput = reader["color_output"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Condition = reader["condition"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.LongDescription = reader["description_long"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Director = reader["director"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.DisplayType = reader["display_type"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Edition = reader["edition"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ExpirationDate = reader["expiration_date"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.FeaturesAndSpecifications = reader["features"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.FocusType = reader["focus_type"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Format = reader["format"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Functions = reader["functions"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Genre = reader["genre"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.HeelHeight = reader["heel_height"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Height = reader["height"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ImageThumbUrl = reader["image_thumb_url"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Image = reader["image_url"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Installation = reader["installation"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ISBN = reader["isbn"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Length = reader["length"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.LoadType = reader["load_type"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Location = reader["location"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.MadeIn = reader["made_in"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Manufacturer = reader["manufacturer"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Material = reader["material"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Megapixels = reader["megapixels"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.MemoryType = reader["memory_type"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.MemoryCapacity = reader["memory_capacity"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.MemoryCardSlot = reader["memory_card_slot"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ModelNumber = reader["model_number"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.MPN = reader["mpn"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Name = reader["name"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Occasion = reader["occasion"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.OperatingSystem = reader["operating_system"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.OpticalDrive = reader["optical_drive"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.RetailPrice = reader["price_retail"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Pages = reader["pages"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.PaymentAccepted = reader["payment_accepted"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.PaymentNotes = reader["payment_notes"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Platform = reader["platform"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.SalePrice = reader["price_sale"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Processor = reader["processor"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Publisher = reader["publisher"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.QuantityInStock = reader["quantity_in_stock"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Rating = reader["rating"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.RecommendedUsage = reader["recommended_usage"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Resolution = reader["resolution"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ShoeSize = reader["shoe_size"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ScreenSize = reader["screen_size"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ShippingMethod = reader["shipping_method"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ShippingPrice = reader["price_shipping"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ShoeWidth = reader["shoe_width"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Size = reader["size"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.SKU = reader["sku"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Staring = reader["staring"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Style = reader["style"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Tracks = reader["tracks"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.UPC = reader["upc"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Weight = reader["weight"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Width = reader["width"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.WirelessInterface = reader["wireless_interface"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Year = reader["year"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Zoom = reader["zoom"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.NetworkCategory = reader["category_network"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ProgramCategory = reader["category_program"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.ShortDescription = reader["description_short"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Discontinued = reader["discontinued"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.InStock = reader["in_stock"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.TechSpecsUrl = reader["tech_specs_url"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Keywords = reader["keywords"]; } catch (Exception e) { Console.WriteLine(Exception e); } try { p.Price = reader["price"]; } catch (Exception e) { Console.WriteLine(Exception e); } return(p); }