Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (ExternalCampaignNumber != null ? StringComparer.InvariantCulture.GetHashCode(ExternalCampaignNumber) : 0);
         hashCode = (hashCode * 397) ^ (SalesArea != null ? StringComparer.InvariantCulture.GetHashCode(SalesArea) : 0);
         hashCode = (hashCode * 397) ^ (GroupCode != null ? StringComparer.InvariantCulture.GetHashCode(GroupCode) : 0);
         hashCode = (hashCode * 397) ^ (ExternalSpotRef != null ? StringComparer.InvariantCulture.GetHashCode(ExternalSpotRef) : 0);
         hashCode = (hashCode * 397) ^ StartDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ EndDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ SpotLength.GetHashCode();
         hashCode = (hashCode * 397) ^ (BreakType != null ? StringComparer.InvariantCulture.GetHashCode(BreakType) : 0);
         hashCode = (hashCode * 397) ^ (Product != null ? StringComparer.InvariantCulture.GetHashCode(Product) : 0);
         hashCode = (hashCode * 397) ^ (Demographic != null ? StringComparer.InvariantCulture.GetHashCode(Demographic) : 0);
         hashCode = (hashCode * 397) ^ ClientPicked.GetHashCode();
         hashCode = (hashCode * 397) ^ (MultipartSpot != null ? StringComparer.InvariantCulture.GetHashCode(MultipartSpot) : 0);
         hashCode = (hashCode * 397) ^ (MultipartSpotPosition != null ? StringComparer.InvariantCulture.GetHashCode(MultipartSpotPosition) : 0);
         hashCode = (hashCode * 397) ^ (MultipartSpotRef != null ? StringComparer.InvariantCulture.GetHashCode(MultipartSpotRef) : 0);
         hashCode = (hashCode * 397) ^ (RequestedPositioninBreak != null ? StringComparer.InvariantCulture.GetHashCode(RequestedPositioninBreak) : 0);
         hashCode = (hashCode * 397) ^ (ActualPositioninBreak != null ? StringComparer.InvariantCulture.GetHashCode(ActualPositioninBreak) : 0);
         hashCode = (hashCode * 397) ^ (BreakRequest != null ? StringComparer.InvariantCulture.GetHashCode(BreakRequest) : 0);
         hashCode = (hashCode * 397) ^ (ExternalBreakNo != null ? StringComparer.InvariantCulture.GetHashCode(ExternalBreakNo) : 0);
         hashCode = (hashCode * 397) ^ Sponsored.GetHashCode();
         hashCode = (hashCode * 397) ^ Preemptable.GetHashCode();
         hashCode = (hashCode * 397) ^ Preemptlevel.GetHashCode();
         hashCode = (hashCode * 397) ^ (IndustryCode != null ? StringComparer.InvariantCulture.GetHashCode(IndustryCode) : 0);
         hashCode = (hashCode * 397) ^ (ClearanceCode != null ? StringComparer.InvariantCulture.GetHashCode(ClearanceCode) : 0);
         return(hashCode);
     }
 }
Esempio n. 2
0
        protected override bool Execute(CodeActivityContext context)
        {
            try
            {
                var res = ARM_Service.BPS_GetPSBalanceExcelDocument2(BalanceId.Get(context),
                                                                     StartDateTime.Get(context),
                                                                     EndDateTime.Get(context),
                                                                     DiscreteType,
                                                                     DataSourceType,
                                                                     isPower,
                                                                     isOffsetFromMoscowEnbledForDrums,
                                                                     IsPowerEquipmentEnabled, 7, null, false);
                if (res != null)
                {
                    var ms = new MemoryStream();
                    res.CopyTo(ms);
                    ms.Position = 0;
                    Document.Set(context, ms);
                }
            }

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

            return(string.IsNullOrEmpty(Error.Get(context)));
        }
Esempio n. 3
0
        protected override bool Execute(CodeActivityContext context)
        {
            int pId = PsId.Get(context);

            try
            {
                //TODO часовой пояс
                var res = ARM_Service.Monit_GetStatisticInformationByPs(pId,
                                                                        StartDateTime.Get(context),
                                                                        EndDateTime.Get(context),
                                                                        null, TIType.Get(context));

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

            return(string.IsNullOrEmpty(Error.Get(context)));
        }
Esempio n. 4
0
 protected bool Equals(Spot other)
 {
     return
         (string.Equals(ExternalCampaignNumber, other.ExternalCampaignNumber, StringComparison.InvariantCulture) &&
          string.Equals(SalesArea, other.SalesArea, StringComparison.InvariantCulture) &&
          string.Equals(GroupCode, other.GroupCode, StringComparison.InvariantCulture) &&
          string.Equals(ExternalSpotRef, other.ExternalSpotRef, StringComparison.InvariantCulture) &&
          StartDateTime.Equals(other.StartDateTime) &&
          EndDateTime.Equals(other.EndDateTime) &&
          SpotLength.Equals(other.SpotLength) &&
          string.Equals(BreakType, other.BreakType, StringComparison.InvariantCulture) &&
          string.Equals(Product, other.Product, StringComparison.InvariantCulture) &&
          string.Equals(Demographic, other.Demographic, StringComparison.InvariantCulture) &&
          ClientPicked == other.ClientPicked &&
          string.Equals(MultipartSpot, other.MultipartSpot, StringComparison.InvariantCulture) &&
          string.Equals(MultipartSpotPosition, other.MultipartSpotPosition, StringComparison.InvariantCulture) &&
          string.Equals(MultipartSpotRef, other.MultipartSpotRef, StringComparison.InvariantCulture) &&
          string.Equals(RequestedPositioninBreak, other.RequestedPositioninBreak, StringComparison.InvariantCulture) &&
          string.Equals(ActualPositioninBreak, other.ActualPositioninBreak, StringComparison.InvariantCulture) &&
          string.Equals(BreakRequest, other.BreakRequest, StringComparison.InvariantCulture) &&
          string.Equals(ExternalBreakNo, other.ExternalBreakNo, StringComparison.InvariantCulture) &&
          Sponsored == other.Sponsored &&
          Preemptable == other.Preemptable &&
          Preemptlevel == other.Preemptlevel &&
          string.Equals(IndustryCode, other.IndustryCode, StringComparison.InvariantCulture) &&
          string.Equals(ClearanceCode, other.ClearanceCode, StringComparison.InvariantCulture));
 }
        protected override bool Execute(CodeActivityContext context)
        {
            try
            {
                var res = ARM_Service.BL_GetFreeHierarchyBalanceResult(BalanceFreeHierarchyUNs.Get(context),
                                                                       StartDateTime.Get(context),
                                                                       EndDateTime.Get(context),
                                                                       TimeZoneId, TExportExcelAdapterType.toXLSx, false,
                                                                       DiscreteType, UnitDigit, false, UnitDigit, false, false, 0, 0, false, false, false);

                if (res != null && res.CalculatedValues != null)
                {
                    Balances.Set(context, res.CalculatedValues.Values.ToList());

                    if (res.Errors != null && res.Errors.Length > 0)
                    {
                        Errors.Set(context, res.Errors.ToString());
                    }
                }
            }

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

            return(string.IsNullOrEmpty(Errors.Get(context)));
        }
Esempio n. 6
0
 public void OnDeserialized(StreamingContext context)
 {
     Initialize();
     PlayTo        = Duration;
     StartDateTime = DateTimeHelper.ZeroTime;
     endDateTime   = StartDateTime.Add(Duration);
 }
Esempio n. 7
0
        public bool Equals(ECGData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(StartDateTime.EqualsUpToMilliseconds(other.StartDateTime) &&
                   EndDateTime.EqualsUpToMilliseconds(other.EndDateTime) &&
                   SamplingRate == other.SamplingRate &&


                   UnfilteredSignal.Rank == other.UnfilteredSignal.Rank &&
                   Enumerable.Range(0, UnfilteredSignal.Rank).All(dimension =>
                                                                  UnfilteredSignal.GetLength(dimension) == other.UnfilteredSignal.GetLength(dimension)) &&
                   UnfilteredSignal.Cast <double>().SequenceEqual(other.UnfilteredSignal.Cast <double>()) &&

                   FilteredSignal.Rank == other.FilteredSignal.Rank &&
                   Enumerable.Range(0, FilteredSignal.Rank).All(dimension =>
                                                                FilteredSignal.GetLength(dimension) == other.FilteredSignal.GetLength(dimension)) &&
                   FilteredSignal.Cast <double>().SequenceEqual(other.FilteredSignal.Cast <double>()) &&
                   Timestamps.Rank == other.Timestamps.Rank &&
                   Enumerable.Range(0, Timestamps.Rank).All(dimension =>
                                                            Timestamps.GetLength(dimension) == other.Timestamps.GetLength(dimension)) &&
                   Timestamps.Cast <long>().SequenceEqual(other.Timestamps.Cast <long>()));
        }
Esempio n. 8
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            if (!DidAttend.HasValue)
            {
                return(string.Empty);
            }

            var sb = new StringBuilder();

            sb.Append((PersonAlias?.Person != null) ? PersonAlias.Person.ToStringSafe() + " " : string.Empty);

            string verb = "attended";

            if (this.DidAttend != true)
            {
                verb = "did not attend";

                if (this.ScheduledToAttend == true)
                {
                    verb = "is scheduled to attend";
                }
                else if (this.RequestedToAttend == true)
                {
                    verb = "has been requested to attend";
                }
                else if (this.DeclineReasonValueId.HasValue)
                {
                    verb = "has declined to attend";
                }
                else
                {
                    verb = "did not attend";
                }
            }
            else
            {
                verb = "attended";
            }

            sb.Append($"{verb} ");

            sb.Append(Occurrence?.Group?.ToStringSafe());
            if (DidAttend.Value)
            {
                sb.AppendFormat(" on {0} at {1}", StartDateTime.ToShortDateString(), StartDateTime.ToShortTimeString());

                var end = EndDateTime ?? Occurrence?.OccurrenceDate;
                if (end.HasValue)
                {
                    sb.AppendFormat(" until {0} at {1}", end.Value.ToShortDateString(), end.Value.ToShortTimeString());
                }
            }

            if (Occurrence?.Location != null)
            {
                sb.Append(" in " + Occurrence.Location.ToStringSafe());
            }

            return(sb.ToString().Trim());
        }
Esempio n. 9
0
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (HasCreationDateTime)
                    {
                        hash ^= CreationDateTime.GetHashCode();
                    }
                    if (HasStartDateTime)
                    {
                        hash ^= StartDateTime.GetHashCode();
                    }
                    if (HasCompletionDateTime)
                    {
                        hash ^= CompletionDateTime.GetHashCode();
                    }
                    if (HasEstimatedCompletionRatio)
                    {
                        hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(EstimatedCompletionRatio);
                    }
                    if (HasOperationCount)
                    {
                        hash ^= OperationCount.GetHashCode();
                    }
                    if (HasExecutedOperationCount)
                    {
                        hash ^= ExecutedOperationCount.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        hash ^= _unknownFields.GetHashCode();
                    }
                    return(hash);
                }
Esempio n. 10
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            if (!DidAttend.HasValue)
            {
                return(string.Empty);
            }

            var sb = new StringBuilder();

            sb.Append((PersonAlias?.Person != null) ? PersonAlias.Person.ToStringSafe() + " " : "");
            sb.Append(DidAttend.Value ? "attended " : "did not attend ");
            sb.Append(Occurrence?.Group?.ToStringSafe());
            if (DidAttend.Value)
            {
                sb.AppendFormat("on {0} at {1} ", StartDateTime.ToShortDateString(), StartDateTime.ToShortTimeString());

                var end = EndDateTime ?? Occurrence?.OccurrenceDate;
                if (end.HasValue)
                {
                    sb.AppendFormat("until {0} at {1} ", end.Value.ToShortDateString(), end.Value.ToShortTimeString());
                }
            }

            if (Occurrence?.Location != null)
            {
                sb.Append("in " + Occurrence.Location.ToStringSafe());
            }

            return(sb.ToString().Trim());
        }
Esempio n. 11
0
        private void PutReportToFtp(CodeActivityContext context, int?psId)
        {
            try
            {
                var repF = ARM_Service.REP_Export_ReportObjectClass(User_ID, ReportFormat, Report_id.Get(context), null,
                                                                    HierLev1_ID.Get(context),
                                                                    HierLev2_ID.Get(context),
                                                                    HierLev3_ID.Get(context),
                                                                    psId, JuridicalPerson_ID.Get(context),
                                                                    StartDateTime.Get(context), EndDateTime.Get(context), null, WcfTimeOut.Get(context));

                var doc = LargeData.DownloadData(repF.Key);


                if (!string.IsNullOrEmpty(repF.Value.Error))
                {
                    Error.Set(context, repF.Value.Error);
                }
                else
                {
                    //var fs = new FileStream("C:\\777\\1\\rep_"+p.PS_ID.ToString()+".xls", FileMode.Create, FileAccess.Write);
                    //DataReport.Document.CopyTo(fs);
                    //fs.Close();
                    PutReportToFtp(context, doc);
                }
            }
            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }
        }
Esempio n. 12
0
        private void CaseDataQuery(int page)
        {
            string _   = String.Format(numlimt, (page - 1) * onepagecount, (page) * onepagecount);
            String str = String.Format(DataGridsqltunnel(DataGridsql), StartDateTime.ToString(), EndDateTime.AddSeconds(86399).ToString(), _);

            dataTable            = DB.Query(str);
            DataView.ItemsSource = dataTable.DefaultView;
            pagestate.Content    = page + "/" + pagecount;
        }
Esempio n. 13
0
        private void CaseDataQuery()
        {
            String str = String.Format(DataGridsqltunnel(DataGridsql), StartDateTime.ToString(), EndDateTime.AddSeconds(86399).ToString(), "");

            dataTable = DB.Query(str);
            pagecount = (int)Math.Ceiling((float)(dataTable.Rows.Count) / 50);
            CaseDataQuery(page);
            checkpagebtn();
        }
Esempio n. 14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="lastRunTime">Will be converted to the passed-in TimeZoneInfo's local time if Kind is UTC.</param>
        /// <param name="dockedTime">The time the instrument was docked; if more recent than the last run, and if On Docking is true, this time is returned</param>
        /// <param name="tzi">The docking station's local time zone setting.</param>
        /// <returns></returns>
        public override DateTime CalculateNextRunTime(DateTime lastRunTime, DateTime dockedTime, TimeZoneInfo tzi)
        {
            if (lastRunTime.Kind == DateTimeKind.Utc)
            {
                lastRunTime = tzi.ToLocalTime(lastRunTime);
            }

            if (UponDocking)
            {
                // The schedule has been specified to allow for the event to be run upon docking.
                // If the docked time is more recent than the journal run time, return the docked time to run the event.
                if (dockedTime.Kind == DateTimeKind.Utc)
                {
                    dockedTime = tzi.ToLocalTime(dockedTime);
                }
                Log.Trace("ScheduledHourly: uponDocking = true; last run time=" + lastRunTime.ToShortDateString() + ", dockedTime=" + dockedTime.ToShortDateString());
                if (lastRunTime < dockedTime)
                {
                    return(dockedTime);
                }
            }

            Log.Trace("ScheduledHourly: start date time=" + StartDateTime.ToLongDateString() + " interval=" + Interval.ToString() + " days, last run time=" + lastRunTime.ToLongDateString() + ", docked time=" + dockedTime.ToShortDateString());

            // Not yet the StartDateTime? Then just return StartDateTime
            if (lastRunTime < StartDateTime)
            {
                return(GetNextRunDay(StartDateTime));
            }

            // SGF  5-Feb-2013  INS-3655 -- Corrected to begin checking for the next run time on the day prior to the last run,
            // and then advance the current time based on the interval defined for that event schedule. When a time has been
            // found that is later than the last run time, and that time occurs on a day that has been selected as a valid run day,
            // that time is returned to the caller.
            DateTime nextRunTime = new DateTime(lastRunTime.Date.Year, lastRunTime.Date.Month, lastRunTime.Date.Day, 0, 0, 0, DateTimeKind.Local);

            nextRunTime = nextRunTime.AddDays(-1);
            nextRunTime = nextRunTime.Add(RunAtTime);

            while (nextRunTime < lastRunTime)
            {
                nextRunTime = nextRunTime.AddHours(Interval);
                DayOfWeek nextRunDayOfWeek = (DayOfWeek)nextRunTime.DayOfWeek;
                if (!Days[(int)nextRunDayOfWeek])
                {
                    continue;
                }
                if (nextRunTime > lastRunTime)
                {
                    return(nextRunTime);
                }
            }

            // if we make it to here, then lastRunDate is in the future (?)

            return(DateTime.SpecifyKind(DateTime.MaxValue, DateTimeKind.Local));
        }
Esempio n. 15
0
        public bool Equals(EITEntry other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            var equal = Configuration == other.Configuration &&
                        StartDateTime.EqualsUpToMilliseconds(other.StartDateTime) &&
                        EndDateTime.EqualsUpToMilliseconds(other.EndDateTime) &&

                        VoltagesReal.Rank == other.VoltagesReal.Rank &&
                        Enumerable.Range(0, VoltagesReal.Rank).All(dimension =>
                                                                   VoltagesReal.GetLength(dimension) == other.VoltagesReal.GetLength(dimension)) &&
                        VoltagesReal.Cast <float>().SequenceEqual(other.VoltagesReal.Cast <float>()) &&

                        VoltagesIm.Rank == other.VoltagesIm.Rank &&
                        Enumerable.Range(0, VoltagesIm.Rank).All(dimension =>
                                                                 VoltagesIm.GetLength(dimension) == other.VoltagesIm.GetLength(dimension)) &&
                        VoltagesIm.Cast <float>().SequenceEqual(other.VoltagesIm.Cast <float>()) &&

                        CurrentsReal.Rank == other.CurrentsReal.Rank &&
                        Enumerable.Range(0, VoltagesIm.Rank).All(dimension =>
                                                                 CurrentsReal.GetLength(dimension) == other.CurrentsReal.GetLength(dimension)) &&
                        CurrentsReal.Cast <float>().SequenceEqual(other.CurrentsReal.Cast <float>()) &&

                        CurrentsIm.Rank == other.CurrentsIm.Rank &&
                        Enumerable.Range(0, CurrentsIm.Rank).All(dimension =>
                                                                 CurrentsIm.GetLength(dimension) == other.CurrentsIm.GetLength(dimension)) &&
                        CurrentsIm.Cast <float>().SequenceEqual(other.CurrentsIm.Cast <float>()) &&

                        Saturation.Rank == other.Saturation.Rank &&
                        Enumerable.Range(0, Saturation.Rank).All(dimension =>
                                                                 Saturation.GetLength(dimension) == other.Saturation.GetLength(dimension)) &&
                        Saturation.Cast <ulong>().SequenceEqual(other.Saturation.Cast <ulong>()) &&


                        Timestamps.Rank == other.Timestamps.Rank &&
                        Enumerable.Range(0, Timestamps.Rank).All(dimension =>
                                                                 Timestamps.GetLength(dimension) == other.Timestamps.GetLength(dimension)) &&
                        Timestamps.Cast <long>().SequenceEqual(other.Timestamps.Cast <long>());

            if (PacketIds != null && other.PacketIds != null)
            {
                equal = equal && PacketIds.Rank == other.PacketIds.Rank &&
                        Enumerable.Range(0, PacketIds.Rank).All(dimension =>
                                                                PacketIds.GetLength(dimension) == other.PacketIds.GetLength(dimension)) &&
                        PacketIds.Cast <ulong>().SequenceEqual(other.PacketIds.Cast <ulong>());
            }
            return(equal);
        }
Esempio n. 16
0
        /*
         * [Description("Строка ошибки")]
         * [DisplayName("Ошибка")]
         * public OutArgument<string> Error { get; set; }
         *
         * [RequiredArgument]
         * [Description("Уникальный номер отчета")]
         * [DisplayName("Идентификатор отчета")]
         * [Category("Отчет")]
         * public InArgument<string> Report_id { get; set; }
         *
         * [RequiredArgument]
         * [Description("Начальная дата отчета")]
         * [DisplayName("Начальная дата")]
         * [Category("Отчет")]
         * public InArgument<DateTime> StartDateTime { get; set; }
         *
         * [RequiredArgument]
         * [Description("Конечная дата отчета")]
         * [DisplayName("Конечная дата")]
         * [Category("Отчет")]
         * public InArgument<DateTime> EndDateTime { get; set; }
         *
         * [Description("Формат отчета")]
         * [DisplayName("Формат")]
         * [Category("Отчет")]
         * public ReportExportFormat ReportFormat { get; set; }
         *
         * //--------------------------------------------------------------
         * [RequiredArgument]
         * [Description("Адрес получателя")]
         * [DisplayName("Адресат")]
         * [Category("Электронная почта")]
         * public InArgument<string> To { get; set; }
         *
         * [RequiredArgument]
         * [Description("Адрес отправителя")]
         * [DisplayName("Отправитель")]
         * [Category("Электронная почта")]
         * public InArgument<string> From { get; set; }
         *
         * [RequiredArgument]
         * [Description("Тема письма")]
         * [DisplayName("Тема")]
         * [Category("Электронная почта")]
         * public InArgument<string> Subject { get; set; }
         *
         * [DisplayName("Тело письма")]
         * [Category("Электронная почта")]
         * public InArgument<string> Body { get; set; }
         *
         * [RequiredArgument]
         * [DefaultValue(25)]
         * [DisplayName("Порт")]
         * [Category("Электронная почта")]
         * public int Port { get; set; }
         *
         * [RequiredArgument]
         * [DisplayName("Имя пользователя")]
         * [Category("Электронная почта")]
         * public InArgument<string> UserName { get; set; }
         *
         * [RequiredArgument]
         * [DisplayName("Пароль")]
         * [Category("Электронная почта")]
         * public InArgument<string> Password { get; set; }
         *
         * [RequiredArgument]
         * [DisplayName("Почтовый сервер")]
         * [Category("Электронная почта")]
         * public InArgument<string> Host { get; set; }
         *
         * protected override void CacheMetadata(CodeActivityMetadata metadata)
         * {
         *  if (Port <= 0)
         *      metadata.AddValidationError("Значение свойства 'Порт' должно быть больше 0");
         *  base.CacheMetadata(metadata);
         * }
         *
         *
         * protected string GetFileExtByReportFormat()
         * {
         *  string Ext = "";
         *  if (ReportFormat == ReportExportFormat.Csv) Ext = "csv";
         *  if (ReportFormat == ReportExportFormat.Excel) Ext = "xls";
         *  if (ReportFormat == ReportExportFormat.Excel2007) Ext = "xlsx";
         *  if (ReportFormat == ReportExportFormat.ImageBmp) Ext = "bmp";
         *  if (ReportFormat == ReportExportFormat.ImageEmf) Ext = "emf";
         *  if (ReportFormat == ReportExportFormat.ImageGif) Ext = "gif";
         *  if (ReportFormat == ReportExportFormat.ImageJpeg) Ext = "jpg";
         *  if (ReportFormat == ReportExportFormat.ImagePcx) Ext = "pcx";
         *  if (ReportFormat == ReportExportFormat.ImagePng) Ext = "png";
         *  if (ReportFormat == ReportExportFormat.ImageTiff) Ext = "Tiff";
         *  if (ReportFormat == ReportExportFormat.Mht) Ext = "mht";
         *  if (ReportFormat == ReportExportFormat.Ods) Ext = "ods";
         *  if (ReportFormat == ReportExportFormat.Odt) Ext = "odt";
         *  if (ReportFormat == ReportExportFormat.Pdf) Ext = "pdf";
         *  if (ReportFormat == ReportExportFormat.Ppt2007) Ext = "ppt";
         *  if (ReportFormat == ReportExportFormat.Rtf) Ext = "rtf";
         *  if (ReportFormat == ReportExportFormat.Text) Ext = "txt";
         *  if (ReportFormat == ReportExportFormat.Word2007) Ext = "docx";
         *  if (ReportFormat == ReportExportFormat.Xps) Ext = "xps";
         *  if (Ext != "")
         *      Ext = "." + Ext;
         *  return Ext;
         * }
         *
         * protected void SendEmail(CodeActivityContext context,MemoryStream AttachContent)
         * {
         *
         *  MailMessage mailMessage = new MailMessage();
         *
         *  mailMessage.From = new MailAddress(From.Get(context));
         *  string STo = To.Get(context);
         *
         *  STo.Split(new Char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).ToList()
         *      .ForEach(item => mailMessage.To.Add(item.Trim()));
         *
         *  mailMessage.Subject = Subject.Get(context);
         *  mailMessage.Body = Body.Get(context);
         *
         *  SmtpClient smtpClient = new SmtpClient();
         *  smtpClient.Host = Host.Get(context);
         *  smtpClient.Port = Port;
         *  smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
         *  if (!String.IsNullOrEmpty(UserName.Get(context)) && !String.IsNullOrEmpty(Password.Get(context)))
         *      smtpClient.Credentials = new System.Net.NetworkCredential(UserName.Get(context), Password.Get(context));
         *
         *  if (AttachContent != null)
         *  {
         *      Attachment Attach = new Attachment(AttachContent, "Отчет"+GetFileExtByReportFormat());
         *      mailMessage.Attachments.Add(Attach);
         *  }
         *  //throw new Exception("Error sending email"); // test exception
         *  smtpClient.Send(mailMessage);
         * }
         */

        protected override bool Execute(CodeActivityContext context)
        {
            Error.Set(context, null);
            //SectionIntegralComplexResults DataReport;
            KeyValuePair <Guid, TReportResult> RepF = new KeyValuePair <Guid, TReportResult>();
            MemoryStream doc = null;

            try
            {
                string userId = null;
                if (!string.IsNullOrEmpty(User_ID))
                {
                    try
                    {
                        userId = UserHelper.GetIdByUserName(User_ID);
                        if (string.IsNullOrEmpty(userId)) // похоже тут не имя а UserID
                        {
                            userId = User_ID;
                        }
                    }
                    catch (Exception ex)
                    {
                        Error.Set(context, ex.Message);
                        if (!HideException.Get(context))
                        {
                            throw ex;
                        }
                    }
                }

                RepF = ARM_Service.REP_Export_Report(userId, ReportFormat, Report_id.Get(context),
                                                     StartDateTime.Get(context), EndDateTime.Get(context), null, WcfTimeOut.Get(context));
                doc = LargeData.DownloadData(RepF.Key);


                if (!string.IsNullOrEmpty(RepF.Value.Error))
                {
                    Error.Set(context, RepF.Value.Error);
                }
                else
                {
                    SendEmail(context, doc);
                }
            }

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

            return(string.IsNullOrEmpty(Error.Get(context)));
        }
        public string GenerateStandardOutputName()
        {
            string outputName = "outputVideo.avi";

            // Output name is in format Patient_Name_MM_DD_YYYY_Test_Name
            outputName  = PatientName;
            outputName += " " + StartDateTime.ToString("MM_dd_yyyy");
            outputName += " " + TestName;
            outputName  = outputName.Replace(' ', '_');
            return(outputName);
        }
Esempio n. 18
0
 public AssessmentViewModel()
 {
     if (StartDateTime.Equals(DateTime.MinValue))
     {
         StartDateTime = DateTime.Now;
     }
     if (EndDateTime.Equals(DateTime.MinValue))
     {
         EndDateTime = DateTime.Now;
     }
 }
Esempio n. 19
0
        protected override bool Execute(CodeActivityContext context)
        {
            if (TIList.Get(context) == null)
            {
                Error.Set(context, "Не определен список идентификаторов ТИ");
                return(false);
            }

            var inList = TIList.Get(context);

            if (inList.Count == 0)
            {
                Error.Set(context, "Список идентификаторов ТИ не должен быть пустым");
                return(false);
            }

            var result = new List <EventsJournalTI>();

            try
            {
                var res = ARM_Service.JTI_GetAllTIJournals(inList, StartDateTime.Get(context), EndDateTime.Get(context));
                if (res != null)
                {
                    foreach (var jti in res)
                    {
                        result.Add(new EventsJournalTI
                        {
                            TI_ID                   = jti.TI_ID,
                            EventDateTime           = jti.EventDateTime,
                            EventCode               = jti.EventCode,
                            DispatchDateTime        = jti.DispatchDateTime,
                            ExtendedEventCode       = jti.ExtendedEventCode,
                            Event61968Domain_ID     = jti.Event61968Domain_ID,
                            Event61968DomainPart_ID = jti.Event61968DomainPart_ID,
                            Event61968Type_ID       = jti.Event61968Type_ID,
                            Event61968Index_ID      = jti.Event61968Index_ID,
                            Event61968Param         = jti.Event61968Param
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }

            EventsJournal.Set(context, result);
            return(string.IsNullOrEmpty(Error.Get(context)));
        }
Esempio n. 20
0
 public void AddToDataTable(DataTable table)
 {
     table.Rows.Add(
         UpdateNumber,
         Incident.IncidentNumber,
         StartDateTime.ToString(Database.dateFormat),
         EndDateTime.ToString(Database.dateFormat),
         UpdateBy,
         Type,
         Status,
         Description
         );
 }
Esempio n. 21
0
        public string GetLocalDateString()
        {
            string cultureName = CultureInfo.CurrentUICulture.ToString();

            if (cultureName.Contains("ar"))
            {
                return(StartDateTime.ToLocalTime().ToString("D", new CultureInfo("ar-AE")));
            }
            else
            {
                return(StartDateTime.ToLocalTime().ToString("D"));
            }
        }
            public void ClearMeetingRoomForRecreate()
            {
                if (MeetingRoom != null)
                {
                    IgnoredMeetingRoom.Add(MeetingRoom.DisplayName + StartDateTime.ToString());
                }

                Location        = null;
                MeetingRoom     = null;
                MeetingRoomName = null;
                CreateHasDetail = true;
                RecreateState   = RecreateEventState.MeetingRoom;
            }
Esempio n. 23
0
        protected override bool Execute(CodeActivityContext context)
        {
            var buildID = Guid.NewGuid();

            //throw new Exception("Error !!!!!!!!!!"); // test exception

            try
            {
                var psList = Ps_List.Get(context);
                if (psList == null || psList.Count == 0)
                {
                    Error.Set(context, "Список ПС не может быть пустым");
                    return(false);
                }

                //TODO часовой пояс
                var res = ARM_Service.BPS_GenerateBalancePSExcel(buildID,
                                                                 psList,
                                                                 StartDateTime.Get(context),
                                                                 EndDateTime.Get(context),
                                                                 DiscreteType,
                                                                 DataSourceType,
                                                                 isPower, false, null);

                if (res != null)
                {
                    var generatedFile = new MemoryStream();
                    var res2          = ARM_Service.AUTODOCUM_LoadGeneratedZip(buildID);
                    if (res2 != null)
                    {
                        ReadAndWriteToAnotherStream(res2, generatedFile, false);
                        generatedFile.Seek(0, SeekOrigin.Begin);

                        Document.Set(context, generatedFile);
                        ResultReport.Set(context, res);
                    }
                }
            }

            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)
        {
            if (string.IsNullOrEmpty(ObjectIds))
            {
                Errors.Set(context, "Не определены объекты для которых будет сформирован баланс");
                return(false);
            }

            MultiPsSelectedArgs args;

            try
            {
                args = ObjectIds.DeserializeFromString <MultiPsSelectedArgs>();
            }
            catch (Exception ex)
            {
                Errors.Set(context, "Ошибка преобразования параметров " + ex.Message);
                return(false);
            }

            try
            {
                var res = ARM_Service.BL_GetFreeHierarchyBalanceByObjects(args.PSList,
                                                                          StartDateTime.Get(context),
                                                                          EndDateTime.Get(context), TimeZoneId,
                                                                          DiscreteType, UnitDigit);

                if (res != null && res.CalculatedValues != null)
                {
                    Balances.Set(context, res.CalculatedValues.Values.ToList());

                    if (res.Errors != null && res.Errors.Length > 0)
                    {
                        Errors.Set(context, res.Errors.ToString());
                    }
                }
            }

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

            return(string.IsNullOrEmpty(Errors.Get(context)));
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (ResourceName.Length != 0)
            {
                hash ^= ResourceName.GetHashCode();
            }
            if (SeasonalityAdjustmentId != 0L)
            {
                hash ^= SeasonalityAdjustmentId.GetHashCode();
            }
            if (Scope != global::Google.Ads.GoogleAds.V10.Enums.SeasonalityEventScopeEnum.Types.SeasonalityEventScope.Unspecified)
            {
                hash ^= Scope.GetHashCode();
            }
            if (Status != global::Google.Ads.GoogleAds.V10.Enums.SeasonalityEventStatusEnum.Types.SeasonalityEventStatus.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (StartDateTime.Length != 0)
            {
                hash ^= StartDateTime.GetHashCode();
            }
            if (EndDateTime.Length != 0)
            {
                hash ^= EndDateTime.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            hash ^= devices_.GetHashCode();
            if (ConversionRateModifier != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ConversionRateModifier);
            }
            hash ^= campaigns_.GetHashCode();
            hash ^= advertisingChannelTypes_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        protected override bool Execute(CodeActivityContext context)
        {
            try
            {
                var balanceFreeHierarchyUNs = new List <string> {
                    BalanceId.Get(context)
                };

                var balanceResult = ARM_Service.BL_GetFreeHierarchyBalanceResult(balanceFreeHierarchyUNs,
                                                                                 StartDateTime.Get(context),
                                                                                 EndDateTime.Get(context),
                                                                                 null,
                                                                                 TExportExcelAdapterType.toXLSx, true,
                                                                                 DiscreteType, EnumUnitDigit.Kilo, false,
                                                                                 EnumUnitDigit.Kilo, true, false, 3, 3, false, false, false);

                if (balanceResult != null)
                {
                    if (balanceResult.CalculatedValues == null || balanceResult.CalculatedValues.Count == 0)
                    {
                        throw new Exception("Документ не сформирован. Неверный идентификатор или баланс удален.");
                    }

                    var calculatedResult = balanceResult.CalculatedValues.First().Value;

                    if (calculatedResult.CompressedDoc == null)
                    {
                        throw new Exception("Документ пуст. Ошибка формирования");
                    }

                    var ms = new MemoryStream();

                    CompressUtility.DecompressGZip(calculatedResult.CompressedDoc).CopyTo(ms);
                    ms.Position = 0;
                    Document.Set(context, ms);
                }
            }

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

            return(string.IsNullOrEmpty(Error.Get(context)));
        }
Esempio n. 27
0
        public override string ToString()
        {
            var matchInfo         = CreateMatchInfo();
            var contestResultInfo = CreateContestResultInfo();

            return($"Contest number: {ContestNumber}\r\n" +
                   $"Title: {Title}\r\n" +
                   $"Description: {Description}\r\n" +
                   $"Start date and time: {StartDateTime.ToString()}\r\n" +
                   $"End date and time {EndDateTime.ToString()}\r\n\r\n" +
                   $"Match information:\r\n" +
                   $"{matchInfo}\r\n" +
                   $"*Contest Result*:\r\n" +
                   $"{contestResultInfo}\r\n");
        }
Esempio n. 28
0
        public void ParsingData()
        {
            int diffDate = EndDateTime.Subtract(StartDateTime).Days;

            for (int str = 0; str <= diffDate; str++)
            {
                string date = StartDateTime.AddDays(str).ToString("yyyyMMdd");
                var    data = ParsingHTML.GetTWSE(date);
                foreach (var item in data)
                {
                    SQlite_Module.Manipulate($@"INSERT INTO TWSE(""證券代號"", ""證券名稱"", ""成交股數"", ""成交筆數"", ""成交金額"",""開盤價"",""最高價"",""最低價"",""收盤價"",""漲跌(+/-)"",""漲跌價差"",""最後揭示買價"",""最後揭示買量"",""最後揭示賣價"",""最後揭示賣量"",""本益比"") VALUES({string.Join(",", item.Value)})");
                }
            }
            TWSE_Data = SQlite_Module.GetDataTable("SELECT * FROM TWSE");
        }
Esempio n. 29
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = LecturersTitleAndName != null?LecturersTitleAndName.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (LessonTitle != null ? LessonTitle.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (LessonType != null ? LessonType.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (LessonCodeAndClassRoom != null ? LessonCodeAndClassRoom.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ StartDateTime.GetHashCode();
                hashCode = (hashCode * 397) ^ EndDateTime.GetHashCode();
                return(hashCode);
            }
        }
Esempio n. 30
0
 public override string ToString()
 {
     // return a formatted entry
     //
     // 3:00-3:15    ProjectName.
     // here are some comments
     //
     return(string.Format("{0}-{1}{2}{3}{4}{5}",
                          StartDateTime.ToShortTimeString(),
                          EndDateTime.ToShortTimeString(),
                          "\t",
                          ProjectName,
                          "\r\n",
                          Comments));
 }