///<summary> /// Returns a Typed VVendorBase Entity ///</summary> public virtual VVendorBase Copy() { //shallow copy entity VVendor copy = new VVendor(); copy.VendorId = this.VendorId; copy.Name = this.Name; copy.ContactType = this.ContactType; copy.Title = this.Title; copy.FirstName = this.FirstName; copy.MiddleName = this.MiddleName; copy.LastName = this.LastName; copy.Suffix = this.Suffix; copy.Phone = this.Phone; copy.EmailAddress = this.EmailAddress; copy.EmailPromotion = this.EmailPromotion; copy.AddressLine1 = this.AddressLine1; copy.AddressLine2 = this.AddressLine2; copy.City = this.City; copy.StateProvinceName = this.StateProvinceName; copy.PostalCode = this.PostalCode; copy.CountryRegionName = this.CountryRegionName; copy.AcceptChanges(); return((VVendor)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(VVendor entity, string propertyName) { switch (propertyName) { case "VendorId": return(entity.VendorId); case "Name": return(entity.Name); case "ContactType": return(entity.ContactType); case "Title": return(entity.Title); case "FirstName": return(entity.FirstName); case "MiddleName": return(entity.MiddleName); case "LastName": return(entity.LastName); case "Suffix": return(entity.Suffix); case "Phone": return(entity.Phone); case "EmailAddress": return(entity.EmailAddress); case "EmailPromotion": return(entity.EmailPromotion); case "AddressLine1": return(entity.AddressLine1); case "AddressLine2": return(entity.AddressLine2); case "City": return(entity.City); case "StateProvinceName": return(entity.StateProvinceName); case "PostalCode": return(entity.PostalCode); case "CountryRegionName": return(entity.CountryRegionName); } return(null); }
///<summary> /// A simple factory method to create a new <see cref="VVendor"/> instance. ///</summary> ///<param name="_vendorId"></param> ///<param name="_name"></param> ///<param name="_contactType"></param> ///<param name="_title"></param> ///<param name="_firstName"></param> ///<param name="_middleName"></param> ///<param name="_lastName"></param> ///<param name="_suffix"></param> ///<param name="_phone"></param> ///<param name="_emailAddress"></param> ///<param name="_emailPromotion"></param> ///<param name="_addressLine1"></param> ///<param name="_addressLine2"></param> ///<param name="_city"></param> ///<param name="_stateProvinceName"></param> ///<param name="_postalCode"></param> ///<param name="_countryRegionName"></param> public static VVendor CreateVVendor(System.Int32 _vendorId, System.String _name, System.String _contactType, System.String _title, System.String _firstName, System.String _middleName, System.String _lastName, System.String _suffix, System.String _phone, System.String _emailAddress, System.Int32 _emailPromotion, System.String _addressLine1, System.String _addressLine2, System.String _city, System.String _stateProvinceName, System.String _postalCode, System.String _countryRegionName) { VVendor newVVendor = new VVendor(); newVVendor.VendorId = _vendorId; newVVendor.Name = _name; newVVendor.ContactType = _contactType; newVVendor.Title = _title; newVVendor.FirstName = _firstName; newVVendor.MiddleName = _middleName; newVVendor.LastName = _lastName; newVVendor.Suffix = _suffix; newVVendor.Phone = _phone; newVVendor.EmailAddress = _emailAddress; newVVendor.EmailPromotion = _emailPromotion; newVVendor.AddressLine1 = _addressLine1; newVVendor.AddressLine2 = _addressLine2; newVVendor.City = _city; newVVendor.StateProvinceName = _stateProvinceName; newVVendor.PostalCode = _postalCode; newVVendor.CountryRegionName = _countryRegionName; return(newVVendor); }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static VVendor Convert(WsProxy.VVendor item) { VVendor outItem = new VVendor(); outItem.VendorId = item.VendorId; outItem.Name = item.Name; outItem.ContactType = item.ContactType; outItem.Title = item.Title; outItem.FirstName = item.FirstName; outItem.MiddleName = item.MiddleName; outItem.LastName = item.LastName; outItem.Suffix = item.Suffix; outItem.Phone = item.Phone; outItem.EmailAddress = item.EmailAddress; outItem.EmailPromotion = item.EmailPromotion; outItem.AddressLine1 = item.AddressLine1; outItem.AddressLine2 = item.AddressLine2; outItem.City = item.City; outItem.StateProvinceName = item.StateProvinceName; outItem.PostalCode = item.PostalCode; outItem.CountryRegionName = item.CountryRegionName; outItem.AcceptChanges(); return outItem; }
/// <summary> /// Deserialize the mock VVendor entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VVendor.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VVendor)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VVendor) mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }
///<summary> /// Returns a Typed VVendor Entity with mock values. ///</summary> static public VVendor CreateMockInstance() { VVendor mock = new VVendor(); mock.VendorId = TestUtility.Instance.RandomNumber(); mock.Name = TestUtility.Instance.RandomString(24, false);; mock.ContactType = TestUtility.Instance.RandomString(24, false);; mock.Title = TestUtility.Instance.RandomString(8, false);; mock.FirstName = TestUtility.Instance.RandomString(24, false);; mock.MiddleName = TestUtility.Instance.RandomString(24, false);; mock.LastName = TestUtility.Instance.RandomString(24, false);; mock.Suffix = TestUtility.Instance.RandomString(10, false);; mock.Phone = TestUtility.Instance.RandomString(11, false);; mock.EmailAddress = TestUtility.Instance.RandomString(24, false);; mock.EmailPromotion = TestUtility.Instance.RandomNumber(); mock.AddressLine1 = TestUtility.Instance.RandomString(29, false);; mock.AddressLine2 = TestUtility.Instance.RandomString(29, false);; mock.City = TestUtility.Instance.RandomString(14, false);; mock.StateProvinceName = TestUtility.Instance.RandomString(24, false);; mock.PostalCode = TestUtility.Instance.RandomString(6, false);; mock.CountryRegionName = TestUtility.Instance.RandomString(24, false);; return (VVendor)mock; }
///<summary> /// Returns a Typed VVendorBase Entity ///</summary> public virtual VVendorBase Copy() { //shallow copy entity VVendor copy = new VVendor(); copy.VendorId = this.VendorId; copy.Name = this.Name; copy.ContactType = this.ContactType; copy.Title = this.Title; copy.FirstName = this.FirstName; copy.MiddleName = this.MiddleName; copy.LastName = this.LastName; copy.Suffix = this.Suffix; copy.Phone = this.Phone; copy.EmailAddress = this.EmailAddress; copy.EmailPromotion = this.EmailPromotion; copy.AddressLine1 = this.AddressLine1; copy.AddressLine2 = this.AddressLine2; copy.City = this.City; copy.StateProvinceName = this.StateProvinceName; copy.PostalCode = this.PostalCode; copy.CountryRegionName = this.CountryRegionName; copy.AcceptChanges(); return (VVendor)copy; }
///<summary> /// A simple factory method to create a new <see cref="VVendor"/> instance. ///</summary> ///<param name="_vendorId"></param> ///<param name="_name"></param> ///<param name="_contactType"></param> ///<param name="_title"></param> ///<param name="_firstName"></param> ///<param name="_middleName"></param> ///<param name="_lastName"></param> ///<param name="_suffix"></param> ///<param name="_phone"></param> ///<param name="_emailAddress"></param> ///<param name="_emailPromotion"></param> ///<param name="_addressLine1"></param> ///<param name="_addressLine2"></param> ///<param name="_city"></param> ///<param name="_stateProvinceName"></param> ///<param name="_postalCode"></param> ///<param name="_countryRegionName"></param> public static VVendor CreateVVendor(System.Int32 _vendorId, System.String _name, System.String _contactType, System.String _title, System.String _firstName, System.String _middleName, System.String _lastName, System.String _suffix, System.String _phone, System.String _emailAddress, System.Int32 _emailPromotion, System.String _addressLine1, System.String _addressLine2, System.String _city, System.String _stateProvinceName, System.String _postalCode, System.String _countryRegionName) { VVendor newVVendor = new VVendor(); newVVendor.VendorId = _vendorId; newVVendor.Name = _name; newVVendor.ContactType = _contactType; newVVendor.Title = _title; newVVendor.FirstName = _firstName; newVVendor.MiddleName = _middleName; newVVendor.LastName = _lastName; newVVendor.Suffix = _suffix; newVVendor.Phone = _phone; newVVendor.EmailAddress = _emailAddress; newVVendor.EmailPromotion = _emailPromotion; newVVendor.AddressLine1 = _addressLine1; newVVendor.AddressLine2 = _addressLine2; newVVendor.City = _city; newVVendor.StateProvinceName = _stateProvinceName; newVVendor.PostalCode = _postalCode; newVVendor.CountryRegionName = _countryRegionName; return newVVendor; }
/// <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(VVendor entity, string propertyName) { switch (propertyName) { case "VendorId": return entity.VendorId; case "Name": return entity.Name; case "ContactType": return entity.ContactType; case "Title": return entity.Title; case "FirstName": return entity.FirstName; case "MiddleName": return entity.MiddleName; case "LastName": return entity.LastName; case "Suffix": return entity.Suffix; case "Phone": return entity.Phone; case "EmailAddress": return entity.EmailAddress; case "EmailPromotion": return entity.EmailPromotion; case "AddressLine1": return entity.AddressLine1; case "AddressLine2": return entity.AddressLine2; case "City": return entity.City; case "StateProvinceName": return entity.StateProvinceName; case "PostalCode": return entity.PostalCode; case "CountryRegionName": return entity.CountryRegionName; } return null; }