/// <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(VIndividualDemographics entity, string propertyName) { switch (propertyName) { case "CustomerId": return(entity.CustomerId); case "TotalPurchaseYtd": return(entity.TotalPurchaseYtd); case "DateFirstPurchase": return(entity.DateFirstPurchase); case "BirthDate": return(entity.BirthDate); case "MaritalStatus": return(entity.MaritalStatus); case "YearlyIncome": return(entity.YearlyIncome); case "Gender": return(entity.Gender); case "TotalChildren": return(entity.TotalChildren); case "NumberChildrenAtHome": return(entity.NumberChildrenAtHome); case "Education": return(entity.Education); case "Occupation": return(entity.Occupation); case "HomeOwnerFlag": return(entity.HomeOwnerFlag); case "NumberCarsOwned": return(entity.NumberCarsOwned); } return(null); }
///<summary> /// A simple factory method to create a new <see cref="VIndividualDemographics"/> instance. ///</summary> ///<param name="_customerId"></param> ///<param name="_totalPurchaseYtd"></param> ///<param name="_dateFirstPurchase"></param> ///<param name="_birthDate"></param> ///<param name="_maritalStatus"></param> ///<param name="_yearlyIncome"></param> ///<param name="_gender"></param> ///<param name="_totalChildren"></param> ///<param name="_numberChildrenAtHome"></param> ///<param name="_education"></param> ///<param name="_occupation"></param> ///<param name="_homeOwnerFlag"></param> ///<param name="_numberCarsOwned"></param> public static VIndividualDemographics CreateVIndividualDemographics(System.Int32 _customerId, System.Decimal?_totalPurchaseYtd, System.DateTime?_dateFirstPurchase, System.DateTime?_birthDate, System.String _maritalStatus, System.String _yearlyIncome, System.String _gender, System.Int32?_totalChildren, System.Int32?_numberChildrenAtHome, System.String _education, System.String _occupation, System.Boolean?_homeOwnerFlag, System.Int32?_numberCarsOwned) { VIndividualDemographics newVIndividualDemographics = new VIndividualDemographics(); newVIndividualDemographics.CustomerId = _customerId; newVIndividualDemographics.TotalPurchaseYtd = _totalPurchaseYtd; newVIndividualDemographics.DateFirstPurchase = _dateFirstPurchase; newVIndividualDemographics.BirthDate = _birthDate; newVIndividualDemographics.MaritalStatus = _maritalStatus; newVIndividualDemographics.YearlyIncome = _yearlyIncome; newVIndividualDemographics.Gender = _gender; newVIndividualDemographics.TotalChildren = _totalChildren; newVIndividualDemographics.NumberChildrenAtHome = _numberChildrenAtHome; newVIndividualDemographics.Education = _education; newVIndividualDemographics.Occupation = _occupation; newVIndividualDemographics.HomeOwnerFlag = _homeOwnerFlag; newVIndividualDemographics.NumberCarsOwned = _numberCarsOwned; return(newVIndividualDemographics); }
///<summary> /// Returns a Typed VIndividualDemographicsBase Entity ///</summary> public virtual VIndividualDemographicsBase Copy() { //shallow copy entity VIndividualDemographics copy = new VIndividualDemographics(); copy.CustomerId = this.CustomerId; copy.TotalPurchaseYtd = this.TotalPurchaseYtd; copy.DateFirstPurchase = this.DateFirstPurchase; copy.BirthDate = this.BirthDate; copy.MaritalStatus = this.MaritalStatus; copy.YearlyIncome = this.YearlyIncome; copy.Gender = this.Gender; copy.TotalChildren = this.TotalChildren; copy.NumberChildrenAtHome = this.NumberChildrenAtHome; copy.Education = this.Education; copy.Occupation = this.Occupation; copy.HomeOwnerFlag = this.HomeOwnerFlag; copy.NumberCarsOwned = this.NumberCarsOwned; copy.AcceptChanges(); return((VIndividualDemographics)copy); }
/// <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(VIndividualDemographics entity, string propertyName) { switch (propertyName) { case "CustomerId": return entity.CustomerId; case "TotalPurchaseYtd": return entity.TotalPurchaseYtd; case "DateFirstPurchase": return entity.DateFirstPurchase; case "BirthDate": return entity.BirthDate; case "MaritalStatus": return entity.MaritalStatus; case "YearlyIncome": return entity.YearlyIncome; case "Gender": return entity.Gender; case "TotalChildren": return entity.TotalChildren; case "NumberChildrenAtHome": return entity.NumberChildrenAtHome; case "Education": return entity.Education; case "Occupation": return entity.Occupation; case "HomeOwnerFlag": return entity.HomeOwnerFlag; case "NumberCarsOwned": return entity.NumberCarsOwned; } return null; }
///<summary> /// Returns a Typed VIndividualDemographicsBase Entity ///</summary> public virtual VIndividualDemographicsBase Copy() { //shallow copy entity VIndividualDemographics copy = new VIndividualDemographics(); copy.CustomerId = this.CustomerId; copy.TotalPurchaseYtd = this.TotalPurchaseYtd; copy.DateFirstPurchase = this.DateFirstPurchase; copy.BirthDate = this.BirthDate; copy.MaritalStatus = this.MaritalStatus; copy.YearlyIncome = this.YearlyIncome; copy.Gender = this.Gender; copy.TotalChildren = this.TotalChildren; copy.NumberChildrenAtHome = this.NumberChildrenAtHome; copy.Education = this.Education; copy.Occupation = this.Occupation; copy.HomeOwnerFlag = this.HomeOwnerFlag; copy.NumberCarsOwned = this.NumberCarsOwned; copy.AcceptChanges(); return (VIndividualDemographics)copy; }
///<summary> /// A simple factory method to create a new <see cref="VIndividualDemographics"/> instance. ///</summary> ///<param name="_customerId"></param> ///<param name="_totalPurchaseYtd"></param> ///<param name="_dateFirstPurchase"></param> ///<param name="_birthDate"></param> ///<param name="_maritalStatus"></param> ///<param name="_yearlyIncome"></param> ///<param name="_gender"></param> ///<param name="_totalChildren"></param> ///<param name="_numberChildrenAtHome"></param> ///<param name="_education"></param> ///<param name="_occupation"></param> ///<param name="_homeOwnerFlag"></param> ///<param name="_numberCarsOwned"></param> public static VIndividualDemographics CreateVIndividualDemographics(System.Int32 _customerId, System.Decimal? _totalPurchaseYtd, System.DateTime? _dateFirstPurchase, System.DateTime? _birthDate, System.String _maritalStatus, System.String _yearlyIncome, System.String _gender, System.Int32? _totalChildren, System.Int32? _numberChildrenAtHome, System.String _education, System.String _occupation, System.Boolean? _homeOwnerFlag, System.Int32? _numberCarsOwned) { VIndividualDemographics newVIndividualDemographics = new VIndividualDemographics(); newVIndividualDemographics.CustomerId = _customerId; newVIndividualDemographics.TotalPurchaseYtd = _totalPurchaseYtd; newVIndividualDemographics.DateFirstPurchase = _dateFirstPurchase; newVIndividualDemographics.BirthDate = _birthDate; newVIndividualDemographics.MaritalStatus = _maritalStatus; newVIndividualDemographics.YearlyIncome = _yearlyIncome; newVIndividualDemographics.Gender = _gender; newVIndividualDemographics.TotalChildren = _totalChildren; newVIndividualDemographics.NumberChildrenAtHome = _numberChildrenAtHome; newVIndividualDemographics.Education = _education; newVIndividualDemographics.Occupation = _occupation; newVIndividualDemographics.HomeOwnerFlag = _homeOwnerFlag; newVIndividualDemographics.NumberCarsOwned = _numberCarsOwned; return newVIndividualDemographics; }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static VIndividualDemographics Convert(WsProxy.VIndividualDemographics item) { VIndividualDemographics outItem = new VIndividualDemographics(); outItem.CustomerId = item.CustomerId; outItem.TotalPurchaseYtd = item.TotalPurchaseYtd; outItem.DateFirstPurchase = item.DateFirstPurchase; outItem.BirthDate = item.BirthDate; outItem.MaritalStatus = item.MaritalStatus; outItem.YearlyIncome = item.YearlyIncome; outItem.Gender = item.Gender; outItem.TotalChildren = item.TotalChildren; outItem.NumberChildrenAtHome = item.NumberChildrenAtHome; outItem.Education = item.Education; outItem.Occupation = item.Occupation; outItem.HomeOwnerFlag = item.HomeOwnerFlag; outItem.NumberCarsOwned = item.NumberCarsOwned; outItem.AcceptChanges(); return outItem; }
/// <summary> /// Deserialize the mock VIndividualDemographics entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VIndividualDemographics.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VIndividualDemographics)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VIndividualDemographics) mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }
///<summary> /// Returns a Typed VIndividualDemographics Entity with mock values. ///</summary> static public VIndividualDemographics CreateMockInstance() { VIndividualDemographics mock = new VIndividualDemographics(); mock.CustomerId = TestUtility.Instance.RandomNumber(); mock.TotalPurchaseYtd = TestUtility.Instance.RandomShort(); mock.DateFirstPurchase = TestUtility.Instance.RandomDateTime(); mock.BirthDate = TestUtility.Instance.RandomDateTime(); mock.MaritalStatus = TestUtility.Instance.RandomString(1, false);; mock.YearlyIncome = TestUtility.Instance.RandomString(14, false);; mock.Gender = TestUtility.Instance.RandomString(1, false);; mock.TotalChildren = TestUtility.Instance.RandomNumber(); mock.NumberChildrenAtHome = TestUtility.Instance.RandomNumber(); mock.Education = TestUtility.Instance.RandomString(14, false);; mock.Occupation = TestUtility.Instance.RandomString(14, false);; mock.HomeOwnerFlag = TestUtility.Instance.RandomBoolean(); mock.NumberCarsOwned = TestUtility.Instance.RandomNumber(); return (VIndividualDemographics)mock; }