Inheritance: VEmployeeDepartmentHistoryBase
Beispiel #1
0
        ///<summary>
        /// A simple factory method to create a new <see cref="VEmployeeDepartmentHistory"/> instance.
        ///</summary>
        ///<param name="_employeeId"></param>
        ///<param name="_title"></param>
        ///<param name="_firstName"></param>
        ///<param name="_middleName"></param>
        ///<param name="_lastName"></param>
        ///<param name="_suffix"></param>
        ///<param name="_shift"></param>
        ///<param name="_department"></param>
        ///<param name="_groupName"></param>
        ///<param name="_startDate"></param>
        ///<param name="_endDate"></param>
        public static VEmployeeDepartmentHistory CreateVEmployeeDepartmentHistory(System.Int32 _employeeId, System.String _title, System.String _firstName, System.String _middleName, System.String _lastName, System.String _suffix, System.String _shift, System.String _department, System.String _groupName, System.DateTime _startDate, System.DateTime?_endDate)
        {
            VEmployeeDepartmentHistory newVEmployeeDepartmentHistory = new VEmployeeDepartmentHistory();

            newVEmployeeDepartmentHistory.EmployeeId = _employeeId;
            newVEmployeeDepartmentHistory.Title      = _title;
            newVEmployeeDepartmentHistory.FirstName  = _firstName;
            newVEmployeeDepartmentHistory.MiddleName = _middleName;
            newVEmployeeDepartmentHistory.LastName   = _lastName;
            newVEmployeeDepartmentHistory.Suffix     = _suffix;
            newVEmployeeDepartmentHistory.Shift      = _shift;
            newVEmployeeDepartmentHistory.Department = _department;
            newVEmployeeDepartmentHistory.GroupName  = _groupName;
            newVEmployeeDepartmentHistory.StartDate  = _startDate;
            newVEmployeeDepartmentHistory.EndDate    = _endDate;
            return(newVEmployeeDepartmentHistory);
        }
Beispiel #2
0
        ///<summary>
        ///  Returns a Typed VEmployeeDepartmentHistoryBase Entity
        ///</summary>
        public virtual VEmployeeDepartmentHistoryBase Copy()
        {
            //shallow copy entity
            VEmployeeDepartmentHistory copy = new VEmployeeDepartmentHistory();

            copy.EmployeeId = this.EmployeeId;
            copy.Title      = this.Title;
            copy.FirstName  = this.FirstName;
            copy.MiddleName = this.MiddleName;
            copy.LastName   = this.LastName;
            copy.Suffix     = this.Suffix;
            copy.Shift      = this.Shift;
            copy.Department = this.Department;
            copy.GroupName  = this.GroupName;
            copy.StartDate  = this.StartDate;
            copy.EndDate    = this.EndDate;
            copy.AcceptChanges();
            return((VEmployeeDepartmentHistory)copy);
        }
Beispiel #3
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(VEmployeeDepartmentHistory entity, string propertyName)
        {
            switch (propertyName)
            {
            case "EmployeeId":
                return(entity.EmployeeId);

            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 "Shift":
                return(entity.Shift);

            case "Department":
                return(entity.Department);

            case "GroupName":
                return(entity.GroupName);

            case "StartDate":
                return(entity.StartDate);

            case "EndDate":
                return(entity.EndDate);
            }
            return(null);
        }
		/// <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(VEmployeeDepartmentHistory entity, string propertyName)
		{
			switch (propertyName)
			{
				case "EmployeeId":
					return entity.EmployeeId;
				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 "Shift":
					return entity.Shift;
				case "Department":
					return entity.Department;
				case "GroupName":
					return entity.GroupName;
				case "StartDate":
					return entity.StartDate;
				case "EndDate":
					return entity.EndDate;
			}
			return null;
		}
		///<summary>
		///  Returns a Typed VEmployeeDepartmentHistoryBase Entity 
		///</summary>
		public virtual VEmployeeDepartmentHistoryBase Copy()
		{
			//shallow copy entity
			VEmployeeDepartmentHistory copy = new VEmployeeDepartmentHistory();
				copy.EmployeeId = this.EmployeeId;
				copy.Title = this.Title;
				copy.FirstName = this.FirstName;
				copy.MiddleName = this.MiddleName;
				copy.LastName = this.LastName;
				copy.Suffix = this.Suffix;
				copy.Shift = this.Shift;
				copy.Department = this.Department;
				copy.GroupName = this.GroupName;
				copy.StartDate = this.StartDate;
				copy.EndDate = this.EndDate;
			copy.AcceptChanges();
			return (VEmployeeDepartmentHistory)copy;
		}
		///<summary>
		/// A simple factory method to create a new <see cref="VEmployeeDepartmentHistory"/> instance.
		///</summary>
		///<param name="_employeeId"></param>
		///<param name="_title"></param>
		///<param name="_firstName"></param>
		///<param name="_middleName"></param>
		///<param name="_lastName"></param>
		///<param name="_suffix"></param>
		///<param name="_shift"></param>
		///<param name="_department"></param>
		///<param name="_groupName"></param>
		///<param name="_startDate"></param>
		///<param name="_endDate"></param>
		public static VEmployeeDepartmentHistory CreateVEmployeeDepartmentHistory(System.Int32 _employeeId, System.String _title, System.String _firstName, System.String _middleName, System.String _lastName, System.String _suffix, System.String _shift, System.String _department, System.String _groupName, System.DateTime _startDate, System.DateTime? _endDate)
		{
			VEmployeeDepartmentHistory newVEmployeeDepartmentHistory = new VEmployeeDepartmentHistory();
			newVEmployeeDepartmentHistory.EmployeeId = _employeeId;
			newVEmployeeDepartmentHistory.Title = _title;
			newVEmployeeDepartmentHistory.FirstName = _firstName;
			newVEmployeeDepartmentHistory.MiddleName = _middleName;
			newVEmployeeDepartmentHistory.LastName = _lastName;
			newVEmployeeDepartmentHistory.Suffix = _suffix;
			newVEmployeeDepartmentHistory.Shift = _shift;
			newVEmployeeDepartmentHistory.Department = _department;
			newVEmployeeDepartmentHistory.GroupName = _groupName;
			newVEmployeeDepartmentHistory.StartDate = _startDate;
			newVEmployeeDepartmentHistory.EndDate = _endDate;
			return newVEmployeeDepartmentHistory;
		}
		/// <summary>
		/// Deserialize the mock VEmployeeDepartmentHistory entity from a temporary file.
		/// </summary>
		private void Step_7_DeserializeEntity_Generated()
		{
			string fileName = "temp_VEmployeeDepartmentHistory.xml";
		
			XmlSerializer mySerializer = new XmlSerializer(typeof(VEmployeeDepartmentHistory)); 
			System.IO.FileStream myFileStream = new System.IO.FileStream(fileName,  System.IO.FileMode.Open); 
			mock = (VEmployeeDepartmentHistory) mySerializer.Deserialize(myFileStream);
			myFileStream.Close();
			System.IO.File.Delete(fileName);
			
			System.Console.WriteLine("mock correctly deserialized from a temporary file.");
		}
		///<summary>
		///  Returns a Typed VEmployeeDepartmentHistory Entity with mock values.
		///</summary>
		static public VEmployeeDepartmentHistory CreateMockInstance()
		{		
			VEmployeeDepartmentHistory mock = new VEmployeeDepartmentHistory();
						
			mock.EmployeeId = TestUtility.Instance.RandomNumber();
			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.Shift = TestUtility.Instance.RandomString(24, false);;
			mock.Department = TestUtility.Instance.RandomString(24, false);;
			mock.GroupName = TestUtility.Instance.RandomString(24, false);;
			mock.StartDate = TestUtility.Instance.RandomDateTime();
			mock.EndDate = TestUtility.Instance.RandomDateTime();
		   return (VEmployeeDepartmentHistory)mock;
		}
		/// <summary>
		/// Convert a nettiers collection to the ws proxy collection.
		/// </summary>
		public static VEmployeeDepartmentHistory Convert(WsProxy.VEmployeeDepartmentHistory item)
		{			
			VEmployeeDepartmentHistory outItem = new VEmployeeDepartmentHistory();			
			outItem.EmployeeId = item.EmployeeId;
			outItem.Title = item.Title;
			outItem.FirstName = item.FirstName;
			outItem.MiddleName = item.MiddleName;
			outItem.LastName = item.LastName;
			outItem.Suffix = item.Suffix;
			outItem.Shift = item.Shift;
			outItem.Department = item.Department;
			outItem.GroupName = item.GroupName;
			outItem.StartDate = item.StartDate;
			outItem.EndDate = item.EndDate;
							
			outItem.AcceptChanges();			
			return outItem;
		}