Beispiel #1
0
        void CreateOrderLines(ProductionOrderClient productionOrder)
        {
            CWProductionOrderLine dialog = new CWProductionOrderLine(api);

            dialog.Closing += async delegate
            {
                if (dialog.DialogResult == true)
                {
                    var prodAPI = new ProductionAPI(api);
                    var result  = await prodAPI.CreateProductionLines(productionOrder, (StorageRegister)dialog.storage);

                    UtilDisplay.ShowErrorCode(result);
                    //else
                    //    CreditorOrders.ShowOrderLines(4, productionOrder, this, dgProductionOrders);
                }
            };
            dialog.Show();
        }
        void CreateOrderLines(ProductionOrderClient productionOrder)
        {
            CWProductionOrderLine dialog = new CWProductionOrderLine(productionOrder, api, false, null);

#if !SILVERLIGHT
            dialog.DialogTableId = 2000000078;
#endif
            dialog.Closing += async delegate
            {
                if (dialog.DialogResult == true)
                {
                    var prodAPI = new ProductionAPI(api);
                    var result  = await prodAPI.CreateProductionLines(productionOrder, (StorageRegister)dialog.Storage, dialog.Force, dialog.ProductionTime);

                    UtilDisplay.ShowErrorCode(result);
                    //else
                    //    CreditorOrders.ShowOrderLines(4, productionOrder, this, dgProductionOrders);
                }
            };
            dialog.Show();
        }
        async void UpdateLines(ProductionOrderClient productionOrder, StorageRegister Storage, bool OverwriteLines, bool goToLines, int prodTime = 0)
        {
            var prodAPI = new ProductionAPI(api);
            var result  = await prodAPI.CreateProductionLines(productionOrder, Storage, OverwriteLines, prodTime);

            if (result == ErrorCodes.Succes)
            {
                prodQty = productionOrder._ProdQty;
                if (goToLines)
                {
                    GoToLines(productionOrder);
                }
            }
            else
            {
                if (productionOrder.RowId != 0)
                {
                    productionOrder.ProdQty = prodQty;
                    api.UpdateNoResponse(productionOrder);
                }
                UtilDisplay.ShowErrorCode(result);
            }
        }