Exemplo n.º 1
0
        private void ExecuteTakeMaterialToClaimCommand(RemainMaterial matinfo)
        {
            //обозначим материал
            ((DepartmentOrderSpecifacation)Claim.DepartmentOrder.DepartmentOrderSpecifacation[0]).NomenclatureNumber =
                matinfo.Parent.NOMMODIF.NomenclatureNumber;
            ((DepartmentOrderSpecifacation)Claim.DepartmentOrder.DepartmentOrderSpecifacation[0]).NOMMODIF =
                matinfo.Parent.NOMMODIF;
            ((DepartmentOrderSpecifacation)Claim.DepartmentOrder.DepartmentOrderSpecifacation[0]).DICMUNT =
                matinfo.Parent.NOMMODIF.NomenclatureNumber.DICMUNT_UMEAS_MAIN;
            var gs = new GOODSSUPPLY();

            foreach (GOODSSUPPLY item in matinfo.Parent.GOODSSUPPLIES)
            {
                if (item.RN == matinfo.RN)
                {
                    gs = item;
                    break;
                }
            }

            ((DepartmentOrderSpecifacation)Claim.DepartmentOrder.DepartmentOrderSpecifacation[0])
            .StoreGasStationOilDepot = gs.StoreGasStationOilDepot;

            Claim.DepartmentOrder.StoreGasStationOilDepot = gs.StoreGasStationOilDepot;

            FillClaimByNnCommand.Execute();
        }
Exemplo n.º 2
0
        private void ExecuteGiveOutMaterialToClaimCommand(RemainMaterial remainMaterial)
        {
            if (Claim.ALLOWQUANT < (Claim.ISSUEDQUANT + remainMaterial.Gift))
            {
                if (MessageBox.Show(
                        "Внимание итоговое количество выданного материала (" +
                        (Claim.ISSUEDQUANT + remainMaterial.Gift).ToString(CultureInfo.InvariantCulture) + "" +
                        ((DepartmentOrderSpecifacation)Claim.DepartmentOrder.DepartmentOrderSpecifacation[0])
                        .NomenclatureNumber.DICMUNT_UMEAS_MAIN.MEASMNEMO + ") превышает количество завизированного (" +
                        Claim.ALLOWQUANT + "" +
                        ((DepartmentOrderSpecifacation)Claim.DepartmentOrder.DepartmentOrderSpecifacation[0])
                        .NomenclatureNumber.DICMUNT_UMEAS_MAIN.MEASMNEMO +
                        ")." + Environment.NewLine + "Продолжить?", "ВНИМАНИЕ", MessageBoxButton.YesNo,
                        MessageBoxImage.Warning) == MessageBoxResult.No)
                {
                    return;
                }
            }

            GOODSPARTY goodsparty = remainMaterial.Parent;
            var        goodssuply = new GOODSSUPPLY();

            foreach (
                GOODSSUPPLY g in
                from object item in goodsparty.GOODSSUPPLIES
                select item as GOODSSUPPLY
                into g
                where g.RN == remainMaterial.RN
                select g)
            {
                goodssuply = g;
            }

            var tranceindept = new InvoiceForTransmissionInUnit
            {
                StoreGasStationOilDepot_STORE     = goodssuply.StoreGasStationOilDepot,
                InvoiceForTransmissionInUnitSPECs = new List <InvoiceForTransmissionInUnitSPEC>
                {
                    new InvoiceForTransmissionInUnitSPEC
                    {
                        GOODSPARTY = goodsparty,
                        QUANT      = remainMaterial.Gift,
                        NOMMODIF   = goodsparty.NOMMODIF
                    }
                },
                FACEACC = new FACEACC {
                    NUMB = remainMaterial.FACEACCENUMBER
                },
                KindOfWarehouseOperations_STOPER =
                    new KindOfWarehouseOperations {
                    GSMWAYSMNEMO = remainMaterial.OperationNumber
                }
            };

            IsBusy = true;
            Observable.ToAsync(() => tranceindept = _visingCore.SaveTran(tranceindept, Claim)
                               )()
            .ObserveOnDispatcher()
            .Subscribe(x =>
            {
                IsBusy = false;
                if (tranceindept.RN != 0)
                {
                    Claim = _visingCore.RecalculationIssuedQuant(Claim);


                    if (TransInvDepListRNs.RNs == null)
                    {
                        TransInvDepListRNs.RNs = new ObservableCollection <long> {
                            tranceindept.RN
                        };
                    }

                    OnClaimChanged(new ClaimChangedMessage
                    {
                        Action  = ClaimChangedMessage.GiveOutMaterial,
                        Caption = "Выдача материала",
                        Claim   = Claim,
                        Message = "Расходная накладная №" + tranceindept.PREF + "-" + tranceindept.NUMB
                    });
                }
            });
        }