/// <summary>
        /// update existing department info
        /// </summary>
        /// <param name="s"></param>
        public static void UpdateDepartment(PLDepartment s)
        {
            SLDepartment.Department newDepartment = DTO_to_SL(s);

            SLDepartment.ISLDepartment SLDepartment = new SLDepartment.SLDepartmentClient();
            string[] errors = new string[0];
            SLDepartment.UpdateDepartmentRequest request = new SLDepartment.UpdateDepartmentRequest(newDepartment, errors);
            SLDepartment.UpdateDepartment(request);
        }
        /// <summary>
        /// call service layer's delete department method
        /// </summary>
        /// <param name="id"></param>
        public static bool DeleteDepartment(int id)
        {
            SLDepartment.ISLDepartment SLDepartment = new SLDepartment.SLDepartmentClient();
            string[] errors = new string[0];
            SLDepartment.DeleteDepartmentRequest  request  = new SLDepartment.DeleteDepartmentRequest(id, errors);
            SLDepartment.DeleteDepartmentResponse response = SLDepartment.DeleteDepartment(request);
            if (response.errors.Length > 0)
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Get department detail
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static PLDepartment GetDepartmentDetail(string deptName)
        {
            SLDepartment.ISLDepartment SLDepartment = new SLDepartment.SLDepartmentClient();

            string[] errors = new string[0];
            SLDepartment.GetDepartmentDetailRequest  request  = new SLDepartment.GetDepartmentDetailRequest(deptName, errors);
            SLDepartment.GetDepartmentDetailResponse response = SLDepartment.GetDepartmentDetail(request);
            SLDepartment.Department newDepartment             = response.GetDepartmentDetailResult;
            //System.Diagnostics.Debug.WriteLine("newDepartment value: " + newDepartment.ToString());
            System.Diagnostics.Debug.WriteLine("response: " + response.GetDepartmentDetailResult);
            // this is the data transfer object code...
            return(DTO_to_PL(newDepartment));
        }
        public static List <PLDepartment> GetDepartmentList()
        {
            List <PLDepartment> departmentList = new List <PLDepartment>();

            SLDepartment.ISLDepartment client = new SLDepartment.SLDepartmentClient();

            string[] errors = new string[0];
            SLDepartment.GetDepartmentListRequest  request  = new SLDepartment.GetDepartmentListRequest(errors);
            SLDepartment.GetDepartmentListResponse response = client.GetDepartmentList(request);
            SLDepartment.Department[] departmentsLoaded     = response.GetDepartmentListResult;

            foreach (SLDepartment.Department s in departmentsLoaded)
            {
                PLDepartment department = DTO_to_PL(s);
                departmentList.Add(department);
            }

            return(departmentList);
        }