Пример #1
0
 public bool SetProductQty1(int recordID, string keyColName, List <string> product, List <string> attribute, List <string> qty, List <string> oline_ID, List <string> locID, int LocToID, List <string> AssetID, int lineID, VAdvantage.Utility.Ctx ctx)
 {
     if (keyColName.ToUpper().Trim() == "M_MOVEMENT_ID")
     {
         MMovement inv = new MMovement(ctx, recordID, null);
         for (int i = 0; i < product.Count; i++)
         {
             MMovementLine invline = new MMovementLine(ctx, lineID, null);
             invline.SetAD_Client_ID(inv.GetAD_Client_ID());
             invline.SetAD_Org_ID(inv.GetAD_Org_ID());
             invline.SetM_Locator_ID(Util.GetValueOfInt(locID[i]));
             invline.SetM_LocatorTo_ID(LocToID);
             invline.SetM_Product_ID(Util.GetValueOfInt(product[i]));
             invline.SetMovementQty(Util.GetValueOfDecimal(qty[i]));
             invline.SetM_Movement_ID(recordID);
             if (Util.GetValueOfInt(AssetID[i]) > 0)
             {
                 invline.SetA_Asset_ID(Util.GetValueOfInt(AssetID[i]));
             }
             if (Util.GetValueOfInt(oline_ID[i]) > 0)
             {
                 invline.SetM_RequisitionLine_ID(Util.GetValueOfInt(oline_ID[i]));
             }
             if (Util.GetValueOfInt(attribute[i]) != 0)
             {
                 invline.SetM_AttributeSetInstance_ID(Util.GetValueOfInt(attribute[i]));
             }
             if (!invline.Save())
             {
             }
         }
     }
     else if (keyColName.ToUpper().Trim() == "M_INVENTORY_ID")
     {
         MInventory inv = new MInventory(ctx, recordID, null);
         for (int i = 0; i < product.Count; i++)
         {
             MInventoryLine invline = new MInventoryLine(ctx, lineID, null);
             invline.SetAD_Client_ID(inv.GetAD_Client_ID());
             invline.SetAD_Org_ID(inv.GetAD_Org_ID());
             invline.SetM_Product_ID(Util.GetValueOfInt(product[i]));
             invline.SetQtyInternalUse(Util.GetValueOfDecimal(qty[i]));
             invline.SetC_Charge_ID(Util.GetValueOfInt(AssetID[i]));
             invline.SetM_Inventory_ID(recordID);
             invline.SetIsInternalUse(true);
             invline.SetM_RequisitionLine_ID(Util.GetValueOfInt(oline_ID[i]));
             if (Util.GetValueOfInt(attribute[i]) != 0)
             {
                 invline.SetM_AttributeSetInstance_ID(Util.GetValueOfInt(attribute[i]));
             }
             else
             {
                 invline.SetM_AttributeSetInstance_ID(0);
             }
             if (!invline.Save())
             {
             }
         }
     }
     return(true);
 }