コード例 #1
0
        protected override void LongOperationProcess(WebEas.ServiceModel.Dto.LongOperationStartDtoBase request)
        {
            string operationParametersDecoded = Encoding.UTF8.GetString(Convert.FromBase64String(request.OperationParameters));

            if (Enum.TryParse(request.OperationName, out OperationsList operation))
            {
                switch (operation)
                {
                // Operacie
                case OperationsList.DoposlanieUhradDoDcomu:
                    //tu iba zneuzijem class na zistenie kodu polozky
                    DoposlanieUhrad(operationParametersDecoded.FromJson <ListComboDto>().KodPolozky, request.ProcessKey);
                    break;

                case OperationsList.SkontrolovatZauctovanie:
                    SkontrolujZauctovanie(operationParametersDecoded.FromJson <SkontrolovatZauctovanieDto>(), request.ProcessKey);;
                    break;

                case OperationsList.MigraciaPociatocnehoStavu:
                    MigraciaPociatocnehoStavu(operationParametersDecoded.FromJson <MigraciaStavovDto>(), request.ProcessKey);;
                    break;

                    //Zostavy
                }
            }
            else
            {
                throw new WebEasException($"Long operation with the name {request.OperationName} is not implemented", "Operácia nie je implementovaná!");
            }
        }
コード例 #2
0
        protected override void LongOperationProcess(WebEas.ServiceModel.Dto.LongOperationStartDtoBase request)
        {
            string operationParametersDecoded = Encoding.UTF8.GetString(Convert.FromBase64String(request.OperationParameters));
            string operationInfoDecoded       = Encoding.UTF8.GetString(Convert.FromBase64String(request.OperationInfo));

            if (Enum.TryParse(request.OperationName, out OperationsList operation))
            {
                SpracovatDokladDto par = operationParametersDecoded.FromJson <SpracovatDokladDto>();
                LongOperationInfo  inf = operationInfoDecoded.FromJson <LongOperationInfo>();
                switch (operation)
                {
                // Operacie
                case OperationsList.SpracovatDoklad:
                    GetVybavOdvybavDoklady(par.Ids, inf.Nazov == "Receipts");
                    //SpracujDoklad(par, request.ProcessKey, out string spracovatDokladReportId);
                    break;
                }
            }
            else
            {
                throw new WebEasException($"Long operation with the name {request.OperationName} is not implemented", "Operácia nie je implementovaná!");
            }
        }