コード例 #1
0
		/// <summary>
		/// Converts a <see cref="NullableDateTime"/> to a <see cref="SmartDate"/>.
		/// </summary>
		/// <param name="nullableDateTime">A <see cref="NullableDateTime"/> instance object.</param>
		/// <param name="emptyIsMin">Indicates whether <lang>null</lang> should be treated as <see cref="DateTime.MinValue"/></param>
		/// <returns>A <see cref="SmartDate"/> instance object.</returns>
		public static SmartDate ToSmartDate(NullableDateTime nullableDateTime, bool emptyIsMin)
		{
			if (nullableDateTime.HasValue)
				return new SmartDate(nullableDateTime.Value);
			else
				return new SmartDate(emptyIsMin);
		}
コード例 #2
0
		/// <summary>
		/// Converts a <see cref="NullableDateTime"/> to a <see cref="SmartDate"/>.
		/// </summary>
		/// <param name="nullableDateTime">A <see cref="NullableDateTime"/> instance object.</param>
		/// <returns>A <see cref="SmartDate"/> instance object.</returns>
		public static SmartDate ToSmartDate(NullableDateTime nullableDateTime)
		{
			if (nullableDateTime.HasValue)
				return new SmartDate(nullableDateTime.Value);
			else
				throw new Exception("Cannot convert an empty NullableDateTime to a SmartDate");
		}
コード例 #3
0
ファイル: Staff.cs プロジェクト: caikelun/PermissionBase
 public Staff()
 {
     _login_id = String.Empty;
     _password = String.Empty;
     _code = String.Empty;
     _name = String.Empty;
     _sex = null;
     _married = null;
     _id_card = String.Empty;
     _country_tag = String.Empty;
     _nation_tag = String.Empty;
     _position_tag = String.Empty;
     _title_tag = String.Empty;
     _political_appearance_tag = String.Empty;
     _degree_tag = String.Empty;
     _birthday = null;
     _enters_day = null;
     _leaves_day = null;
     _office_phone = String.Empty;
     _ext_number = String.Empty;
     _family_phone = String.Empty;
     _cell_phone = String.Empty;
     _email = String.Empty;
     _address = String.Empty;
     _zip_code = String.Empty;
     _remark = String.Empty;
     _is_inner_user = 0;
     _disabled = 0;
     _order_id = 0;
     _department = null;
     _roles = new HashedSet();
     _module_rights_grant = new HashedSet();
     _module_rights_deny = new HashedSet();
 }
コード例 #4
0
        public void GetActivityStateIdsTest()
        {
            TinCanJsonConverter converter   = new TinCanJsonConverter();
            TCAPI            target         = new TCAPI(new Uri("http://cloud.scorm.com/tc/public"), new BasicHTTPAuth("test", "password"));
            Actor            actor          = new Actor("Example", "mailto:[email protected]");
            string           activityId     = "example.com";
            string           registrationId = null;
            NullableDateTime since          = null;

            string[] actual;
            actual = target.GetActivityStateIds(activityId, actor, registrationId, since);
            Console.Write(converter.SerializeToJSON(actual));
            Assert.Inconclusive(INCONCLUSIVE_CONSOLE);
        }
コード例 #5
0
 public System.DateTime? ValueAsDateTime(string columnName)
 {
     global::System.IntPtr cPtr = CommonPINVOKE.DataRow_ValueAsDateTime__SWIG_1(swigCPtr, columnName);
     if (CommonPINVOKE.SWIGPendingException.Pending)
     {
         throw CommonPINVOKE.SWIGPendingException.Retrieve();
     }
     using (NullableDateTime tempDate = (cPtr == global::System.IntPtr.Zero) ? null : new NullableDateTime(cPtr, false)) {
         if (tempDate?.HasValue() ?? false)
         {
             return(new System.DateTime(Common.ToTicks(tempDate.GetValueOrDefault())));
         }
         return(null);
     }
 }
コード例 #6
0
        public void TestQueryNullableValue()
        {
            foreach (IDataService dataService in DataServices)
            {
                if (dataService is OracleDataService && typeof(SQLDataService).Assembly.ImageRuntimeVersion.StartsWith("v2"))
                {
                    ///TODO: Исправить конвертацию для OracleDataService decimal в char, если используется System.Data.OracleClient (в Net3.5).
                    ///Для версии Net4.0 и выше используется Oracle.ManagedDataAccess.Client, для которого исправление не требуется.
                    continue;
                }
                var ds = (SQLDataService)dataService;

                NullableDateTime date = new NullableDateTime();
                date.Value = DateTime.Now;
                NullableDecimal dec = new NullableDecimal();
                dec.Value = new decimal(77.111);
                NullableDecimal decGreater = new NullableDecimal();
                decGreater.Value = dec.Value + new decimal(0.001);
                NullableInt i = new NullableInt();
                i.Value = 77;
                FullTypesMaster1 fullTypes = new FullTypesMaster1()
                {
                    PoleNullableDateTime = date, PoleNullableDecimal = dec, PoleNullableInt = i
                };

                // Сохранение данных.
                var updateObjectsArray = new ICSSoft.STORMNET.DataObject[] { fullTypes };
                ds.UpdateObjects(ref updateObjectsArray);

                // Выбор представления.
                var view = FullTypesMaster1.Views.FullMasterView;
                List <FullTypesMaster1> list;

                // Проверка поиска NullableDateTime.
                list = ds.Query <FullTypesMaster1>(view).Where(d => d.PoleNullableDateTime.Value <= date.Value).ToList();
                Assert.Equal(1, list.Count);

                // Проверка поиска NullableDecimal.
                list = ds.Query <FullTypesMaster1>(view).Where(d => d.PoleNullableDecimal.Value < decGreater.Value).ToList();
                Assert.Equal(1, list.Count);

                // Проверка поиска NullableInt.
                list = ds.Query <FullTypesMaster1>(view).Where(d => d.PoleNullableInt.Value == i.Value).ToList();
                Assert.Equal(1, list.Count);
            }
        }
コード例 #7
0
ファイル: User.cs プロジェクト: caikelun/PermissionBase
 public User()
 {
     _login_id = String.Empty;
     _password = String.Empty;
     _name = String.Empty;
     _sex = null;
     _birthday = null;
     _id_card = String.Empty;
     _office_phone = String.Empty;
     _family_phone = String.Empty;
     _cell_phone = String.Empty;
     _email = String.Empty;
     _address = String.Empty;
     _zip_code = String.Empty;
     _remark = String.Empty;
     _disabled = 0;
 }
コード例 #8
0
 public User()
 {
     _login_id     = String.Empty;
     _password     = String.Empty;
     _name         = String.Empty;
     _sex          = null;
     _birthday     = null;
     _id_card      = String.Empty;
     _office_phone = String.Empty;
     _family_phone = String.Empty;
     _cell_phone   = String.Empty;
     _email        = String.Empty;
     _address      = String.Empty;
     _zip_code     = String.Empty;
     _remark       = String.Empty;
     _disabled     = 0;
 }
コード例 #9
0
        public void MysqlMinisDateTimeTest()
        {
            Require.ProviderIs(StorageProvider.MySql);
            ExecuteInsideSession(() => {
                var firstDateTime            = FirstDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
                var firstMillisecondDateTime = FirstMillisecondDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
                var secondDateTime           = SecondDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);
                var nullableDateTime         = NullableDateTime.FixDateTimeForProvider(StorageProviderInfo.Instance);

                RunTest <SingleDateTimeEntity>(c => c.DateTime - secondDateTime == firstDateTime - secondDateTime);
                RunTest <SingleDateTimeEntity>(c => c.MillisecondDateTime - secondDateTime == firstMillisecondDateTime - secondDateTime);
                RunTest <SingleDateTimeEntity>(c => c.NullableDateTime - secondDateTime == nullableDateTime - secondDateTime);

                RunWrongTest <SingleDateTimeEntity>(c => c.DateTime - secondDateTime == firstDateTime - WrongDateTime);
                RunWrongTest <SingleDateTimeEntity>(c => c.MillisecondDateTime - secondDateTime == firstMillisecondDateTime - WrongDateTime);
                RunWrongTest <SingleDateTimeEntity>(c => c.NullableDateTime - secondDateTime == nullableDateTime - WrongDateTime);
            });
        }
コード例 #10
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)UInt;
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Char.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ (ByteArray != null ? ByteArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CharArray != null ? CharArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LongArray != null ? LongArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubTypes != null ? SubTypes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomText != null ? CustomText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MaxText != null ? MaxText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomDecimal.GetHashCode();
         return(hashCode);
     }
 }
コード例 #11
0
 protected bool Equals(AllFields other)
 {
     return(Id == other.Id &&
            NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            Guid.Equals(other.Guid) &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            NullableGuid.Equals(other.NullableGuid));
 }
コード例 #12
0
 protected new void SetPropertiesFromDataReader(SqlDataReaderWrapper dr)
 {
     this.firstName             = dr.GetString("FirstName");
     this.lastName              = dr.GetString("LastName");
     this.emailAddress          = dr.GetString("EmailAddress");
     this.phoneNumber           = dr.GetString("PhoneNumber");
     this.password              = dr.GetString("Password");
     this.address1              = dr.GetString("Address1");
     this.address2              = dr.GetString("Address2");
     this.city                  = dr.GetString("City");
     this.state                 = dr.GetString("State");
     this.postalCode            = dr.GetString("PostalCode");
     this.shippingAddress1      = dr.GetString("ShippingAddress1");
     this.shippingAddress2      = dr.GetString("ShippingAddress2");
     this.shippingCity          = dr.GetString("ShippingCity");
     this.shippingState         = dr.GetString("ShippingState");
     this.shippingPostalCode    = dr.GetString("ShippingPostalCode");
     this.areasOfExpertise      = dr.GetString("AreasOfExpertise");
     this.adminUserType         = (AdminUserType)dr.GetInt32("AdminUserType");
     this.isSystemAdministrator = dr.GetBoolean("IsSystemAdministrator");
     this.isReceivesPastDueNoFixNotifications = dr.GetBoolean("IsReceivesPastDueNoFixNotifications");
     this.market      = (Market)dr.GetInt32("Market");
     this.permissions = dr.GetString("Permissions");
     this.validationPayRateDollarsPerHour = dr.GetNullableDecimal("ValidationPayRateDollarsPerHour");
     this.isActive                  = dr.GetBoolean("IsActive");
     this.isDeleted                 = dr.GetBoolean("IsDeleted");
     this.updatedDateTimeUTC        = dr.GetDateTime("UpdatedDateTimeUTC");
     this.createdDateTimeUTC        = dr.GetDateTime("CreatedDateTimeUTC");
     this.lastLoginDateTimeUTC      = dr.GetNullableDateTime("LastLoginDateTimeUTC");
     this.propertyDefinitionDataSet = (PropertyDefinitionDataSet)dr.GetBusinessObjectBase(this.Registry, typeof(PropertyDefinitionDataSet), "PropertyDefinitionDataSetId");
     this.enablePropertyDefinitionEditingOnForms = dr.GetBoolean("EnablePropertyDefinitionEditingOnForms");
     if (!dr.IsDBNull("ValidationTestResultsTotalMinutesToComplete"))
     {
         this.validationTestResultsTotalMinutesToComplete = dr.GetInt32("ValidationTestResultsTotalMinutesToComplete");
     }
     this.IsObjectLoaded = true;
 }
コード例 #13
0
 protected bool Equals(AllTypes other)
 {
     return(Id == other.Id &&
            NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            DateTimeOffset.Equals(other.DateTimeOffset) &&
            Guid.Equals(other.Guid) &&
            Bool == other.Bool &&
            Char == other.Char &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            ByteArray.SequenceEqual(other.ByteArray) &&
            CharArray.SequenceEqual(other.CharArray) &&
            IntArray.SequenceEqual(other.IntArray) &&
            LongArray.SequenceEqual(other.LongArray) &&
            StringArray.SequenceEqual(other.StringArray) &&
            StringList.SequenceEqual(other.StringList) &&
            StringMap.SequenceEqual(other.StringMap) &&
            IntStringMap.SequenceEqual(other.IntStringMap) &&
            SubType.Equals(other.SubType) &&
            SubTypes.SequenceEqual(other.SubTypes) &&
            CustomText == other.CustomText &&
            MaxText == other.MaxText &&
            CustomDecimal.Equals(other.CustomDecimal));
 }
コード例 #14
0
        public void ConvertSimpleValueToQueryValueStringTest()
        {
            MSSQLDataService ds = CreateMSSQLDataServiceForTests();

            string val = ds.ConvertSimpleValueToQueryValueString(null);

            Assert.Equal("NULL", val);

            val = ds.ConvertSimpleValueToQueryValueString(string.Empty);
            Assert.Equal("NULL", val);

            val = ds.ConvertSimpleValueToQueryValueString("null");
            Assert.Equal("N'null'", val);

            var          dateTime          = new DateTime(2014, 01, 30, 16, 14, 20, 679);
            const string resDateTimeString = "'20140130 16:14:20.679'";

            val = ds.ConvertSimpleValueToQueryValueString(dateTime);
            Assert.Equal(resDateTimeString, val);

            var sysNullableDateTime = new DateTime?(dateTime);

            val = ds.ConvertSimpleValueToQueryValueString(sysNullableDateTime);
            Assert.Equal(resDateTimeString, val);

            var caseNullableDateTime = new NullableDateTime {
                Value = dateTime
            };

            val = ds.ConvertSimpleValueToQueryValueString(caseNullableDateTime);
            Assert.Equal(resDateTimeString, val);

            int intVal = 5;

            val = ds.ConvertSimpleValueToQueryValueString(intVal);
            Assert.Equal(intVal.ToString(CultureInfo.InvariantCulture), val);
        }
コード例 #15
0
        public void SubtractTimeSpanTest()
        {
            ExecuteInsideSession(() => {
                RunTest <SingleDateTimeEntity>(c => c.DateTime.Subtract(FirstOffset) == FirstDateTime.Subtract(FirstOffset));
                RunTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.Subtract(SecondOffset) == FirstMillisecondDateTime.Subtract(SecondOffset));
                RunTest <SingleDateTimeEntity>(c => c.NullableDateTime.Value.Subtract(FirstOffset) == NullableDateTime.Subtract(FirstOffset));

                RunWrongTest <SingleDateTimeEntity>(c => c.DateTime.Subtract(FirstOffset) == FirstDateTime.Subtract(WrongOffset));
                RunWrongTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.Subtract(SecondOffset) == FirstMillisecondDateTime.Subtract(WrongOffset));
                RunWrongTest <SingleDateTimeEntity>(c => c.NullableDateTime.Value.Subtract(FirstOffset) == NullableDateTime.Subtract(WrongOffset));
            });
        }
コード例 #16
0
 public void SetDateTimeValue(int columnIndex, System.DateTime?value)
 {
     NullableDateTime tempvalue = value.HasValue ? new NullableDateTime(Common.FromTicks(value.Value.Ticks)) : null;
     {
         CommonPINVOKE.DataRow_SetDateTimeValue__SWIG_0(swigCPtr, columnIndex, NullableDateTime.getCPtr(tempvalue));
         if (CommonPINVOKE.SWIGPendingException.Pending)
         {
             throw CommonPINVOKE.SWIGPendingException.Retrieve();
         }
     }
 }
コード例 #17
0
ファイル: FlowImpl.cs プロジェクト: qwinner/NetBPM
		public FlowImpl(String name, FlowImpl parent, ProcessBlockImpl processBlock)
		{
			this._name = name;
			this._start = DateTime.Now;
			this._processInstance = parent.ProcessInstance;
			this._subProcessInstances = null;
			this._parent = parent;
			this._children = null;
			this._logs = new ListSet();
			this._parentReactivation = true;
			CreateAttributeInstances(processBlock.Attributes);
		}
コード例 #18
0
ファイル: FlowImpl.cs プロジェクト: qwinner/NetBPM
		public FlowImpl(String actorId, ProcessInstanceImpl processInstance)
		{
			ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) processInstance.ProcessDefinition;
			this._name = "root";
			this._actorId = actorId;
			this._start = DateTime.Now;
			this._node = processDefinition.StartState;
			this._processInstance = processInstance;
			this._subProcessInstances = null;
			this._parent = null;
			this._children = null;
			this._logs = new ListSet();
			this._parentReactivation = true;
			CreateAttributeInstances(processDefinition.Attributes);
		}
コード例 #19
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(NullableDateTime obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
コード例 #20
0
        public void AddSecondsTest()
        {
            ExecuteInsideSession(() => {
                RunTest <SingleDateTimeEntity>(c => c.DateTime.AddSeconds(1) == FirstDateTime.AddSeconds(1));
                RunTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.AddSeconds(-2) == FirstMillisecondDateTime.AddSeconds(-2));
                RunTest <SingleDateTimeEntity>(c => c.NullableDateTime.Value.AddSeconds(33) == NullableDateTime.AddSeconds(33));

                RunWrongTest <SingleDateTimeEntity>(c => c.DateTime.AddSeconds(1) == FirstDateTime.AddSeconds(2));
                RunWrongTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.AddSeconds(-1) == FirstMillisecondDateTime.AddSeconds(-2));
                RunWrongTest <SingleDateTimeEntity>(c => c.NullableDateTime.Value.AddSeconds(33) == NullableDateTime.AddSeconds(44));
            });
        }
コード例 #21
0
 public static void SetValidationTestResultPaymentAmounts(AdminUserCollection usersToUpdate, NullableDateTime submittedStartDateUTC, NullableDateTime submittedEndDateUTC)
 {
     using (SqlDataReaderWrapper dataReaderWrapper = new SqlDataReaderWrapper(usersToUpdate.Registry.ConnectionStringDefault))
     {
         dataReaderWrapper.ProcedureName = "AdminUser_GetValidationTestResultPaymentAmounts";
         dataReaderWrapper.AddNVarChar("AdminUserXmlGuidList", usersToUpdate.ToXmlGuidList());
         dataReaderWrapper.AddDateTime("SubmittedStartDateUTC", submittedStartDateUTC);
         dataReaderWrapper.AddDateTime("SubmittedEndDateUTC", submittedEndDateUTC);
         dataReaderWrapper.Execute();
         while (dataReaderWrapper.Read())
         {
             AdminUser byProperty = (AdminUser)usersToUpdate.FindByProperty("Id", (object)dataReaderWrapper.GetGuid("AdminUserId"));
             if (byProperty != null)
             {
                 byProperty.ValidationTestResultsTotalMinutesToComplete = dataReaderWrapper.GetInt32("ValidationTestResultsTotalMinutesToComplete");
                 byProperty.ValidationTestResultsPaymentAmount          = byProperty.ValidationPayRateDollarsPerHour * (NullableDecimal)((Decimal)byProperty.ValidationTestResultsTotalMinutesToComplete / new Decimal(60));
             }
         }
     }
 }
        public void NullableDateTimeOrderByMaster()
        {
            ActODataService(args =>
            {
                ExternalLangDef.LanguageDef.DataService = args.DataService;
                NullableDateTime dt1 = (NullableDateTime) new DateTime(2017, 11, 21);
                NullableDateTime dt2 = (NullableDateTime) new DateTime(2017, 10, 21);
                NullableDateTime dt3 = (NullableDateTime) new DateTime(2017, 09, 21);
                NullableDateTime dt4 = (NullableDateTime) new DateTime(2017, 08, 21);
                Лес лес1             = new Лес {
                    Название = "Еловый", ДатаПоследнегоОсмотра = dt1
                };
                Лес лес2 = new Лес {
                    Название = "Сосновый", ДатаПоследнегоОсмотра = dt2
                };
                Лес лес3 = new Лес {
                    Название = "Смешанный", ДатаПоследнегоОсмотра = dt3
                };
                Лес лес4 = new Лес {
                    Название = "Березовый", ДатаПоследнегоОсмотра = dt4
                };
                Медведь медведь1 = new Медведь {
                    Пол = tПол.Мужской, ЛесОбитания = лес1
                };
                Медведь медведь2 = new Медведь {
                    Пол = tПол.Женский, ЛесОбитания = лес2
                };
                Медведь медведь3 = new Медведь {
                    Пол = tПол.Мужской, ЛесОбитания = лес3
                };
                Медведь медведь4 = new Медведь {
                    Пол = tПол.Женский, ЛесОбитания = лес4
                };

                var objs = new DataObject[] { медведь1, медведь2, медведь3, медведь4 };
                args.DataService.UpdateObjects(ref objs);

                string requestUrl;

                // Проверка использования в фильтрации перечислений.
                requestUrl = "http://localhost/odata/Медведьs?$expand=ЛесОбитания($select=ДатаПоследнегоОсмотра)&$orderby=ЛесОбитания/ДатаПоследнегоОсмотра desc";

                // Обращаемся к OData-сервису и обрабатываем ответ.
                using (HttpResponseMessage response = args.HttpClient.GetAsync(requestUrl).Result)
                {
                    // Убедимся, что запрос завершился успешно.
                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);

                    // Получим строку с ответом.
                    string receivedStr = response.Content.ReadAsStringAsync().Result.Beautify();

                    // Преобразуем полученный объект в словарь.
                    Dictionary <string, object> receivedDict = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(receivedStr);

                    Assert.Equal(4, ((ArrayList)receivedDict["value"]).Count);

                    NullableDateTime[] expectedValues = { dt1, dt2, dt3, dt4 };

                    for (int i = 0; i < expectedValues.Length; i++)
                    {
                        var медведь = ((ArrayList)receivedDict["value"])[i];
                        var лес     = ((Dictionary <string, object>)медведь)["ЛесОбитания"];
                        Assert.Equal(expectedValues[i], (NullableDateTime) new DateTimeOffset(DateTime.Parse((string)((Dictionary <string, object>)лес)["ДатаПоследнегоОсмотра"])).UtcDateTime);
                    }
                }
            });
        }
コード例 #23
0
 public static bool Equals(NullableDateTime x, NullableDateTime y)
 {
     if (x.HasValue != y.HasValue) //one is null
         return false;
     else if (x.HasValue) //therefor y also HasValue
         return x.Value == y.Value;
     else //both are null
         return true;
 }
コード例 #24
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TMessage"></typeparam>
 /// <param name="message"></param>
 /// <param name="sendTime"></param>
 /// <returns></returns>
 public static TMessage setSendTime <TMessage>(this TMessage message, NullableDateTime sendTime)
     where TMessage : MessageBase
 {
     message.SendTime = sendTime;
     return(message);
 }
コード例 #25
0
        public void SubtractDateTimeTest()
        {
            Require.ProviderIsNot(StorageProvider.MySql);
            ExecuteInsideSession(() => {
                RunTest <SingleDateTimeEntity>(c => c.DateTime.Subtract(SecondDateTime) == FirstDateTime.Subtract(SecondDateTime));
                RunTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.Subtract(SecondDateTime) == FirstMillisecondDateTime.Subtract(SecondDateTime));
                RunTest <SingleDateTimeEntity>(c => c.NullableDateTime.Value.Subtract(SecondDateTime) == NullableDateTime.Subtract(SecondDateTime));

                RunWrongTest <SingleDateTimeEntity>(c => c.DateTime.Subtract(SecondDateTime) == FirstDateTime.Subtract(WrongDateTime));
                RunWrongTest <SingleDateTimeEntity>(c => c.MillisecondDateTime.Subtract(SecondDateTime) == FirstMillisecondDateTime.Subtract(WrongDateTime));
                RunWrongTest <SingleDateTimeEntity>(c => c.NullableDateTime.Value.Subtract(SecondDateTime) == NullableDateTime.Subtract(WrongDateTime));
            });
        }
コード例 #26
0
ファイル: ProcessInstanceImpl.cs プロジェクト: qwinner/NetBPM
		public ProcessInstanceImpl(String actorId, ProcessDefinitionImpl processDefinition)
		{
			this._start = DateTime.Now;
			this._initiatorActorId = actorId;
			this._processDefinition = processDefinition;
			this._rootFlow = new FlowImpl(actorId, this);
		}
コード例 #27
0
 /// <summary>
 /// Gets all the activity states for an activity
 /// </summary>
 /// <param name="activityId">The activity ID</param>
 /// <param name="actor">The actor</param>
 /// <param name="registrationId">The registration ID</param>
 /// <param name="since">Exclusive start date</param>
 /// <returns>An array of activity state document keys</returns>
 public string[] GetActivityStateIds(string activityId, Actor actor, string registrationId, NullableDateTime since)
 {
     string[] stateIds;
     string getResult;
     TinCanJsonConverter converter = new TinCanJsonConverter();
     NameValueCollection nvc = new NameValueCollection();
     nvc["activityId"] = activityId;
     switch (version)
     {
         case TCAPIVersion.TinCan090:
             nvc["actor"] = converter.SerializeToJSON((Model.TinCan090.Actor)actor);
             break;
         default:
             nvc["actor"] = converter.SerializeToJSON(actor);
             break;
     }
     if (!string.IsNullOrEmpty(registrationId))
         nvc["registrationId"] = registrationId;
     if (since != null)
         nvc["since"] = since.Value.ToString(Constants.ISO8601_DATE_FORMAT);
     getResult = HttpMethods.GetRequest(nvc, endpoint + ACTIVITY_STATE, authentification, versionString);
     stateIds = (string[])converter.DeserializeJSON(getResult, typeof(string[]));
     return stateIds;
 }
コード例 #28
0
 /// <summary>
 /// Retrieves a list of all actor profile document keys
 /// </summary>
 /// <param name="actor">The actor that owns the document keys</param>
 /// <param name="since">Optional start date</param>
 /// <returns>An array of profile document keys</returns>
 public string[] GetActorProfileIds(Actor actor, NullableDateTime since)
 {
     TinCanJsonConverter converter = new TinCanJsonConverter();
     NameValueCollection nvc = new NameValueCollection();
     string[] getResult;
     switch (version)
     {
         case TCAPIVersion.TinCan090:
             nvc["actor"] = converter.SerializeToJSON((Model.TinCan090.Actor)actor);
             break;
         default:
             nvc["actor"] = converter.SerializeToJSON(actor);
             break;
     }
     if (since != null)
         nvc["since"] = since.Value.ToString(Constants.ISO8601_DATE_FORMAT);
     getResult = (string[])converter.DeserializeJSON(HttpMethods.GetRequest(nvc, endpoint + ACTOR_PROFILE, authentification, versionString), typeof(string[]));
     return getResult;
 }
コード例 #29
0
        /// <summary>
        /// Получить объект на заданную дату.
        /// </summary>
        /// <param name="date">Дата на которую следует откатить состояние объекта</param>
        /// <param name="obj">Объект, который откатываем на заданную дату.</param>
        /// <param name="onlySelfObj">Откатывать только сам объект, т.е. в обратное состояния вернутся все собственные поля объекта и все собственные ссылочные объекты(мастра и детейлы) только ключи</param>
        /// <param name="forceNullAgregator">Объект вернётся в состояние сразу после заданной даты.
        ///  Если откатываем создание объекта, то возвращаем путой объект с первичным ключом.
        ///  Если объект был удалён и ведётся аудит удаления, то он будет восстановлен со всеми своими собственными полями, иначе если аудит удаления отключен, у удаленного объекта будет проинициализирован только первичный ключ.
        /// </param>
        public static void GetObjForDate(DateTime date, ref DataObject obj, bool onlySelfObj = true,
                                         bool forceNullAgregator = false)
        {
            if (obj != null)
            {
                var objType = obj.GetType();
                try
                {
                    obj.DisableInitDataCopy();
                    // Не кидается исключение о не существовании объекта, если объект был удалён и ведётся аудит удаления, то он будет восстановлен со всеми своими собственными полями, иначе если аудит удаления отключен, у удаленного объекта будет проинициализирован только первичный ключ.
                    DataServiceFactory.AppDataService.LoadObject(new View(objType, View.ReadType.WithRelated), obj,
                                                                 true, false);
                }
                catch (Exception ex)
                {
                    throw new Exception($"Ошибка при попытке вычитать изменнённый объект из БД. {ex.Message}");
                }

                List <AuditEntity> changedAuditEntity;
                try
                {
                    var lcs = LoadingCustomizationStruct.GetSimpleStruct(typeof(AuditEntity),
                                                                         AuditEntity.Views.AuditEntityE);
                    lcs.LimitFunction = FunctionBuilder.BuildAnd(
                        #pragma warning disable CS0618 // Используем не дженерик вариант, иначе не работает вычитка
                        FunctionBuilder.BuildEquals(nameof(AuditEntity.ObjectPrimaryKey), obj.__PrimaryKey),
                        #pragma warning restore CS0618 // Тип или член устарел
                        FunctionBuilder.BuildGreater <AuditEntity>(x => x.OperationTime, date));
                    // Загружаем изменения строго больше даты на которую хотим откатить => получаем объект в состоянии сразу после этой даты.
                    lcs.ColumnsSort    = new[] { new ColumnsSortDef(nameof(AuditEntity.OperationTime), SortOrder.Desc) };
                    changedAuditEntity =
                        DataServiceFactory.AppDataService.LoadObjects(lcs).Cast <AuditEntity>().ToList();
                }
                catch (Exception ex)
                {
                    throw new Exception(
                              $"Ошибка при попытке загрузить операции изменения {nameof(AuditEntity)} для объекта({obj.__PrimaryKey}). {ex.Message}");
                }

                var auditFieldsLcs = LoadingCustomizationStruct.GetSimpleStruct(typeof(AuditField), ViewForField);
                foreach (var changeEntity in changedAuditEntity)
                {
                    if (changeEntity.OperationType != OperationCreateType)
                    {
                        List <AuditField> changedFields;
                        try
                        {
                            // Загружаем набор изменившихся полей из аудита
                            auditFieldsLcs.LimitFunction =
                                FunctionBuilder.BuildEquals <AuditField>(x => x.AuditEntity, changeEntity);
                            changedFields = DataServiceFactory.AppDataService.LoadObjects(auditFieldsLcs)
                                            .Cast <AuditField>().ToList();
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(
                                      $"Произошла ошибка при попытке получить набор изменений полей для операции аудита:{PKHelper.GetGuidByObject(changeEntity)}. {ex.Message}");
                        }

                        //Берём только изменения, вспомогательные объекты LinkedPrimaryKey остаются в основном списке.
                        var onlySelfChangedFields = changedFields.Where(y => y.MainChange == null);
                        foreach (var changedField in onlySelfChangedFields)
                        {
                            var mainChange =
                                changedFields.FirstOrDefault(x => PKHelper.EQPK(x.MainChange, changedField));
                            if (mainChange == null)
                            {
                                //Если основного изменения нет, то это обычное поле
                                var propertyInfo = objType.GetProperty(changedField.Field);
                                if (propertyInfo != null)
                                {
                                    var    typeprop = propertyInfo.PropertyType;
                                    object value    = null;
                                    try
                                    {
                                        if (changedField.OldValue != null)
                                        {
                                            if (typeprop.IsEnum)
                                            {
                                                value = EnumCaption.GetValueFor(changedField.OldValue, typeprop);
                                            }
                                            else if (typeprop == typeof(NullableDateTime))
                                            {
                                                value = NullableDateTime.Parse(changedField.OldValue);
                                            }
                                            else if (typeprop == typeof(NullableInt))
                                            {
                                                value = NullableInt.Parse(changedField.OldValue);
                                            }
                                            else
                                            {
                                                value = Convert.ChangeType(changedField.OldValue, typeprop, CultureInfo.InvariantCulture);
                                            }
                                        }

                                        propertyInfo.SetValue(obj, value);
                                    }
                                    catch (Exception ex)
                                    {
                                        var errorText = value != null
                                            ? $"AuditField:{PKHelper.GetGuidByObject(changedField)} Ошибка при попытке установить значение поля {value} в объект {objType.Name}:{PKHelper.GetGuidByObject(obj)} поле {changedField.Field}"
                                            : $"AuditField:{PKHelper.GetGuidByObject(changedField)} Ошибка при попытке преобразовать значение поля {changedField.OldValue} в тип {typeprop.Name}";
                                        throw new Exception($"{errorText}. {ex.Message}");
                                    }
                                }
                                else
                                {
                                    throw new Exception(
                                              $"Ошибка - не найдено поле {changedField.Field} в объекте {objType.Name}.");
                                }
                            }
                            else
                            {
                                // Есть основное изменение, значит это изменение ссылочного объекта.
                                // Только если изменилась ссылка
                                if (mainChange.OldValue != mainChange.NewValue)
                                {
                                    // В аудите детейл отличается от мастера тем, что у него приписывается в скобках позиция
                                    if (Regex.IsMatch(changedField.Field, "[ ][(][0-9]+[)]$"))
                                    {
                                        // Это изменение детейла объекта.
                                        var separateIndex       = changedField.Field.IndexOf(" ", StringComparison.Ordinal);
                                        var detailNameFromField = changedField.Field.Substring(0, separateIndex);
                                        var propertyInfo        = objType.GetProperty(detailNameFromField);
                                        if (propertyInfo != null)
                                        {
                                            if (propertyInfo.GetValue(obj) is DetailArray detailValue)
                                            {
                                                if (changedField.OldValue == "-NULL-")
                                                {
                                                    var key = new KeyGuid(mainChange.NewValue);
                                                    try
                                                    {
                                                        detailValue.RemoveByKey(key);
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        throw new Exception(
                                                                  $"Ошибка при попытке удалить объект с ключом {key} из детейла {detailNameFromField} в объекте {objType.Name}. {ex.Message}");
                                                    }
                                                }
                                                else
                                                {
                                                    var detailItemType = detailValue.ItemType;
                                                    var oldDetailObj   = Helper.CreateDataObject(detailItemType,
                                                                                                 mainChange.OldValue);
                                                    try
                                                    {
                                                        detailValue.AddObject(oldDetailObj);
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        throw new Exception(
                                                                  $"Ошибка при добавить объект с ключом {PKHelper.GetGuidByObject(oldDetailObj)} в детейл {detailNameFromField} в объекте {objType.Name}. {ex.Message}");
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            throw new Exception(
                                                      $"Ошибка - не найден детейл {detailNameFromField} в объекте {objType.Name}.");
                                        }
                                    }
                                    else
                                    {
                                        // Это изменение мастера объекта.
                                        var propertyInfo = objType.GetProperty(changedField.Field);
                                        if (propertyInfo != null)
                                        {
                                            //Это свойство является агрегатором, для детейла
                                            var itIsAgregator =
                                                propertyInfo.GetCustomAttribute <AgregatorAttribute>() != null;
                                            if (changedField.OldValue == "-NULL-" ||
                                                forceNullAgregator && itIsAgregator)
                                            {
                                                //Если свойство является агрегатором для детейла, то в последующих витках рекурсии всегда возвращаем нулл для такого поля, во избежание циклических ссылок.
                                                propertyInfo.SetValue(obj, null);
                                            }
                                            else
                                            {
                                                var typeprop     = propertyInfo.PropertyType;
                                                var oldMasterObj =
                                                    Helper.CreateDataObject(typeprop, mainChange.OldValue);
                                                try
                                                {
                                                    propertyInfo.SetValue(obj, oldMasterObj);
                                                }
                                                catch (Exception ex)
                                                {
                                                    throw new Exception(
                                                              $"Ошибка при попытке установить свойство мастера {changedField.Field} в объекте {objType.Name}. {ex.Message}");
                                                }
                                            }
                                        }
                                        else
                                        {
                                            throw new Exception(
                                                      $"Ошибка - не найден мастер {changedField.Field} в объекте {objType.Name}.");
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        // Если откатываем создание объекта, то возвращаем путой объект с первичным ключом.
                        obj = Helper.CreateDataObject(objType, obj.__PrimaryKey);
                    }
                }

                // На этом этапе основной объект и все его собственные поля и зависимые сущности возвращены на дату
                // Получаем мастера и откатываем их поля, рекурсивно вызывая этот метод
                // Получаем детейлы объекта и откатываем их поля, рекурсивно вызывая этот метод
                if (!onlySelfObj && changedAuditEntity.Any())
                {
                    var objProperties = objType.GetProperties();
                    foreach (var property in objProperties)
                    {
                        var typeprop = property.PropertyType;
                        if (typeprop.IsSubclassOf(typeof(DataObject)))
                        {
                            //Перебираем все мастера
                            var masterValue = property.GetValue(obj) as DataObject;
                            GetObjForDate(date, ref masterValue, false, true);
                        }
                        else if (typeprop.IsSubclassOf(typeof(DetailArray)))
                        {
                            //Перебираем все детейлы
                            if (property.GetValue(obj) is DetailArray detailValue)
                            {
                                var detailObjects = detailValue.GetAllObjects();
                                foreach (var dataObject in detailObjects)
                                {
                                    var currentObj = dataObject;
                                    GetObjForDate(date, ref currentObj, false, true);
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #30
0
 public bool Equals(NullableDateTime x)
 {
     return Equals(this, x);
 }
コード例 #31
0
ファイル: Cheque.cs プロジェクト: solutema/ultralight
 public Cheque(Lfx.Data.Connection dataBase, decimal importe, int numero, string emisor, NullableDateTime fechaEmision, NullableDateTime fechaCobro, Bancos.Banco banco)
     : this(dataBase)
 {
     this.Importe      = importe;
     this.Numero       = numero;
     this.Emisor       = emisor;
     this.FechaEmision = fechaEmision;
     this.FechaCobro   = fechaCobro;
     this.Banco        = banco;
 }
コード例 #32
0
        public void ActorProfileTest()
        {
            TinCanJsonConverter converter = new TinCanJsonConverter();
            TCAPI target = new TCAPI(new Uri("http://cloud.scorm.com/tc/public"), new BasicHTTPAuth("CZSWMUZPSE", "vwiuflgsY22FDXpHA4lwwe5hrnUXvcyJjW3fDrpH"));
            Actor actor  = new Actor("Mufasa", "mailto:[email protected]");

            string[] profileIds      = { "The Lion King", "The Fallen King", "The New King" };
            string[] profileContents =
            {
                "Mufasa rules his country as a proud and fair king of lions, celebrating his recently newborn son Simba.",
                "Scar kills Mufasa, simply muttering the words 'Long Live the King'",
                "Simba finally realizes he must follow in his fathers footsteps to save the kingdom from the evil Scar."
            };

            // Clear all existing profiles.
            target.DeleteAllActorProfile(actor);

            NullableDateTime since = null;

            string[] actual;
            actual = target.GetActorProfileIds(actor, since);

            Assert.AreEqual(0, actual.Length);

            /* Save a new actor profile */
            ActorProfile p1 = new ActorProfile();

            p1.Actor     = actor;
            p1.ProfileId = profileIds[0];
            p1.Body      = profileContents[0];
            ActorProfile pp = new ActorProfile();

            pp.ProfileId = profileIds[0];
            pp.Actor     = actor;
            pp.Body      = profileContents[0];
            target.SaveActorProfile(p1, pp, true);
            actual = target.GetActorProfileIds(actor, since);

            Assert.AreEqual(1, actual.Length);

            p1.ProfileId = profileIds[1];
            p1.Body      = profileContents[1];
            pp.ProfileId = profileIds[1];
            target.SaveActorProfile(p1, pp, true);
            actual = target.GetActorProfileIds(actor, since);

            Assert.AreEqual(2, actual.Length);

            p1.ProfileId = profileIds[2];
            p1.Body      = profileContents[2];
            pp.ProfileId = profileIds[2];
            target.SaveActorProfile(p1, pp, true);
            actual = target.GetActorProfileIds(actor);

            Assert.AreEqual(3, actual.Length);

            // Ensure all the posted data matches

            ActorProfile pResult = target.GetActorProfile(actor, profileIds[0]);

            Assert.AreEqual(profileContents[0], pResult.Body);

            pResult = target.GetActorProfile(actor, profileIds[1]);
            Assert.AreEqual(profileContents[1], pResult.Body);

            pResult = target.GetActorProfile(actor, profileIds[2]);
            Assert.AreEqual(profileContents[2], pResult.Body);

            target.DeleteActorProfile(actor, profileIds[0]);
            actual = target.GetActorProfileIds(actor);

            Assert.AreEqual(2, actual.Length);

            target.DeleteAllActorProfile(actor);
            actual = target.GetActorProfileIds(actor);

            Assert.AreEqual(0, actual.Length);
        }
コード例 #33
0
 /// <summary>
 /// Gets all of the profile document keys for an activity
 /// </summary>
 /// <param name="activityId">The activity ID</param>
 /// <param name="since">Optional start date parameter</param>
 /// <returns></returns>
 public string[] GetActivityProfileIds(string activityId, NullableDateTime since)
 {
     string[] profileIds;
     string getResult;
     TinCanJsonConverter converter = new TinCanJsonConverter();
     NameValueCollection nvc = new NameValueCollection();
     nvc["activityId"] = activityId;
     if (since != null)
         nvc["since"] = since.Value.ToString(Constants.ISO8601_DATE_FORMAT);
     getResult = HttpMethods.GetRequest(nvc, endpoint + ACTIVITY_PROFILE, authentification, versionString);
     profileIds = (string[])converter.DeserializeJSON(getResult, typeof(string[]));
     return profileIds;
 }
コード例 #34
0
 /// <summary>
 /// Gets all the activity states for an activity
 /// </summary>
 /// <param name="activityId">The activity ID</param>
 /// <param name="actor">The actor</param>
 /// <param name="since">Exclusive start date</param>
 /// <returns>An array of activity state document keys</returns>
 public string[] GetActivityStateIds(string activityId, Actor actor, NullableDateTime since)
 {
     return GetActivityStateIds(activityId, actor, null, since);
 }
コード例 #35
0
        public void TestFilterNullable()
        {
            ActODataService(args =>
            {
                NullableDateTime date = new NullableDateTime();
                date.Value            = new DateTimeOffset(DateTime.Now).UtcDateTime;
                NullableInt i         = new NullableInt();
                i.Value                     = 7;
                NullableDecimal d           = new NullableDecimal();
                d.Value                     = new decimal(777.777);
                string prevDecimal          = (d.Value - 1).ToString().Replace(",", ".");
                string nextDecimal          = (d.Value + 1).ToString().Replace(",", ".");
                string prevDate             = $"{date.Value.AddDays(-1).ToString("yyyy-MM-ddTHH:mm:ss.fff")}%2B05:00";
                string nextDate             = $"{date.Value.AddDays(1).ToString("yyyy-MM-ddTHH:mm:ss.fff")}%2B05:00";
                КлассСМножествомТипов класс = new КлассСМножествомТипов()
                {
                    PropertyStormnetNullableInt = i, PropertyStormnetNullableDecimal = d, PropertyStormnetNullableDateTime = date, PropertyDateTime = date.Value
                };
                var objs = new DataObject[] { класс };
                args.DataService.UpdateObjects(ref objs);
                string requestUrl;

                /*
                 * // Проверка использования фильтрации для типа ICSSoft.STORMNET.UserDataTypes.NullableDateTime.
                 * requestUrl = $"http://localhost/odata/КлассСМножествомТиповs?$filter=(PropertyStormnetNullableDateTime gt {prevDate}) and (PropertyStormnetNullableDateTime lt {nextDate})";
                 *
                 * // Обращаемся к OData-сервису и обрабатываем ответ.
                 * using (HttpResponseMessage response = args.HttpClient.GetAsync(requestUrl).Result)
                 * {
                 *  // Убедимся, что запрос завершился успешно.
                 *  Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                 *
                 *  // Получим строку с ответом.
                 *  string receivedStr = response.Content.ReadAsStringAsync().Result.Beautify();
                 *
                 *  // Преобразуем полученный объект в словарь.
                 *  Dictionary<string, object> receivedDict = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(receivedStr);
                 *
                 *  Assert.Equal(1, ((ArrayList)receivedDict["value"]).Count);
                 * }
                 *
                 * // Проверка использования фильтрации для типа ICSSoft.STORMNET.UserDataTypes.NullableDecimal.
                 * requestUrl = $"http://localhost/odata/КлассСМножествомТиповs?$filter=(PropertyStormnetNullableDecimal gt {prevDecimal}M) and (PropertyStormnetNullableDecimal lt {nextDecimal})";
                 *
                 * // Обращаемся к OData-сервису и обрабатываем ответ.
                 * using (HttpResponseMessage response = args.HttpClient.GetAsync(requestUrl).Result)
                 * {
                 *  // Убедимся, что запрос завершился успешно.
                 *  Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                 *
                 *  // Получим строку с ответом.
                 *  string receivedStr = response.Content.ReadAsStringAsync().Result.Beautify();
                 *
                 *  // Преобразуем полученный объект в словарь.
                 *  Dictionary<string, object> receivedDict = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(receivedStr);
                 *
                 *  Assert.Equal(1, ((ArrayList)receivedDict["value"]).Count);
                 * }
                 */
                // Проверка использования фильтрации для типа ICSSoft.STORMNET.UserDataTypes.NullableInt.
                requestUrl = $"http://localhost/odata/КлассСМножествомТиповs?$filter=PropertyStormnetNullableInt eq {i.Value.ToString()}";

                // Обращаемся к OData-сервису и обрабатываем ответ.
                using (HttpResponseMessage response = args.HttpClient.GetAsync(requestUrl).Result)
                {
                    // Убедимся, что запрос завершился успешно.
                    Assert.Equal(HttpStatusCode.OK, response.StatusCode);

                    // Получим строку с ответом.
                    string receivedStr = response.Content.ReadAsStringAsync().Result.Beautify();

                    // Преобразуем полученный объект в словарь.
                    Dictionary <string, object> receivedDict = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(receivedStr);

                    Assert.Equal(1, ((ArrayList)receivedDict["value"]).Count);
                }
            });
        }