/// <summary> /// Deserialize the mock VProductModelInstructions entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VProductModelInstructions.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VProductModelInstructions)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VProductModelInstructions)mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.VProductModelInstructions Convert(VProductModelInstructions item) { WsProxy.VProductModelInstructions outItem = new WsProxy.VProductModelInstructions(); outItem.ProductModelId = item.ProductModelId; outItem.Name = item.Name; outItem.Instructions = item.Instructions; outItem.LocationId = item.LocationId; outItem.SetupHours = item.SetupHours; outItem.MachineHours = item.MachineHours; outItem.LaborHours = item.LaborHours; outItem.LotSize = item.LotSize; outItem.Step = item.Step; outItem.Rowguid = item.Rowguid; outItem.ModifiedDate = item.ModifiedDate; return(outItem); }
///<summary> /// Returns a Typed VProductModelInstructions Entity with mock values. ///</summary> static public VProductModelInstructions CreateMockInstance() { VProductModelInstructions mock = new VProductModelInstructions(); mock.ProductModelId = TestUtility.Instance.RandomNumber(); mock.Name = TestUtility.Instance.RandomString(24, false);; mock.Instructions = TestUtility.Instance.RandomString(2, false);; mock.LocationId = TestUtility.Instance.RandomNumber(); mock.SetupHours = (decimal)TestUtility.Instance.RandomShort(); mock.MachineHours = (decimal)TestUtility.Instance.RandomShort(); mock.LaborHours = (decimal)TestUtility.Instance.RandomShort(); mock.LotSize = TestUtility.Instance.RandomNumber(); mock.Step = TestUtility.Instance.RandomString(499, false);; mock.Rowguid = Guid.NewGuid(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); return((VProductModelInstructions)mock); }