示例#1
0
            }             // Add

            public override string ToString()
            {
                var os = new StringBuilder();

                os.AppendFormat(
                    "\n\n\tBusiness ID: {0}\n" +
                    "\tCurrency code: {1}\n" +
                    "\t{2}\n\n" +
                    "\t*** Quarters:\n" +
                    "\t{3}\n\n" +
                    "\t*** Box totals:\n" +
                    "\t\t{4}\n\n" +
                    "\t*** Annualized data:\n{5}\n",
                    BusinessID,
                    CurrencyCode,
                    string.Join("\n\t", Periods.Select(pair => pair.Value.ToString("\t\t"))),
                    string.Join("\n\t", Quarters.Select(x => x.ToString("\t\t"))),
                    string.Join("\n\t\t", BoxTotals.Select(pair => string.Format("{0}: {1}", pair.Key, pair.Value))),
                    Annualized.ToString("\t\t")
                    );

                ToString(os, "\t");

                return(os.ToString());
            }             // ToString
        public XmlElement ToXmlElement(XmlHelper helper)
        {
            var xmlElement = helper.CreateElement(nameof(MedicalConsultationModel).Replace("Model", string.Empty));

            xmlElement.AppendChild(helper.CreateElement(nameof(Reason), Reason));
            xmlElement.AppendChild(helper.CreateElement(nameof(Periods), Periods.Select(x => x.ToXmlElement(helper)).ToList()));
            xmlElement.AppendChild(helper.CreateElement(nameof(PhysicianInfos), PhysicianInfos.ToXmlElement(helper)));
            return(xmlElement);
        }
示例#3
0
 /// <summary>
 /// Создать копию объекта <see cref="WorkingTime"/>.
 /// </summary>
 /// <returns>Копия объекта.</returns>
 public override WorkingTime Clone()
 {
     return(new WorkingTime
     {
         Periods = Periods.Select(t => t.Clone()).ToArray(),
         SpecialWorkingDays = SpecialWorkingDays.ToArray(),
         SpecialHolidays = SpecialHolidays.ToArray()
     });
 }
示例#4
0
        protected string ExpandedPeriodTitles()
        {
            if (Periods == null || !Periods.Any())
            {
                throw new ArgumentNullException("Properties");
            }

            return(String.Join(", ", Periods.Select(p => p.WrappedTitle)));
        }
示例#5
0
        /// <summary>
        /// Create a copy of <see cref="WorkingTime"/>.
        /// </summary>
        /// <returns>Copy.</returns>
        public override WorkingTime Clone()
        {
            var clone = new WorkingTime
            {
                _checkDates        = false,
                Periods            = Periods.Select(t => t.Clone()).ToArray(),
                SpecialWorkingDays = SpecialWorkingDays.ToArray(),
                SpecialHolidays    = SpecialHolidays.ToArray()
            };

            clone._checkDates = true;

            return(clone);
        }
示例#6
0
        public void LoadData()
        {
            Periods.Clear();
            SemiTrimesters.Clear();
            Trimesters.Clear();

            foreach (PeriodViewModel period in MainViewModel.Instance.Parameters.Periods.OrderBy(p => p.Trimester).ThenBy(p => p.Number))
            {
                Periods.Add(period);
            }
            foreach (SemiTrimesterViewModel semiTrimester in MainViewModel.Instance.Parameters.SemiTrimesters)
            {
                SemiTrimesters.Add(semiTrimester);
            }
            foreach (int trimester in Periods.Select(p => p.Trimester).Distinct())
            {
                Trimesters.Add(trimester);
            }
        }
示例#7
0
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomOpeningTimesSerializer">A delegate to serialize custom opening time JSON objects.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <OpeningTime> CustomOpeningTimesSerializer = null)
        {
            var JSON = JSONObject.Create(

                Periods.SafeAny()
                               ? new JProperty("Period", new JArray(Periods.Select(period => period.ToJSON())))
                               : null,

                new JProperty("on", On.AsString()),

                UnstructuredText.IsNotNullOrEmpty()
                               ? new JProperty("unstructuredOpeningTime", UnstructuredText)
                               : null

                );

            return(CustomOpeningTimesSerializer != null
                       ? CustomOpeningTimesSerializer(this, JSON)
                       : JSON);
        }
 private ExchangeBoard CreateBoardFromData()
 {
     return(new ExchangeBoard
     {
         Code = BoardCode,
         ExpiryTime = ExpiryTime.TimeOfDay,
         IsSupportAtomicReRegister = IsSupportAtomicReRegister,
         IsSupportMarketOrders = IsSupportMarketOrders,
         WorkingTime = new WorkingTime
         {
             Periods = Periods.Select(p => new WorkingTimePeriod
             {
                 Till = p.Till,
                 Times = p.WorkTimes.ToArray()
             }).ToArray(),
             SpecialWorkingDays = SpecialWorkingDays.Select(m => m.DateTime).ToArray(),
             SpecialHolidays = SpecialHolidays.Select(m => m.DateTime).ToArray()
         },
     });
 }
        private void UpdateForecastCells()
        {
            List <Cell> cells = CellRepository.GetCells(ForecastSheet, Periods.Select(p => p.Id)).ToList();

            if (cells.IsNullOrEmpty())
            {
                return;
            }
            List <(Guid entityId, Guid periodId, decimal fact, decimal potential)> data =
                Calculate(cells, Periods);

            data.ForEach(d => {
                CellRepository.SaveCell(ForecastSheet, d.entityId, _factIndicatorId, d.periodId,
                                        new ValueInfo {
                    Value = d.fact
                });
                CellRepository.SaveCell(ForecastSheet, d.entityId, _potentialIndicatorId, d.periodId,
                                        new ValueInfo {
                    Value = d.potential
                });
            });
        }
示例#10
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue("Periods", Periods.Select(p => p.Save()).ToArray());
     storage.SetValue("SpecialWorkingDays", SpecialWorkingDays);
     storage.SetValue("SpecialHolidays", SpecialHolidays);
 }
示例#11
0
 /// <summary>
 /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
 /// </summary>
 /// <returns>
 /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
 /// </returns>
 public override string ToString()
 {
     return(Periods.Select(p => p.ToString()).Join(","));
 }