battletoad
New Member
I have a list of objects (Invoices). these objects have a qty property.I have a product return form which has a qty for the product being returned.When the return line is submitted. I populate a gridview with the submitted line so another part can be entered if needed before submitting the entire returns form.When the line is submitted, I need the return qty to be subtracted from the invoiced qty in the object... I've done this using the following code...\[code\]returnInvoices[GridView3.SelectedIndex].OrderLineQty = returnInvoices[GridView3.SelectedIndex].OrderLineQty - Convert.ToDouble(txtReturnProdQty.Text, userCulture);\[/code\]\[code\]returnInvoices\[/code\] is a reference to the \[code\]List<Invoice>\[/code\] and \[code\]OrderLineQty\[/code\] is a \[code\]double\[/code\] datatype.I was just wondering if there's a better (tidier?) way of subtracting the invoiced qty?The reason for the subtraction if because if the invoiced line is greater than 1 but the part is serialized, the part must be entered one at a time, so I need the qty to decrease as they are added to the return form, so that they can't over return, if that makes sense!please be gentle... i'm new and still learning c#/OOP!thanks