- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
for (int i = 0; i < gvOrderMain.RowCount - EditIndex; i++)
{
float tempQuantity = GetRow(i).Quantity;
int partyLen = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray().Length;
for (int j = 0; j < partyLen; j++)
{
if (DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity > 0)
{
float CurSQuantity = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity.Value;
if (tempQuantity > CurSQuantity)
{
Documents_Product dp = new Documents_Product();
dp.PrimePriceExcVAT = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].PrimePriceExcVAT;
dp.PrimePriceIncVAT = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].PrimePriceIncVAT;
dp.Quantity = -1 * DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity;
dp.OldQuantity = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity;
dp.PartyNumber = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].PartyNumber;
DB.Documents_Products.InsertOnSubmit(dp);
DB.SubmitChanges();
Documents_ProductsOrder dro = new Documents_ProductsOrder();
dro.PriceSum = GetRow(i).RealPrice * DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity;
tempQuantity = tempQuantity - DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity.Value;
DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity = 0;
DB.Documents_ProductsOrders.InsertOnSubmit(dro);
DB.SubmitChanges();
..........
DenDL 11.08.2009 15:36 # +1
Rudolf_Abel 11.08.2009 16:02 # 0
programma Enreprice urovnia... :D
i v Table bole 100000 row...
i avtor etogo koda udevlialsia... pochemu forma rabotaet medlenno :D
guest 11.08.2009 21:06 # +1
пъянь 14.08.2009 02:29 # 0
inkanus-gray 24.05.2016 23:22 # 0