Inheritance: VAdditionalContactInfoBase
コード例 #1
0
		/// <summary>
		/// Deserialize the mock VAdditionalContactInfo entity from a temporary file.
		/// </summary>
		private void Step_7_DeserializeEntity_Generated()
		{
			string fileName = "temp_VAdditionalContactInfo.xml";
		
			XmlSerializer mySerializer = new XmlSerializer(typeof(VAdditionalContactInfo)); 
			System.IO.FileStream myFileStream = new System.IO.FileStream(fileName,  System.IO.FileMode.Open); 
			mock = (VAdditionalContactInfo) mySerializer.Deserialize(myFileStream);
			myFileStream.Close();
			System.IO.File.Delete(fileName);
			
			System.Console.WriteLine("mock correctly deserialized from a temporary file.");
		}
コード例 #2
0
		///<summary>
		///  Returns a Typed VAdditionalContactInfo Entity with mock values.
		///</summary>
		static public VAdditionalContactInfo CreateMockInstance()
		{		
			VAdditionalContactInfo mock = new VAdditionalContactInfo();
						
			mock.ContactId = TestUtility.Instance.RandomNumber();
			mock.FirstName = TestUtility.Instance.RandomString(24, false);;
			mock.MiddleName = TestUtility.Instance.RandomString(24, false);;
			mock.LastName = TestUtility.Instance.RandomString(24, false);;
			mock.TelephoneNumber = TestUtility.Instance.RandomString(24, false);;
			mock.TelephoneSpecialInstructions = TestUtility.Instance.RandomString(2, false);;
			mock.Street = TestUtility.Instance.RandomString(24, false);;
			mock.City = TestUtility.Instance.RandomString(24, false);;
			mock.StateProvince = TestUtility.Instance.RandomString(24, false);;
			mock.PostalCode = TestUtility.Instance.RandomString(24, false);;
			mock.CountryRegion = TestUtility.Instance.RandomString(24, false);;
			mock.HomeAddressSpecialInstructions = TestUtility.Instance.RandomString(2, false);;
			mock.EmailAddress = TestUtility.Instance.RandomString(63, false);;
			mock.EmailSpecialInstructions = TestUtility.Instance.RandomString(2, false);;
			mock.EmailTelephoneNumber = TestUtility.Instance.RandomString(24, false);;
			mock.Rowguid = Guid.NewGuid();
			mock.ModifiedDate = TestUtility.Instance.RandomDateTime();
		   return (VAdditionalContactInfo)mock;
		}
コード例 #3
0
		///<summary>
		///  Returns a Typed VAdditionalContactInfoBase Entity 
		///</summary>
		public virtual VAdditionalContactInfoBase Copy()
		{
			//shallow copy entity
			VAdditionalContactInfo copy = new VAdditionalContactInfo();
				copy.ContactId = this.ContactId;
				copy.FirstName = this.FirstName;
				copy.MiddleName = this.MiddleName;
				copy.LastName = this.LastName;
				copy.TelephoneNumber = this.TelephoneNumber;
				copy.TelephoneSpecialInstructions = this.TelephoneSpecialInstructions;
				copy.Street = this.Street;
				copy.City = this.City;
				copy.StateProvince = this.StateProvince;
				copy.PostalCode = this.PostalCode;
				copy.CountryRegion = this.CountryRegion;
				copy.HomeAddressSpecialInstructions = this.HomeAddressSpecialInstructions;
				copy.EmailAddress = this.EmailAddress;
				copy.EmailSpecialInstructions = this.EmailSpecialInstructions;
				copy.EmailTelephoneNumber = this.EmailTelephoneNumber;
				copy.Rowguid = this.Rowguid;
				copy.ModifiedDate = this.ModifiedDate;
			copy.AcceptChanges();
			return (VAdditionalContactInfo)copy;
		}
コード例 #4
0
		///<summary>
		/// A simple factory method to create a new <see cref="VAdditionalContactInfo"/> instance.
		///</summary>
		///<param name="_contactId"></param>
		///<param name="_firstName"></param>
		///<param name="_middleName"></param>
		///<param name="_lastName"></param>
		///<param name="_telephoneNumber"></param>
		///<param name="_telephoneSpecialInstructions"></param>
		///<param name="_street"></param>
		///<param name="_city"></param>
		///<param name="_stateProvince"></param>
		///<param name="_postalCode"></param>
		///<param name="_countryRegion"></param>
		///<param name="_homeAddressSpecialInstructions"></param>
		///<param name="_emailAddress"></param>
		///<param name="_emailSpecialInstructions"></param>
		///<param name="_emailTelephoneNumber"></param>
		///<param name="_rowguid"></param>
		///<param name="_modifiedDate"></param>
		public static VAdditionalContactInfo CreateVAdditionalContactInfo(System.Int32 _contactId, System.String _firstName, System.String _middleName, System.String _lastName, System.String _telephoneNumber, System.String _telephoneSpecialInstructions, System.String _street, System.String _city, System.String _stateProvince, System.String _postalCode, System.String _countryRegion, System.String _homeAddressSpecialInstructions, System.String _emailAddress, System.String _emailSpecialInstructions, System.String _emailTelephoneNumber, System.Guid _rowguid, System.DateTime _modifiedDate)
		{
			VAdditionalContactInfo newVAdditionalContactInfo = new VAdditionalContactInfo();
			newVAdditionalContactInfo.ContactId = _contactId;
			newVAdditionalContactInfo.FirstName = _firstName;
			newVAdditionalContactInfo.MiddleName = _middleName;
			newVAdditionalContactInfo.LastName = _lastName;
			newVAdditionalContactInfo.TelephoneNumber = _telephoneNumber;
			newVAdditionalContactInfo.TelephoneSpecialInstructions = _telephoneSpecialInstructions;
			newVAdditionalContactInfo.Street = _street;
			newVAdditionalContactInfo.City = _city;
			newVAdditionalContactInfo.StateProvince = _stateProvince;
			newVAdditionalContactInfo.PostalCode = _postalCode;
			newVAdditionalContactInfo.CountryRegion = _countryRegion;
			newVAdditionalContactInfo.HomeAddressSpecialInstructions = _homeAddressSpecialInstructions;
			newVAdditionalContactInfo.EmailAddress = _emailAddress;
			newVAdditionalContactInfo.EmailSpecialInstructions = _emailSpecialInstructions;
			newVAdditionalContactInfo.EmailTelephoneNumber = _emailTelephoneNumber;
			newVAdditionalContactInfo.Rowguid = _rowguid;
			newVAdditionalContactInfo.ModifiedDate = _modifiedDate;
			return newVAdditionalContactInfo;
		}
コード例 #5
0
		/// <summary>
		/// Gets the property value by name.
		/// </summary>
		/// <param name="entity">The entity.</param>
		/// <param name="propertyName">Name of the property.</param>
		/// <returns></returns>
		public static object GetPropertyValueByName(VAdditionalContactInfo entity, string propertyName)
		{
			switch (propertyName)
			{
				case "ContactId":
					return entity.ContactId;
				case "FirstName":
					return entity.FirstName;
				case "MiddleName":
					return entity.MiddleName;
				case "LastName":
					return entity.LastName;
				case "TelephoneNumber":
					return entity.TelephoneNumber;
				case "TelephoneSpecialInstructions":
					return entity.TelephoneSpecialInstructions;
				case "Street":
					return entity.Street;
				case "City":
					return entity.City;
				case "StateProvince":
					return entity.StateProvince;
				case "PostalCode":
					return entity.PostalCode;
				case "CountryRegion":
					return entity.CountryRegion;
				case "HomeAddressSpecialInstructions":
					return entity.HomeAddressSpecialInstructions;
				case "EmailAddress":
					return entity.EmailAddress;
				case "EmailSpecialInstructions":
					return entity.EmailSpecialInstructions;
				case "EmailTelephoneNumber":
					return entity.EmailTelephoneNumber;
				case "Rowguid":
					return entity.Rowguid;
				case "ModifiedDate":
					return entity.ModifiedDate;
			}
			return null;
		}
		/// <summary>
		/// Convert a nettiers collection to the ws proxy collection.
		/// </summary>
		public static VAdditionalContactInfo Convert(WsProxy.VAdditionalContactInfo item)
		{			
			VAdditionalContactInfo outItem = new VAdditionalContactInfo();			
			outItem.ContactId = item.ContactId;
			outItem.FirstName = item.FirstName;
			outItem.MiddleName = item.MiddleName;
			outItem.LastName = item.LastName;
			outItem.TelephoneNumber = item.TelephoneNumber;
			outItem.TelephoneSpecialInstructions = item.TelephoneSpecialInstructions;
			outItem.Street = item.Street;
			outItem.City = item.City;
			outItem.StateProvince = item.StateProvince;
			outItem.PostalCode = item.PostalCode;
			outItem.CountryRegion = item.CountryRegion;
			outItem.HomeAddressSpecialInstructions = item.HomeAddressSpecialInstructions;
			outItem.EmailAddress = item.EmailAddress;
			outItem.EmailSpecialInstructions = item.EmailSpecialInstructions;
			outItem.EmailTelephoneNumber = item.EmailTelephoneNumber;
			outItem.Rowguid = item.Rowguid;
			outItem.ModifiedDate = item.ModifiedDate;
							
			outItem.AcceptChanges();			
			return outItem;
		}