Example #1
0
        protected override bool Execute(CodeActivityContext context)
        {
            DateTime dt = new DateTime(Year.Get(context), Month.Get(context), 1);

            try
            {
                ID_TypeHierarchy idHierarchy = new ID_TypeHierarchy();
                idHierarchy.ID            = ID.Get(context);
                idHierarchy.TypeHierarchy = HierarchyType;

                SectionIntegralComplexResults result =
                    ARM_Service.GroupTP_GetActConsumptionPower(idHierarchy, GroupTPPowerReportMode, null,
                                                               TypeOfMeasuring, ExcelAdapterType, dt,
                                                               2, ".", IsReadCalculatedValues.Get(context), IncludeAllTI.Get(context), false, null, null, WcfTimeOut.Get(context));
                if (!string.IsNullOrEmpty(result.Errors.ToString()) && (result.Document == null || result.Document.Length == 0))
                {
                    Error.Set(context, result.Errors.ToString());
                }
                else
                {
                    SendEmail(context, CompressUtility.DecompressGZip(result.Document));
                }
            }
            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }

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