Search Results

Search found 713 results on 29 pages for 'quantity'.

Page 6/29 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • general database modeling and django specific modeling

    - by Shreko
    I'm wondering what is the best way to model something like the following. Lets say my company sells metal bars (parameters/fields are: length, profile_type, quantity etc.) of different profiles, where profiles may be pipe(pipe_diameter, wall_thickness) or hollow_rectangle(base, height, wall_thickness), or maybe some other profile with different parameters. Lets say maximum number of profiles would be 12, each profile having between 2-5 parameters. Should everything be in a single table like table_bars: id, length, quantity, profile_type, pipe_diameter, wall_thickness, base, height, etc.) where profile type would be (pipe, rectangle etc.) or should every shape have its own table with its own parameters and in table_bars keep only id, length, quantity profile_type and profile_id) and are there any django specific issues is multiple tables are the best answer? Thanks

    Read the article

  • Databound Checkbox list with textboxes in a webform

    - by zSysop
    Hi all, I'm having trouble coming up with a solution for the following problem and i was wondering if someone here would help me out. I need to pull a list of supplies from a db table and list them along with two textboxes (one for quantity, and another for manufacturer) so the list would look something like this. checkbox for supply 1 | Quantity | Manufacturer checkbox for supply 2 | Quantity | Manufacturer .. I also need to store all of the checked items in a db table. I'm not sure how i should go about doing this. I've heard some talk about a repeater control being useful but i've not come across any examples that do this type of thing. Thanks in advance

    Read the article

  • Algorithm to fill slots

    - by Peter Lang
    I am searching for an algorithm to fill several slots, which are already filled to some level. The current levels and the available quantity to fill are known Resulting levels should be as equal as possible, but existing level cannot be reduced Slots are filled from left to right, so left slots get higher level if equal level is impossible       The image above shows six examples, each column represents a slot. The grey area is already filled, the blue are is the expected position of the new elements. I could iterate through my slots and increase the quantity on the lowest slot by 1 until the available quantity is consumed, but I wonder about how to actually calculate the new filling levels. I am going to implement this with SQL/PL/SQL, other code is just as welcome though :)

    Read the article

  • Ruby on Rails - nested attributes: How do I access the parent model from child model

    - by TMaYaD
    I have a couple of models like so class Bill < ActiveRecord::Base has_many :bill_items belongs_to :store accepts_nested_attributes_for :bill_items end class BillItem <ActiveRecord::Base belongs_to :product belongs_to :bill validate :has_enough_stock def has_enough_stock stock_available = Inventory.product_is(self.product).store_is(self.bill.store).one.quantity errors.add(:quantity, "only #{stock_available} is available") if stock_available < self.quantity end end The above validation so obviously doesn't work because when I'm reading the bill_items from nested attributes inside the bill form, the attributes bill_item.bill_id or bill_item.bill are not available before being saved. So how do I go about doing something like that?

    Read the article

  • product suggestion based on user data

    - by Enkay
    I'm trying to add suggestions to product pages along the lines of : "Customers who purchased this item also purchased x and y". The way the data is compiled right now is a mysql table with 3 rows. PRODUCT | CUSTOMER |QUANTITY Product is the product ID. Customer is the customer ID. Quantity is the number of time that product was bought by that customer. For each product description page, the system needs to figure out which users bought that product, what other products those users bought, in what quantity and then return the 2 products that were bought the most by people who bought the current product. Hopefully this makes sense and someone can point me in the right directions as to what the mysql query should look like. Thanks.

    Read the article

  • Arbitrary attributes error with has_one association and Factory Girl

    - by purpletonic
    I'm trying to build a basic shopping cart for a Rails app I'm working on. Nothing special, - the shopping cart has many line_items - each line_item has_one product associated and a quantity with it class Cart < ActiveRecord::Base attr_accessible :line_items has_many :line_items, :dependent => :destroy end class LineItem < ActiveRecord::Base attr_accessible :quantity, :product belongs_to :cart has_one :product end I'm trying to use RSpec to test this association, but i'm doing something wrong as I'm getting an error that says: DEPRECATION WARNING: You're trying to create an attribute 'line_item_id'. Writing arbitrary attributes on a model is deprecated, and I'm not sure why. In my factories.rb file I'm defining the line_item factory as follows: factory :line_item do quantity { Random.rand(1..5) } product end factory :cart do factory :cart_with_two_line_items do ignore do line_item_count 2 end after(:create) do |cart, evaluator| FactoryGirl.create_list(:line_item, evaluator.line_item_count, cart_id: cart) end end end Any pointers where I'm going wrong, it's probably something basic, but I'm still quite new to Rspec. Thanks in advance.

    Read the article

  • how to call sql string from nhibernate

    - by frosty
    i have the following method, at the moment it's return the whole sql string. How would i execute the following. using (ITransaction transaction = session.BeginTransaction()) { string sql = string.Format( @"DECLARE @Cost money SET @Cost = -1 select @Cost = MAX(Cost) from item_costings where Item_ID = {0} and {1} >= Qty1 and {1} <= Qty2 RETURN (@Cost)", itemId, quantity); string mystring = session .CreateSQLQuery(sql) .ToString(); transaction.Commit(); return mystring; } // EDIT here is the final version using criteria using (ISession session = NHibernateHelper.OpenSession()) { decimal cost = session .CreateCriteria(typeof (ItemCosting)) .SetProjection(Projections.Max("Cost")) .Add(Restrictions.Eq("ItemId", itemId)) .Add(Restrictions.Le("Qty1", quantity)) .Add(Restrictions.Ge("Qty2", quantity)) .UniqueResult<decimal>(); return cost; }

    Read the article

  • django left join with null

    - by SledgehammerPL
    The model: class Product(models.Model): name = models.CharField(max_length = 128) def __unicode__(self): return self.name class Receipt(models.Model): name = models.CharField(max_length=128) components = models.ManyToManyField(Product, through='ReceiptComponent') class Admin: pass def __unicode__(self): return self.name class ReceiptComponent(models.Model): product = models.ForeignKey(Product) receipt = models.ForeignKey(Receipt) quantity = models.FloatField(max_length=9) unit = models.ForeignKey(Unit) def __unicode__(self): return unicode(self.quantity!=0 and self.quantity or '') + ' ' + unicode(self.unit) + ' ' + self.product.genitive The idea: there are a components on stock. I'd like to find out which recipes I can made with components which I have. It's not easy - but possible - I made a SQL view, which gets the solution. But I'm learning python and Django so I'd like to make it Django-style ;D The concept of solution: get the set of recipes which has at last one component: list_of_available_components = ReceiptComponent.objects.filter(product__in=list_of_available_products).distinct() list_of_related_receipts = Receipt.objects.filter(receiptcomponent__in = list_of_available_components).distinct() get recipes (from list_of_related_receipts) which has not at last one component list_of_incomplete_recipes = (SELECT * FROM drinkbook_receiptcomponent LEFT JOIN drinkstore_stock_products USING(product_id) WHERE drinkstore_stock_products.stock_id IS NULL AND receipt_id IN (SELECT receipt_id FROM drinkbook_receiptcomponent JOIN drinkstore_stock_products USING(product_id))) get recipes (from list_of_related_receipts) which are not in "list_of_incomplete_recipes"

    Read the article

  • rails update whole index of a model with one click

    - by mattherick
    hello! i have a store model, this will handle my leaflet and my shoppingcart for my shop. now i d´like to show all items added from an user to his leaflet in the index of store. in the store an user can change the quantity of the choosen items. and now i want to save that the changes of the different quantities in the database with one click on a button "update store". so how could i implement an update over the whole index with one click? i´d like to do this with ajax and most dynamically. somebody has an idea? i render all items into a form so far, but now i have the problem, when i submit this form only the last quantity and item id are included in the params. further i pushed every quantity into an array and i want to submit this also as a param. but i could not. please give me some tips, will be very fine :) mattherick

    Read the article

  • C# GridView dynamically built columns with textboxes ontextchanged

    - by tnriverfish
    My page is a bulk order form that has many products and various size options. I've got a gridview that has a 3 static columns with labels. There are then some dynamically built columns. Each of the dynamically built columns have a textbox in them. The textbox is for quantity. Trying to either update the server with the quantity entered each time a textbox is changed (possibly ontextchanged event) or loop though each of the rows column by column and gather all the items that have a quantity and process those items and their quantities all at once (via button onclick). If I put the process that builds the GridView behind a if(!Page.IsPostBack) then the when a textchanged event fires the gridview only gets the static fields and the dynamic ones are gone. If I remove the if(!Page.IsPostBack) the process to gather and build the page is too heavy on processing and takes too long to render the page again. Some advice would be appreciated. Thanks

    Read the article

  • help with multi dimentional arrays

    - by sarmenhb11
    hi, i am building a shopping cart and cant figure out how to store something like this into a session. [product_id1] = quantity; [product_id1] = size [product_id1] = color; [product_id2] = quantity; [product_id2] = size; [product_id2] = color; ... etc so when a user select the quantity of a product then selects its color then selects to add to a cart i want the items selected to be added into a session and each item added to the cart , its attributes selected to be added into a session. how would i do this? many many thanks.

    Read the article

  • Cakephp, an elegant solution to quantities?

    - by Smickie
    Hi, I have a shopping cart system in Cakephp, this table has all your usual maguffins: user_ids, product_ids, option_lists ect. It also has quantity. I currently have some awful nested loops to check if the record is the same as any in there, if so add one to the quantity. If not add a new cart item. This loop has to check associated list items and product options, so it goes quite deep. What I'm wondering is if there is a more elegant way of checking to see if two cart items in a database are similar (everything except for quantity). Cheers!

    Read the article

  • Help with shopping cart in javascript

    - by user228390
    Hey guys, I'm having problems with my shopping cart. What I am trying to do is make a function that will add an item the cart and then and function that will view the cart and show the details. But what I have got so far does not do that, it just simply adds and goes straight to view cart. Also I wanted to store the name of each items in different global arrays (name, price and sum) but I can't get it work that way. Can any help me overcome this problem? Edit: I've tried to get it to work by adding some more items and attaching it to another html page, but now the code does not seem to work at all , before it showed the price and total and now I get nothing . javascript code function round_total (c) { var pennies = c * 100; pennies = Math.round(pennies); var strPennies = "" + pennies; var len = strPennies.length; return parseFloat(strPennies.substring(0, len - 2) + "." + strPennies.substring(len - 2, len)); } // End of round_total function. /* Start of generate_page function. */ function generate_page (form) { tax = 0.08; delivery_p = 2.99; var odate = new Date(); var qty = form.quantity.value; var product_v = new String(form.product.value); var total_price = product_v.substr(product_v.indexOf("$") + 1, product_v.length - product_v.indexOf("$")); var price_without_tax = round_total(qty * total_price); var ttax = round_total(price_without_tax * tax); var delivery = round_total(qty * delivery_p); var total_p = round_total(price_without_tax + ttax + delivery); document.writeln("Quantity: " + qty + "<br>"); document.writeln("Price: $" + total_price + "<br>"); document.writeln("Delivery: $" + delivery + "<br>"); document.writeln("Total: $" + total_p + "<br>"); document.writeln("Order placed on: " + odate.toGMTString()); } function calculate() { round_total (c)(); generate_page (form)(); } HTML code: Shopping cart Welcome, Guest Login Sign Up Stay Updated: Subscribe via RSS Email Updates <div id="header"> <div id="branding" class="container"> <h1>The Finest Toy<br /> Store Online</h1> <p class="desc">If you're looking for a toy shop then look no further.<br/> Go on, treat the kids with our huge selection of<br/>online toy shops selling toys for all ages.</p> </div><!-- end branding --> <div id="navigation"> <ul id="menu" class="container"> <li><a href="#">HOME</a></li> <li><a href="#">ABOUT</a></li> <li><a href="#">Online Store</a></li> <li><a href="#">CONTACT</a></li> </ul> </div><!-- end navigation --> </div><!-- end header --> Shopping Cart Nintendo DS Xbox Product: Console £149.99 Console + Games £169.99 Quantity: Product: Console £149.99 Console + Games £169.99 Quantity:     Playstation 3 Wii Product: Console £149.99 Console + Games £169.99 Quantity:   Product: Console £149.99 Console + Games £169.99 Quantity:        <input type="submit" value="Add to cart" name="submit" onClick="cart()";/><input , type="reset" value="Reset" name="reset" Copyright © 2010 shopping cart. Content and Header © |Back to top Do I need to show my CSS as well? (Sorry about the coding its not working properly for me, its not showing up the way it should be)

    Read the article

  • django modeling

    - by SledgehammerPL
    Concept: Drinks are made of components. E.g. 10ml of Vodka. In some receipt the component is very particular (10ml of Finlandia Vodka), some not (10 ml of ANY Vodka). I wonder how to model a component to solve this problem - on stock I have particular product, which can satisfy more requirements. The model for now is: class Receipt(models.Model): name = models.CharField(max_length=128) (...) components = models.ManyToManyField(Product, through='ReceiptComponent') def __unicode__(self): return self.name class ReceiptComponent(models.Model): product = models.ForeignKey(Product) receipt = models.ForeignKey(Receipt) quantity = models.FloatField(max_length=9) unit = models.ForeignKey(Unit) class Admin: pass def __unicode__(self): return unicode(self.quantity!=0 and self.quantity or '') + ' ' + unicode(self.unit) + ' ' + self.product.genitive class Product(models.Model): name = models.CharField(max_length = 128) (...) class Admin: pass def __unicode__(self): return self.name class Stock(Store): products = models.ManyToManyField(Product) class Admin: pass def __unicode__(self): return self.name I think about making some table which joins real product (on stock) with abstract product (receiptcomponent). But maybe there's easy solution?

    Read the article

  • django access to parent

    - by SledgehammerPL
    model: class Product(models.Model): name = models.CharField(max_length = 128) (...) def __unicode__(self): return self.name class Receipt(models.Model): name = models.CharField(max_length=128) (...) components = models.ManyToManyField(Product, through='ReceiptComponent') def __unicode__(self): return self.name class ReceiptComponent(models.Model): product = models.ForeignKey(Product) receipt = models.ForeignKey(Receipt) quantity = models.FloatField(max_length=9) unit = models.ForeignKey(Unit) def __unicode__(self): return unicode(self.quantity!=0 and self.quantity or '') + ' ' + unicode(self.unit) + ' ' + self.product.genitive And now I'd like to get list of the most often useable products: ReceiptComponent.objects.values('product').annotate(Count('product')).order_by('-product__count' the example result: [{'product': 3, 'product__count': 5}, {'product': 6, 'product__count': 4}, {'product': 5, 'product__count': 3}, {'product': 7, 'product__count': 2}, {'product': 1, 'product__count': 2}, {'product': 11, 'product__count': 1}, {'product': 8, 'product__count': 1}, {'product': 4, 'product__count': 1}, {'product': 9, 'product__count': 1}] It's almost what I need. But I'd prefer having Product object not product value, because I'd like to use this in views.py for generating list.

    Read the article

  • how to request collection of fields in mvc

    - by frosty
    i have the following foreach. Inside you'll see a text box for quantity. At the bottom of the page there is submit button. What is the best practise for saving a collection of fields like this in asp.net MVC. ie how would i get the values in my controller <% foreach(var item in Model.Results) { %> <tr class="RowStyle"> <td><input name="quantity" value="<%= item.Quantity %>" class"input-30" /></td> </tr> <% } %>

    Read the article

  • C++ code generation for repeted task

    - by sateesh
    Hi, I have something like below which will get repeated many times based on the function that get called for e.g acceptfunction() { inserter["quantity"] = sdd.getfloat(quantity); inserter["prodtype"] = sdd.getstring(prodtype); : : so on } Like accept above there are 20 more functions(reject,cancel etc) which will do the similar thing.But the parameteres they insert can differ based on function called. How can I automate this kind of code.So that I dont need to write new function from scratch.Basically what I need is if i provide parametres like ("quantity",prodtype) through some text file or xml, it should generate the required function with the input parametres. Is this task can be handled through C++ tempalte Meta programming or someother code generation tool will help me to do this?

    Read the article

  • Easiest way to submit data via PHP?

    - by Abijah
    I'm new to PHP, and have spent 10 hours trying to figure this problem out. The goal is to take all data entered into this order form, and send it to my email via PHP. I have 2 questions: 1. I can get PHP to send data from a single menu item (example: Mexican Tortas), but how do I get PHP to send data from multiple items (example: Mexican Tortas, Fish Sandwich and Hamburger)? 2. How do I tell PHP to not send data from menu items that don't have the "How Many?" or "Customize It?" text fields filled out? If you could provide a super simple example (or a link to a learning resource) I would really appreciate it. Thank you, Abijah PHP <?php if(isset($_POST['submit'])) { $to = "[email protected]"; $subject = "New Order"; $name_field = $_POST['name']; $phone_field = $_POST['phone']; $item = $_POST['item']; $quantity = $_POST['quantity']; $customize = $_POST['customize']; } $body = "Name: $name_field\nPhone: $phone_field\n\nItem: $item\nQuantity: $quantity\nCustomize: $customize"; echo "Data has been submitted to $to!"; mail($to, $subject, $body); ?> HTML <form action="neworder.php" method="POST"> <div class ="item"> <img style="float:left; margin-right:15px; border:1px Solid #000; width:200px; height:155px;" src="images/mexicantortas.jpg"> <h1>Mexican Torta - $8.50</h1> <input name="item" type="hidden" value="Mexican Torta"/> <h2>How Many? <font color="#999999">Ex: 1, 2, 3...?</font></h2> <input name="quantity" type="text"/> <h3>Customize It? <font color="#999999">Ex: No Lettuce, Extra Cheese...</font></h3> <textarea name="customize"/></textarea> </div><!-- ITEM_LEFT --> <div class ="item"> <img style="float:left; margin-right:15px; border:1px Solid #000; width:200px; height:155px;" src="images/fishsandwich.jpg"> <h1>Fish Sandwich - $8.50</h1> <input name="item" type="hidden" value="Fish Sandwich"/> <h2>How Many? <font color="#999999">Ex: 1, 2, 3...?</font></h2> <input name="quantity" type="text"/> <h3>Customize It? <font color="#999999">Ex: No Lettuce, Extra Cheese...</font></h3> <textarea name="customize"/></textarea> </div><!-- ITEM_LEFT --> <div class ="item"> <img style="float:left; margin-right:15px; border:1px Solid #000; width:200px; height:155px;" src="images/hamburgers.jpg"> <h1>Hamburger w/ Fries - $7.00</h1> <input name="item" type="hidden" value="Fish Sandwich"/> <h2>How Many? <font color="#999999">Ex: 1, 2, 3...?</font></h2> <input name="quantity" type="text"/> <h3>Customize It? <font color="#999999">Ex: No Lettuce, Extra Cheese...</font></h3> <textarea name="customize"/></textarea> </div><!-- ITEM_LEFT --> <div class="horizontal_form"> <div class="form"> <h2>Place Your Order Now: <font size="3"><font color="#037B41">Fill in the form below, and we'll call you when your food is ready to be picked up...</font></font></h2> <p class="name"> <input type="text" name="name" id="name" style="text-align:center;" onClick="this.value='';" value="Enter your name"/> </p> <p class="phone"> <input type="text" name="phone" id="phone" style="text-align:center;" onClick="this.value='';" value="Enter your phone #"/> </p> <p class="submit"> <input type="submit" value="Place Order" name="submit"/> </p> </div><!-- FORM --> </div><!-- HORIZONTAL_FORM --> </form>

    Read the article

  • How to display popup from code-behind in ASP.net ?

    - by user359706
    hello I wonder how it would be possible to launch a series of popups, containing a form, from code-behind. I possess a list of objects 'Products' and I wish I could change one property (quantity) of each "product". Here's how I build my list (normally I use a database). Private List<Product> listProduct; listProduits = new List<Product>(); Product objProduit_1 = new Produit; objProduct_1.ref = "001"; objProduct_1.article = "G900"; objProduct_1.quantity = 30; listProducts.Add(objProduct_1); ProductobjProduit_2 = new Product; objProduct_2.ref = "002"; objProduct_2.article = "G900"; objProduct_2.quantity = 35; listProduits.Add(objProduct_2); And I would like displayed popup one after one. Thank you in advance for your help

    Read the article

  • Class Design and Structure Online Web Store

    - by Phorce
    I hope I have asked this in the right forum. Basically, we're designing an Online Store and I am designing the class structure for ordering a product and want some clarification on what I have so far: So a customer comes, selects their product, chooses the quantity and selects 'Purchase' (I am using the Facade Pattern - So subsystems execute when this action is performed). My class structure: < Order > < Product > <Customer > There is no inheritance, more Association < Order has < Product , < Customer has < Order . Does this structure look ok? I've noticed that I don't handle the "Quantity" separately, I was just going to add this into the "Product" class, but, do you think it should be a class of it's own? Hope someone can help.

    Read the article

  • Self-Executing Anonymous Function vs Prototype

    - by Robotsushi
    In Javascript there are a few clearly prominent techniques for create and manage classes/namespaces in javascript. I am curious what situations warrant using one technique vs. the other. I want to pick one and stick with it moving forward. I write enterprise code that is maintained and shared across multiple teams, and I want to know what is the best practice when writing maintainable javascript ? I tend to prefer Self-Executing Anonymous Functions however I am curious what the community vote is on these techniques. Prototype : function obj() { } obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test(); Self-Closing Anonymous Function : //Self-Executing Anonymous Function (function( skillet, $, undefined ) { //Private Property var isHot = true; //Public Property skillet.ingredient = "Bacon Strips"; //Public Method skillet.fry = function() { var oliveOil; addItem( "\t\n Butter \n\t" ); addItem( oliveOil ); console.log( "Frying " + skillet.ingredient ); }; //Private Method function addItem( item ) { if ( item !== undefined ) { console.log( "Adding " + $.trim(item) ); } } }( window.skillet = window.skillet || {}, jQuery )); //Public Properties console.log( skillet.ingredient ); //Bacon Strips //Public Methods skillet.fry(); //Adding Butter & Fraying Bacon Strips //Adding a Public Property skillet.quantity = "12"; console.log( skillet.quantity ); //12 //Adding New Functionality to the Skillet (function( skillet, $, undefined ) { //Private Property var amountOfGrease = "1 Cup"; //Public Method skillet.toString = function() { console.log( skillet.quantity + " " + skillet.ingredient + " & " + amountOfGrease + " of Grease" ); console.log( isHot ? "Hot" : "Cold" ); }; }( window.skillet = window.skillet || {}, jQuery )); //end of skillet definition try { //12 Bacon Strips & 1 Cup of Grease skillet.toString(); //Throws Exception } catch( e ) { console.log( e.message ); //isHot is not defined } I feel that I should mention that the Self-Executing Anonymous Function is the pattern used by the jQuery team. Update When I asked this question I didn't truly see the importance of what I was trying to understand. The real issue at hand is whether or not to use new to create instances of your objects or to use patterns which do not require constructors of the use of the new keyword. I added my own answer, because in my opinion we should make use of patterns which don't use the new keyword. For more information please see my answer.

    Read the article

  • The Com.PASS Feeds

    A new set of RSS feeds, hosted by PASS, bring you a large quantity of SQL Server content from various sites, including SQLServerCentral.

    Read the article

  • How to make a table structure for products to be available for both wholesale and retail?

    - by kmy
    Ignoring the different column details like colors, shapes, and sizes, I already have an idea of dealing with that, I'm more interested in dealing with retail pricing, whole pricing (with or without a table), and possibly discount. If anything, I want to know what I should also take account for. Will it just be adding a quantity column, two pricing cols, and two discount columns, and a quantity limit? If I were to add a pricing table it would be inserted as a json file, would this be a bad idea? Please give any insight about this.

    Read the article

  • How do I make these inputs relate to each other?

    - by dmanexe
    I have a series of checkbox inputs and corresponding text area inputs to allow specification of quantity. Here's what the two fields look like when the item is static (i.e. only 1): <input type="checkbox" name="measure[checked][]" value="<?=$item->id?>"> <input type="hidden" name="measure[quantity][]" value="1" /> Here's what the input fields look like for all items that have a specifiable quantity: <input type="checkbox" name="measure[checked][]" value="<?=$item->id?>"> <input class="item_mult" value="0" type="text" name="measure[quantity][]" /> This would play nicely, if within the array, it didn't output like this, after collecting it with: $field = $this->input->post('measure',true); Array ( [quantity] => Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 1 [4] => 1 [5] => 1 [6] => 25 [7] => 0 [8] => 0 [9] => 0 [10] => 1 [11] => 1 [12] => 1 [13] => 1 [14] => 1 [15] => 1 [16] => 1 [17] => 1 [18] => 1 [19] => 1 [20] => 1 [21] => 1 [22] => 0 [23] => 0 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => 0 [29] => 0 [30] => 0 [31] => 0 [32] => 0 [33] => 0 [34] => 0 [35] => 0 [36] => 0 [37] => 0 [38] => 0 [39] => 0 [40] => 0 [41] => 1 [42] => 1 [43] => 1 [44] => 1 [45] => 1 [46] => 1 [47] => 1 [48] => 1 [49] => 1 [50] => 1 [51] => 1 [52] => 0 [53] => 0 [54] => 0 ) [checked] => Array ( [0] => 4 [1] => 6 [2] => 13 ) ) I understand what the values in the checked array are, I just do not understand how to relate the first field to the second, later in the program. How do I incorporate the correct code to relate checked items to quantities?

    Read the article

  • amazon mws orders help simplify, flatten xml

    - by Scott Kramer
    XDocument doc = XDocument.Load( filename ); var ele = doc.Elements("AmazonEnvelope") //.Elements("Header") .Elements("Message") .Elements("OrderReport") .Elements("Item") .Select(element => new { AmazonOrderItemCode = (string)element.Element("AmazonOrderItemCode"), SKU = (string)element.Element("SKU"), Title = (string)element.Element("Title"), Quantity = (string)element.Element("Quantity"), }) //.Elements("ItemPrice") //.Elements("Component") //.Select(element => new //{ // Type = (string)element.Element("Type"), // Amount = (string)element.Element("Amount"), // }) .ToList(); foreach (var x in ele) { Console.WriteLine(x.ToString()); }

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >