Beispiel #1
0
        protected override bool Execute(CodeActivityContext context)
        {
            SectionIntegralComplexResults Res;

            try
            {
                //TODO часовой пояс
                Res = ARM_Service.SIA_GetSectionIntegralActExcelDocumentWithATSCode(
                    SectionID.Get(context),
                    StartDateTime.Get(context),
                    DataSourceType,
                    DiscreteType,
                    IsPower,
                    IsEnabledRChannel,
                    BusRelation,
                    IsAllocateCA,
                    IsOffsetFromMoscowEnbledForDrums,
                    IsFilterPSEnabled,
                    IsReadCalculatedValues,
                    IsClosedPeriod, null);

                if (Res.Document != null)
                {
                    Res.Document.Position = 0;
                    MemoryStream ms = CompressUtility.DecompressGZip(Res.Document);
                    ms.Position = 0;
                    Document.Set(context, ms);
                }

                if (Res.Errors != null)
                {
                    Error.Set(context, Res.Errors.ToString());
                }
            }

            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }
            return(string.IsNullOrEmpty(Error.Get(context)));
        }
Beispiel #2
0
        protected override bool Execute(CodeActivityContext context)
        {
            SectionIntegralResults Res;

            try
            {
                Res = ARM_Service.SIA_GetFlowBalanceReport(
                    SectionID.Get(context),
                    TExportExcelAdapterType.toXLS,
                    StartDateTime.Get(context),
                    DataSourceType,
                    BusRelation,
                    true,
                    false, null, true, true, null);

                if (Res.CompressedDoc != null)
                {
                    Res.CompressedDoc.Position = 0;
                    MemoryStream ms = CompressUtility.DecompressGZip(Res.CompressedDoc);
                    ms.Position = 0;
                    Document.Set(context, ms);
                }

                if (Res.Errors != null)
                {
                    Error.Set(context, Res.Errors.ToString());
                }
            }

            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }
            return(string.IsNullOrEmpty(Error.Get(context)));
        }
        protected override bool Execute(CodeActivityContext context)
        {
            int            id         = SectionID.Get(context);
            DateTimeOffset _EventDate = EventDate.Get(context);
            bool           roundData  = RoundData.Get(context);

            try
            {
                XMLATSExportSingleObjectResult Res = ARM_Service.XMLExportGetSection80020(_EventDate, id, DataSourceType, BusRelation, TimeZoneId, roundData, false, false, true, false, false, 1, true);
                Document.Set(context, Res.XMLStream);
            }

            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }

            return(string.IsNullOrEmpty(Error.Get(context)));
        }