public Prediction GetPrediction(ZodiacType zodiacType, TimeIntervalType timeIntervalType)
        {
            var zodiac       = GetZodiac(zodiacType);
            var timeInterval = GetTimeInterval(timeIntervalType);

            return(Factory.CreatePrediction(GetPredictionDataReader(zodiac, timeInterval), zodiac, timeInterval));
        }
コード例 #2
0
        // This routine is to fill in the data what stinfo and scts have. The IDs will
        // be updated when handling DataValues.
        OD_1_1_1DataSet.SeriesCatalogRow CreateNewSeriesCatalog(
            string siteCode, string varCode,
            seriesCatalogTypeSeries scts)
        {
            OD_1_1_1DataSet.SeriesCatalogRow row = Table.NewSeriesCatalogRow();
            VariableInfoType varInfo             = scts.variable;

            row.SiteID   = -1;
            row.SiteCode = siteCode;
            row.SiteName = null;

            row.VariableID   = -1;
            row.VariableCode = varInfo.variableCode[0].Value;
            row.VariableName = varInfo.variableName;

            row.Speciation = varInfo.speciation;

            row.VariableUnitsID   = Convert.ToInt32(varInfo.unit.unitCode);
            row.VariableUnitsName = varInfo.unit.unitName;

            row.SampleMedium = varInfo.sampleMedium;
            row.ValueType    = varInfo.valueType;

            row.TimeSupport   = varInfo.timeScale.timeSupport;
            row.TimeUnitsID   = Convert.ToInt32(varInfo.timeScale.unit.unitCode);
            row.TimeUnitsName = varInfo.timeScale.unit.unitName;

            row.DataType        = varInfo.dataType;
            row.GeneralCategory = varInfo.generalCategory;

            if (scts.method != null)
            {
                row.MethodID          = scts.method.methodID;
                row.MethodDescription = scts.method.methodDescription;
            }

            row.SourceID          = scts.source.sourceID;
            row.Organization      = scts.source.organization;
            row.SourceDescription = scts.source.sourceDescription;

            row.SetCitationNull();

            row.QualityControlLevelID   = scts.qualityControlLevel.qualityControlLevelID;
            row.QualityControlLevelCode = scts.qualityControlLevel.qualityControlLevelCode;

            // This table is to track what we have in DataValues table.
            // We don't have anything in DataValues table at this moment.
            TimeIntervalType ti = (TimeIntervalType)scts.variableTimeInterval;

            row.BeginDateTime    = ti.beginDateTime;
            row.EndDateTime      = OD_Utils.GetDateTime(row.BeginDateTime, row.TimeUnitsID, -1);
            row.BeginDateTimeUTC = ti.beginDateTime.ToUniversalTime();
            row.EndDateTimeUTC   = row.EndDateTime.ToUniversalTime();
            row.ValueCount       = 0;

            return(row);
        }
 public TimeInterval GetTimeInterval(TimeIntervalType timeIntervalType)
 {
     using var command   = _connection.CreateCommand();
     command.Connection  = _connection;
     command.CommandText =
         $"select {TimeInterval.GetIdColumnName()}, {TimeInterval.GetNameColumnName()}, {TimeInterval.GetTypeColumnName()} " +
         $"from {TimeInterval.GetTableName()} " +
         $"where {TimeInterval.GetTypeColumnName()} = :enum_number;";
     command.Parameters.AddWithValue("enum_number", (int)timeIntervalType);
     Console.WriteLine("Execute SQL: " + command.CommandText);
     return(Factory.CreateTimeInterval(command.ExecuteReader()));
 }
コード例 #4
0
        public void IncreaseCurrentTime(TimeIntervalType interval, int amount)
        {
            switch (interval)
            {
            case TimeIntervalType.Second: _offset += TimeSpan.FromSeconds(amount); break;

            case TimeIntervalType.Minute: _offset += TimeSpan.FromMinutes(amount); break;

            case TimeIntervalType.Hour:   _offset += TimeSpan.FromHours(amount); break;

            case TimeIntervalType.Day:    _offset += TimeSpan.FromDays(amount); break;

            default: break;
            }
        }
コード例 #5
0
        public static IEnumerable<EmployeeCountByIntervalLine> GetEmployeeCountByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
        {
            EmployeeCache.UpdateData(initialDate, finalDate);
            var employees = EmployeeCache.CachedData;

            // Query:
            var employeesQuery = from employee in employees
                                 where employee.HiredOn <= finalDate &&
                                       (employee.FiredOn >= initialDate || employee.FiredOn == DateTime.MinValue)
                                 select employee;

            var dateTimes = new List<DateTime>();
            if (timeInterval == TimeIntervalType.Year)
            {
                var temp = new DateTime(initialDate.Year, 1, 1);
                for (int i = 0; i < finalDate.Year - initialDate.Year + 1; i++)
                    dateTimes.Add(temp.AddYears(i));
            }
            else
            {
                var temp = new DateTime(initialDate.Year, initialDate.Month, 1);
                int months = ((finalDate.Year - initialDate.Year) * 12) + finalDate.Month - initialDate.Month + 1;
                for (int i = 0; i < months; i++)
                    dateTimes.Add(temp.AddMonths(i));
            }

            // Empty:
            var empty = from date in dateTimes
                        select new EmployeeCountByIntervalLine(date, 0);

            var output = new LinkedList<EmployeeCountByIntervalLine>();
            foreach (var e in empty)
            {
                DateTime beginDate = e.Date;
                DateTime endDate = timeInterval == TimeIntervalType.Month ? beginDate.AddMonths(1).AddDays(-1) : new DateTime(beginDate.Year, 12, 31);

                foreach (var employee in employeesQuery)
                {
                    if (employee.HiredOn <= endDate && (employee.FiredOn >= beginDate || employee.FiredOn == DateTime.MinValue))
                        e.Count++;
                }

                output.AddLast(e);
            }

            return output.OrderBy(x => x.Date);
        }
コード例 #6
0
        public static int NumberOfIntervals(DateTime oldDate, DateTime newDate, TimeIntervalType interval)
        {
            var span = newDate - oldDate;

            switch (interval)
            {
            case TimeIntervalType.Second: return(span.Seconds);

            case TimeIntervalType.Minute: return(span.Minutes);

            case TimeIntervalType.Hour:   return(span.Hours);

            case TimeIntervalType.Day:    return(span.Days);

            default: return(span.Days);
            }
        }
コード例 #7
0
        /// <summary>
        /// 算式作成
        /// </summary>
        /// <param name="p">題型參數</param>
        public override void MarkFormulaList(SchoolClockParameter p)
        {
            // 當前反推判定次數(一次推算內次數累加)
            int defeated = 0;

            // 按照指定數量作成相應的數學計算式
            for (var i = 0; i < p.NumberOfQuestions; i++)
            {
                // 隨機獲取時間段類型中的一個類型
                TimeIntervalType   type    = CommonUtil.GetRandomNumber(TimeIntervalType.Midnight, TimeIntervalType.LateNight);
                SchoolClockFormula formula = new SchoolClockFormula
                {
                    LatestTime = new TimeType()
                    {
                        Hours = 0, Minutes = 0, Seconds = 0
                    }
                };
                if (_timeIntervals.TryGetValue(type, out Action <SchoolClockFormula, FourOperationsType> timeInterval))
                {
                    timeInterval(formula, p.FourOperationsType);
                    if (p.IsShowSeconds)
                    {
                        formula.LatestTime.Seconds = 0;
                    }
                }
                else
                {
                    throw new ArgumentException(MessageUtil.GetMessage(() => MsgResources.E0002L, type.ToString()));
                }

                if (CheckIsNeedInverseMethod(p.Formulas, formula))
                {
                    defeated++;
                    // 如果大於兩次則認為此題無法作成繼續下一題
                    if (defeated == INVERSE_NUMBER)
                    {
                        // 當前反推判定次數復原
                        defeated = 0;
                        continue;
                    }
                    i--;
                    continue;
                }
                p.Formulas.Add(formula);
            }
        }
コード例 #8
0
        public Dictionary <Group, double> GetSumByGroupsDuring(TimeIntervalType tType, DateTime dateIn)
        {
            if (InIntervalDic[TimeIntervalType.Custom] == null)
            {
                throw new ArgumentNullException("Тип интервала custom не определен");
            }

            var query = from p in c.Payments
                        where InIntervalDic[tType](p, dateIn)
                        group p.Sum by p.Group into g
                        select new
            {
                Group = g.Key,
                Total = g.Sum(s => s)
            };

            return(query.ToDictionary(a => a.Group, a => a.Total));
        }
コード例 #9
0
        public static IEnumerable<NetSalesByIntervalLine> GetNetSalesByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
        {
            CachedData.UpdateData(initialDate, finalDate);
            var documents = CachedData.CachedData;

            // Query:
            var query = from document in documents
                where initialDate <= document.DocumentDate && document.DocumentDate <= finalDate &&
                      (document.DocumentType == "FA" || document.DocumentType == "ND" || document.DocumentType == "NC")
                group document by
                    new DateTime(document.DocumentDate.Year,
                        timeInterval == TimeIntervalType.Month ? document.DocumentDate.Month : 1, 1)
                into interval
                select new NetSalesByIntervalLine(
                    interval.Key, interval.Select(x => x.Value.Value).Sum()
                    );

            var dateTimes = new List<DateTime>();
            if (timeInterval == TimeIntervalType.Year)
            {
                var temp = new DateTime(initialDate.Year, 1, 1);
                for (int i = 0; i < finalDate.Year - initialDate.Year + 1; i++)
                    dateTimes.Add(temp.AddYears(i));
            }
            else
            {
                var temp = new DateTime(initialDate.Year, initialDate.Month, 1);
                int months = ((finalDate.Year - initialDate.Year) * 12) + finalDate.Month - initialDate.Month + 1;
                for (int i = 0; i < months; i++)
                    dateTimes.Add(temp.AddMonths(i));
            }

            // Empty:
            var empty = from date in dateTimes
                        select new NetSalesByIntervalLine(date, 0.0);

            var finalQuery = from e in empty
                             join realData in query on e.Date equals realData.Date into g
                             from realDataJoin in g.DefaultIfEmpty()
                             select new NetSalesByIntervalLine(e.Date, realDataJoin == null ? 0.0 : realDataJoin.Total);

            return finalQuery.OrderBy(x => x.Date);
        }
コード例 #10
0
        public List <StatByGroupViewModel> GetStatByGroups(TimeIntervalType tType, DateTime dateIn)
        {
            if (tType == TimeIntervalType.Custom)
            {
                throw new ArgumentException("Интервал не может быть custom");
            }

            var query = from p in c.Payments
                        where InIntervalDic[tType](p, dateIn)
                        group p by p.Group into stat
                        select new StatByGroupViewModel
            {
                Group   = stat.Key,
                Min     = stat.Min(p => p.Sum),
                Average = stat.Average(p => p.Sum),
                Max     = stat.Max(p => p.Sum)
            };

            return(query.ToList());
        }
コード例 #11
0
        /// <summary>
        /// 24小時制轉化為特定格式字符串
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string TimeIntervalTypeToString(this TimeIntervalType type)
        {
            var flag = string.Empty;

            switch (type)
            {
            case TimeIntervalType.Midnight:
                flag = "午夜[0:XX]";
                break;

            case TimeIntervalType.WeeHours:
                flag = "凌晨[1:XX~5:XX]";
                break;

            case TimeIntervalType.Forenoon:
                flag = "上午[6:XX~11:XX]";
                break;

            case TimeIntervalType.Nooning:
                flag = "中午[12:XX]";
                break;

            case TimeIntervalType.Afternoon:
                flag = "下午[13:XX~18:XX]";
                break;

            case TimeIntervalType.Night:
                flag = "晚上[19:XX~21:XX]";
                break;

            case TimeIntervalType.LateNight:
                flag = "深夜[22:XX~23:XX]";
                break;

            default:
                break;
            }
            return(flag);
        }
コード例 #12
0
        /// <summary>
        /// 時間段類型(24小時制)enum轉tooltip(HTML圖片顯示使用)
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string ToTimeIntervalTypeString(this TimeIntervalType type)
        {
            var flag = string.Empty;

            switch (type)
            {
            case TimeIntervalType.Midnight:
                flag = "午夜";
                break;

            case TimeIntervalType.WeeHours:
                flag = "凌晨";
                break;

            case TimeIntervalType.Forenoon:
                flag = "上午";
                break;

            case TimeIntervalType.Nooning:
                flag = "中午";
                break;

            case TimeIntervalType.Afternoon:
                flag = "下午";
                break;

            case TimeIntervalType.Night:
                flag = "晚上";
                break;

            case TimeIntervalType.LateNight:
                flag = "深夜";
                break;

            default:
                break;
            }
            return(flag);
        }
コード例 #13
0
        /// <summary>
        /// Converts the provided double value to its TimeSpan representation based on the
        /// currently selected IntervalType
        /// </summary>
        /// <param name="ThisIntervalType">The interval type that defines the conversion</param>
        /// <param name="DoubleValue">The value to be converted</param>
        /// <returns>The TimeSpan representing the float value</returns>
        public static TimeSpan GetTimeSpanValue(this TimeIntervalType ThisIntervalType, double DoubleValue)
        {
            switch (ThisIntervalType)
            {
            case TimeIntervalType.Milliseconds:
                return(TimeSpan.FromMilliseconds(DoubleValue));

            case TimeIntervalType.Seconds:
                return(TimeSpan.FromSeconds(DoubleValue));

            case TimeIntervalType.Minutes:
                return(TimeSpan.FromMinutes(DoubleValue));

            case TimeIntervalType.Hours:
                return(TimeSpan.FromHours(DoubleValue));

            case TimeIntervalType.Days:
                return(TimeSpan.FromDays(DoubleValue));

            default:
                throw new ArgumentOutOfRangeException("Invalid Enum Value");
            }
        }
コード例 #14
0
        /// <summary>
        /// Converts the provided TimeSpan to its double representation based on the
        /// currently selected IntervalType
        /// </summary>
        /// <param name="ThisIntervalType">The interval type that defines the conversion</param>
        /// <param name="TimeSpanValue">The value to be converted</param>
        /// <returns>The float value representing the TimeSpan in the specified unit</returns>
        public static double GetDoubleValue(this TimeIntervalType ThisIntervalType, TimeSpan TimeSpanValue)
        {
            switch (ThisIntervalType)
            {
            case TimeIntervalType.Milliseconds:
                return(TimeSpanValue.TotalMilliseconds);

            case TimeIntervalType.Seconds:
                return(TimeSpanValue.TotalSeconds);

            case TimeIntervalType.Minutes:
                return(TimeSpanValue.TotalMinutes);

            case TimeIntervalType.Hours:
                return(TimeSpanValue.TotalHours);

            case TimeIntervalType.Days:
                return(TimeSpanValue.TotalDays);

            default:
                throw new ArgumentOutOfRangeException("Invalid Enum Value");
            }
        }
コード例 #15
0
        /// <summary>
        /// Renders the time span data as a float field with a drop-down to select the time unit (milliseconds, seconds, minutes, hours)
        /// </summary>
        /// <param name="position">The rectangle depicting the available render area</param>
        /// <param name="property">The property containing the float value to be displayed as a time span</param>
        /// <param name="displayTimeSpanAttribute">The attribute that identifies the float as a time span value</param>
        /// <returns>A rectangle depicting the remaining available area</returns>
        protected virtual Rect DisplayTimeSpanWithSingleUnit(Rect position, SerializedProperty property, DisplayTimeSpanAttribute displayTimeSpanAttribute)
        {
            TimeSpan propertyTimeSpanValue = displayTimeSpanAttribute.UnderlyingValueType.GetTimeSpanValue(property.floatValue);

            float columnSpacing = 1f;

            float columnWidth = (position.width * 0.5f) - columnSpacing;

            Rect valueRect = new Rect(position);

            valueRect.width  = columnWidth;
            valueRect.height = EditorGUIUtility.singleLineHeight;

            Rect unitRect = new Rect(valueRect);

            unitRect.x = valueRect.xMax + columnSpacing;

            TimeIntervalType timeSpanUnit = displayTimeSpanAttribute.UnderlyingValueType;

            EditorGUI.LabelField(unitRect, timeSpanUnit.ToString());

            float currentValue = timeSpanUnit.GetFloatValue(propertyTimeSpanValue);

            currentValue = Mathf.Abs(EditorGUI.FloatField(valueRect, currentValue));

            TimeSpan currentTimespanValue = timeSpanUnit.GetTimeSpanValue(currentValue);

            property.floatValue = displayTimeSpanAttribute.UnderlyingValueType.GetFloatValue(currentTimespanValue);

            Rect returnRect = new Rect(position);

            returnRect.y      += EditorGUIUtility.singleLineHeight;
            returnRect.height -= EditorGUIUtility.singleLineHeight;

            return(returnRect);
        }
コード例 #16
0
 public IEnumerable<PurchasesManager.NetPurchasesByIntervalLine> GetNetIncomeByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
 {
     return PurchasesManager.GetNetPurchasesByInterval(initialDate, finalDate, timeInterval);
 }
コード例 #17
0
 public TimeInterval GetTimeInterval(TimeIntervalType timeIntervalType)
 {
     return(GetDatabaseConnection().GetTimeInterval(timeIntervalType));
 }
コード例 #18
0
 /// <summary>
 public TimeConditionsType(TimeIntervalType timeInterval) => TimeInterval = timeInterval;
コード例 #19
0
        public static IEnumerable <NetSalesByIntervalLine> GetNetSalesByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
        {
            CachedData.UpdateData(initialDate, finalDate);
            var documents = CachedData.CachedData;

            // Query:
            var query = from document in documents
                        where initialDate <= document.DocumentDate && document.DocumentDate <= finalDate &&
                        (document.DocumentType == "FA" || document.DocumentType == "ND" || document.DocumentType == "NC")
                        group document by
                        new DateTime(document.DocumentDate.Year,
                                     timeInterval == TimeIntervalType.Month ? document.DocumentDate.Month : 1, 1)
                        into interval
                        select new NetSalesByIntervalLine(
                interval.Key, interval.Select(x => x.Value.Value).Sum()
                );

            var dateTimes = new List <DateTime>();

            if (timeInterval == TimeIntervalType.Year)
            {
                var temp = new DateTime(initialDate.Year, 1, 1);
                for (int i = 0; i < finalDate.Year - initialDate.Year + 1; i++)
                {
                    dateTimes.Add(temp.AddYears(i));
                }
            }
            else
            {
                var temp   = new DateTime(initialDate.Year, initialDate.Month, 1);
                int months = ((finalDate.Year - initialDate.Year) * 12) + finalDate.Month - initialDate.Month + 1;
                for (int i = 0; i < months; i++)
                {
                    dateTimes.Add(temp.AddMonths(i));
                }
            }

            // Empty:
            var empty = from date in dateTimes
                        select new NetSalesByIntervalLine(date, 0.0);

            var finalQuery = from e in empty
                             join realData in query on e.Date equals realData.Date into g
                             from realDataJoin in g.DefaultIfEmpty()
                             select new NetSalesByIntervalLine(e.Date, realDataJoin == null ? 0.0 : realDataJoin.Total);

            return(finalQuery.OrderBy(x => x.Date));
        }
コード例 #20
0
            public static seriesCatalogTypeSeries CreateSeriesRecord(VariableInfoType variable, string sampleMedium, W3CDateTime? beginDateTime, W3CDateTime? endDateTime, int? valueCount, bool? valueCountIsEstimated, string dataType, string valueType, string generalCategory, bool realTime, string realTimeInterval, string QualityControlLevelTerm, int? qualityControlLevelid, string methodName, int? methodID, string organization, string sourceDescription, int? sourceID, string citation)
            {
                /* don't forget to check the VariableInfoType for the
                 * dataType,ValueType and General Category
                 *
                 */
                /*
                 * logic
                 * create seriesCatalogTypeSeries
                 * if variable != null use it. if null, make an empty variable
                 * if variable != null
                 *    and sampleMedium,dataType,valueType or generalCategory is null
                 *    try to get value from variable
                 * add datTime interface logic
                 *
                 */
                seriesCatalogTypeSeries series = new seriesCatalogTypeSeries();
                series.variable = variable != null ? variable : CreateVariableDescriptionType();
                if (valueCount.HasValue)
                {
                series.valueCount = new seriesCatalogTypeSeriesValueCount();
                series.valueCount.Value = valueCount.Value;
                }

                // if begin time and end time are the same use single

                if (beginDateTime.HasValue)
                {
                TimeIntervalType tm = new TimeIntervalType();

                   // tm.beginDateTime = new DateTimeOffset(beginDateTime.Value.DateTime);
                tm.beginDateTime = beginDateTime.Value.DateTime;

                if (endDateTime.HasValue)
                {
                  //  tm.endDateTime = new DateTimeOffset(endDateTime.Value.DateTime);
                    tm.endDateTime = endDateTime.Value.DateTime;
                }
                else
                {
                    tm.endDateTime = tm.beginDateTime;
                }
                series.variableTimeInterval = tm;
                }

                if (realTime)
                {
                TimePeriodRealTimeType rt = new TimePeriodRealTimeType();
                rt.realTimeDataPeriod = realTimeInterval; // 31 day Period
                //rt.beginDateTime = new DateTimeOffset(DateTime.Today.AddDays(-31));
                //rt.endDateTime = new DateTimeOffset(DateTime.Today);
                rt.beginDateTime = DateTime.Today.AddDays(-31);
                rt.endDateTime = DateTime.Today;
                series.variableTimeInterval = rt;
                }

                /* TODO: fully populate
                 * These need to use ID< and fully populat from database
                 */
                if (qualityControlLevelid.HasValue || !String.IsNullOrEmpty(QualityControlLevelTerm))
                {
                series.QualityControlLevel = new QualityControlLevelType();
                // need to have a dataset with an enum so we can
                // SetEnumFromText(qsds,row,series.QualityControlLevel, typeof(QualityControlLevelEnum));
                if (qualityControlLevelid.HasValue)
                {
                    series.QualityControlLevel.qualityControlLevelID = qualityControlLevelid.Value;
                    series.QualityControlLevel.qualityControlLevelIDSpecified = true;
                }
                if (!String.IsNullOrEmpty(QualityControlLevelTerm))
                {
                    series.QualityControlLevel.Value = QualityControlLevelTerm;

                  // originally defined as an enum, but enums cannot be empty, and we have an id
                    // QualityControlLevelTerm = QualityControlLevelTerm.Replace(" ", "");
                   // if (Enum.IsDefined(typeof(QualityControlLevelEnum), QualityControlLevelTerm))
                   // {
                   //     object aEnum = Enum.Parse(typeof(QualityControlLevelEnum), QualityControlLevelTerm);
                   //     series.QualityControlLevel.Value = (QualityControlLevelEnum)aEnum;
                   // }

                }
                }

                /* TODO: fully populate
                 * These need to use ID< and fully populat from database
                 */
                if (!String.IsNullOrEmpty(methodName) || methodID.HasValue)
                {
                MethodType method = new MethodType();
                if ( !String.IsNullOrEmpty(methodName)  )
                { method.MethodDescription = methodName;
                }
                if (methodID.HasValue) {
                    method.methodID = methodID.Value;
                    method.methodIDSpecified = true;

                }
                series.Method = method;
                }
                if (!String.IsNullOrEmpty(sourceDescription) ||
                !String.IsNullOrEmpty(organization) ||
                sourceID.HasValue)
                {
                SourceType source = new SourceType();
                if (!String.IsNullOrEmpty(sourceDescription) ||
                !String.IsNullOrEmpty(organization) )
                {
                    source.SourceDescription = sourceDescription;
                source.Organization = organization;

                }
                if (sourceID.HasValue)
                {
                    source.sourceID = sourceID.Value;
                    source.sourceIDSpecified = true;
                }
                series.Source = source;
                }

                return series;
            }
コード例 #21
0
ファイル: ExportRefunds.cs プロジェクト: MrGreen-git/GisGmp
 /// <summary>
 /// Запрос на предоставление информации о возврате
 /// </summary>
 /// <param name="refundsKind">Тип запроса на предоставление информации</param>
 /// <param name="timeInterval">Временной интервал, за который запрашивается информация</param>
 /// <param name="beneficiary">ИНН и КПП получателя средств (кол-во объектов null, 1-10)</param>
 /// <param name="kbk">КБК (кол-во объектов null, 1-10)</param>
 /// <returns>MessageId СМЭВ</returns>
 public ExportRefundsRequest CreateExportRefundsRequest(ExportRefundsKind refundsKind, TimeIntervalType timeInterval, Beneficiary[] beneficiary = null, KBKType[] kbk = null)
 {
     return(new ExportRefundsRequest(
                config: ExportRequestConfig,
                exportConditions: new RefundsExportConditions(
                    kind: refundsKind,
                    conditions: new TimeConditionsType(timeInterval, beneficiary, kbk)
                    )
                ));
 }
コード例 #22
0
 /// <summary>
 /// Запрос на предоставление информации о результатах квитирования | Фильтр "Начисление"
 /// </summary>
 /// <param name="quittancesKind">Тип запроса на предоставление информации</param>
 /// <param name="uin">УИН (кол-во объектов 1-100)</param>
 /// <param name="timeInterval">Временной интервал, за который запрашивается информация</param>
 /// <returns>CreateExportQuittancesRequest -> ObjectRequest | ExportQuittances -> IdMessageSMEV</returns>
 public ExportQuittancesRequest CreateExportQuittancesRequest(ExportQuittancesKind quittancesKind, SupplierBillIDType[] uin, TimeIntervalType timeInterval = default)
 {
     return(new ExportQuittancesRequest(
                config: ExportRequestConfig,
                exportConditions: new QuittancesExportConditions(
                    kind: quittancesKind,
                    conditions: new ChargesConditionsType(
                        supplierBillID: uin,
                        timeInterval: timeInterval
                        )
                    )
                ));
 }
コード例 #23
0
 /// <inheritdoc cref="CreateExportQuittancesRequest(ExportQuittancesKind, SupplierBillIDType[], TimeIntervalType)"/>
 public string ExportQuittances(ExportQuittancesKind quittancesKind, SupplierBillIDType[] uin, TimeIntervalType timeInterval = default)
 => ReadyRequest(CreateExportQuittancesRequest(quittancesKind, uin, timeInterval));
コード例 #24
0
 public TimeInterval(string name, TimeIntervalType type)
 {
     Name = name;
     Type = type;
 }
コード例 #25
0
 public IEnumerable<SalesManager.NetSalesByIntervalLine> GetNetSalesByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
 {
     return SalesManager.GetNetSalesByInterval(initialDate, finalDate, timeInterval);
 }
コード例 #26
0
ファイル: ExportRefunds.cs プロジェクト: MrGreen-git/GisGmp
 /// <summary/>
 public string ExportRefunds(ExportRefundsKind refundsKind, IPayerInnOrId[] payerInnOrId, TimeIntervalType timeInterval = null, KBKType[] kbk = null)
 => ReadyRequest(CreateExportRefundsRequest(refundsKind, payerInnOrId, timeInterval, kbk));
コード例 #27
0
 public IEnumerable<HumanResourcesManager.EmployeeCountByIntervalLine> GetEmployeeCountByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
 {
     return HumanResourcesManager.GetEmployeeCountByInterval(initialDate, finalDate, timeInterval);
 }
コード例 #28
0
ファイル: ExportRefunds.cs プロジェクト: MrGreen-git/GisGmp
 /// <summary/>
 public string ExportRefunds(ExportRefundsKind refundsKind, TimeIntervalType timeInterval, Beneficiary[] beneficiary = null, KBKType[] kbk = null)
 => ReadyRequest(CreateExportRefundsRequest(refundsKind, timeInterval, beneficiary, kbk));
コード例 #29
0
 public TimeInterval(int id, string name, TimeIntervalType type)
 {
     Id   = id;
     Name = name;
     Type = type;
 }
コード例 #30
0
 public Prediction GetPrediction(ZodiacType zodiacType, TimeIntervalType timeIntervalType)
 {
     return(GetDatabaseConnection().GetPrediction(zodiacType, timeIntervalType));
 }
コード例 #31
0
 /// <summary>
 /// Запрос на предоставление информации о результатах квитирования | Фильтр "Время"
 /// </summary>
 /// <param name="quittancesKind">Тип запроса на предоставление информации</param>
 /// <param name="timeInterval">Временной интервал, за который запрашивается информация</param>
 /// <param name="beneficiary">ИНН и КПП получателя средств (кол-во объектов null, 1-10)</param>
 /// <param name="kbk">КБК (кол-во объектов null, 1-10)</param>
 /// <returns>CreateExportQuittancesRequest -> ObjectRequest | ExportQuittances -> IdMessageSMEV</returns>
 public ExportQuittancesRequest CreateExportQuittancesRequest(ExportQuittancesKind quittancesKind, TimeIntervalType timeInterval, Beneficiary[] beneficiary = default, KBKType[] kbk = default)
 {
     return(new ExportQuittancesRequest(
                config: ExportRequestConfig,
                exportConditions: new QuittancesExportConditions(
                    kind: quittancesKind,
                    conditions: new TimeConditionsType(timeInterval, beneficiary, kbk)
                    )
                ));
 }
コード例 #32
0
 /// <summary>
 public PayersConditionsType(string[] items, ItemsChoiceType[] itemsElementName, TimeIntervalType timeInterval = null, KBKType[] kbklist = null)
     : this(items, itemsElementName)
 {
     TimeInterval = timeInterval;
     KBKlist      = kbklist;
 }
コード例 #33
0
 /// <inheritdoc cref="CreateExportQuittancesRequest(ExportQuittancesKind, TimeIntervalType, Beneficiary[], KBKType[])"/>
 public string ExportQuittances(ExportQuittancesKind quittancesKind, TimeIntervalType timeInterval, Beneficiary[] beneficiary = default, KBKType[] kbk = default)
 => ReadyRequest(CreateExportQuittancesRequest(quittancesKind, timeInterval, beneficiary, kbk));
コード例 #34
0
 public CallEveryAttribute(int interval, TimeIntervalType timeIntervalType)
 {
     _interval         = interval;
     _timeIntervalType = timeIntervalType;
 }
コード例 #35
0
            public static seriesCatalogTypeSeries CreateSeriesRecord(VariableInfoType variable, string sampleMedium, W3CDateTime?beginDateTime, W3CDateTime?endDateTime, int?valueCount, bool?valueCountIsEstimated, string dataType, string valueType, string generalCategory, bool realTime, string realTimeInterval, string QualityControlLevelTerm, int?qualityControlLevelid, string methodName, int?methodID, string organization, string sourceDescription, int?sourceID)
            {
                /* don't forget to check the VariableInfoType for the
                 * dataType,ValueType and General Category
                 *
                 */
                /*
                 * logic
                 * create seriesCatalogTypeSeries
                 * if variable != null use it. if null, make an empty variable
                 * if variable != null
                 *    and sampleMedium,dataType,valueType or generalCategory is null
                 *    try to get value from variable
                 * add datTime interface logic
                 *
                 */
                seriesCatalogTypeSeries series = new seriesCatalogTypeSeries();

                series.variable = variable != null ? variable : CreateVariableDescriptionType();
                if (valueCount.HasValue)
                {
                    series.valueCount       = new seriesCatalogTypeSeriesValueCount();
                    series.valueCount.Value = valueCount.Value;
                }



                // if begin time and end time are the same use single

                if (beginDateTime.HasValue)
                {
                    TimeIntervalType tm = new TimeIntervalType();

                    tm.beginDateTime = beginDateTime.Value.DateTime;

                    if (endDateTime.HasValue)
                    {
                        tm.endDateTime = endDateTime.Value.DateTime;
                    }
                    else
                    {
                        tm.endDateTime = tm.beginDateTime;
                    }
                    series.variableTimeInterval = tm;
                }


                if (realTime)
                {
                    TimePeriodRealTimeType rt = new TimePeriodRealTimeType();
                    rt.realTimeDataPeriod       = realTimeInterval; // 31 day Period
                    rt.beginDateTime            = DateTime.Today.AddDays(-31);
                    rt.endDateTime              = DateTime.Today;
                    series.variableTimeInterval = rt;
                }

                /* TODO: fully populate
                 * These need to use ID< and fully populat from database
                 */
                if (qualityControlLevelid.HasValue || !String.IsNullOrEmpty(QualityControlLevelTerm))
                {
                    series.QualityControlLevel = new QualityControlLevelType();
                    // need to have a dataset with an enum so we can
                    // SetEnumFromText(qsds,row,series.QualityControlLevel, typeof(QualityControlLevelEnum));
                    if (qualityControlLevelid.HasValue)
                    {
                        series.QualityControlLevel.qualityControlLevelID          = qualityControlLevelid.Value;
                        series.QualityControlLevel.qualityControlLevelIDSpecified = true;
                    }
                    if (!String.IsNullOrEmpty(QualityControlLevelTerm))
                    {
                        series.QualityControlLevel.Value = QualityControlLevelTerm;

                        // originally defined as an enum, but enums cannot be empty, and we have an id
                        // QualityControlLevelTerm = QualityControlLevelTerm.Replace(" ", "");
                        // if (Enum.IsDefined(typeof(QualityControlLevelEnum), QualityControlLevelTerm))
                        // {
                        //     object aEnum = Enum.Parse(typeof(QualityControlLevelEnum), QualityControlLevelTerm);
                        //     series.QualityControlLevel.Value = (QualityControlLevelEnum)aEnum;
                        // }
                    }
                }

                /* TODO: fully populate
                 * These need to use ID< and fully populat from database
                 */
                if (!String.IsNullOrEmpty(methodName) || methodID.HasValue)
                {
                    MethodType method = new MethodType();
                    if (!String.IsNullOrEmpty(methodName))
                    {
                        method.MethodDescription = methodName;
                    }
                    if (methodID.HasValue)
                    {
                        method.methodID = methodID.Value;
                    }
                    series.Method = method;
                }
                if (!String.IsNullOrEmpty(sourceDescription) ||
                    !String.IsNullOrEmpty(organization) ||
                    sourceID.HasValue)
                {
                    SourceType source = new SourceType();
                    if (!String.IsNullOrEmpty(sourceDescription) ||
                        !String.IsNullOrEmpty(organization))
                    {
                        source.SourceDescription = sourceDescription;
                        source.Organization      = organization;
                    }
                    if (sourceID.HasValue)
                    {
                        source.sourceID = sourceID.Value;
                    }
                    series.Source = source;
                }

                return(series);
            }
コード例 #36
0
ファイル: ExportRefunds.cs プロジェクト: MrGreen-git/GisGmp
 /// <summary>
 /// Запрос на предоставление информации о возврате
 /// </summary>
 /// <param name="refundsKind">Тип запроса на предоставление информации</param>
 /// <param name="payerInnOrId">Идентификатор плательщика (кол-во объектов 1-100)</param>
 /// <param name="timeInterval">Временной интервал, за который запрашивается информация</param>
 /// <param name="kbk">КБК (кол-во объектов null, 1-10)</param>
 /// <returns>MessageId СМЭВ</returns>
 public ExportRefundsRequest CreateExportRefundsRequest(ExportRefundsKind refundsKind, IPayerInnOrId[] payerInnOrId, TimeIntervalType timeInterval = null, KBKType[] kbk = null)
 {
     throw new NotImplementedException();
     //return new ExportRefundsRequest(
     //    config: ExportRequestConfig(),
     //    exportConditions: new RefundsExportConditions(
     //        kind: refundsKind,
     //        conditions: new PayersConditionsType(payerInnOrId, timeInterval, kbk)
     //        )
     //    );
 }