void CreateOrderLines(ProductionOrderClient productionOrder)
        {
            CWProductionOrderLine dialog = new CWProductionOrderLine(productionOrder, api, rowId == 0);

#if !SILVERLIGHT
            dialog.DialogTableId = 2000000077;
#endif
            dialog.Closed += async delegate
            {
                if (dialog.DialogResult == true)
                {
                    var result = await Save();

                    if (result)
                    {
                        if (dialog.DeliveryDate != DateTime.MinValue)
                        {
                            productionOrder._DeliveryDate = dialog.DeliveryDate;
                        }
                        UpdateLines(productionOrder, (StorageRegister)dialog.Storage, dialog.Force, true, dialog.ProductionTime);
                    }
                }
            };
            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();
        }
예제 #3
0
        private void CreateProdcution(ProductionPostedClient fromProductionPosted)
        {
            var prodOrder = new ProductionOrderClient()
            {
                _ProdItem = fromProductionPosted._Item, _ProdQty = fromProductionPosted._Qty
            };
            var cwProductionOrderLine = new CWProductionOrderLine(prodOrder, api, true, Uniconta.ClientTools.Localization.lookup("ProductionOrder"));

#if !SILVERLIGHT
            cwProductionOrderLine.DialogTableId = 2000000079;
#endif
            cwProductionOrderLine.Closed += async delegate
            {
                if (cwProductionOrderLine.DialogResult == true)
                {
                    prodOrder._DeliveryDate = cwProductionOrderLine.DeliveryDate;
                    var prodApi = new ProductionAPI(api);
                    var result  = await prodApi.CreateProductionFromProduction(fromProductionPosted, prodOrder, cwProductionOrderLine.quantity, (StorageRegister)cwProductionOrderLine.Storage);

                    if (result != ErrorCodes.Succes)
                    {
                        Uniconta.ClientTools.Util.UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
#if !SILVERLIGHT
                        if (UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("GoTo"), Uniconta.ClientTools.Localization.lookup("ProductionLines")),
                                                    Uniconta.ClientTools.Localization.lookup("Message"), MessageBoxButton.YesNo) == MessageBoxResult.Yes)
#elif SILVERLIGHT
                        if (UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("GoTo"), Uniconta.ClientTools.Localization.lookup("ProductionLines")),
                                                    Uniconta.ClientTools.Localization.lookup("Message"), MessageBoxButton.OKCancel) == MessageBoxResult.OK)
#endif
                        { AddDockItem(TabControls.ProductionOrderLines, prodOrder); }
                    }
                }
            };
            cwProductionOrderLine.Show();
        }