Example #1
0
        private void UpdateDepartmentNameByID()
        {
            if (this.DepartmentID == null || SelectionDepartmentInfoList == null)
            {
                return;
            }

            DepartmentInfo departmentInfo = SelectionDepartmentInfoList.Where(info => info.ID == this.DepartmentID).FirstOrDefault();

            if (departmentInfo != null)
            {
                DepartmentName = departmentInfo.DepartmentName;
            }
        }
Example #2
0
        private void UpdateEmployeeInfoByID()
        {
            if (SelectionEmployeeInfoList == null || SelectionDepartmentInfoList == null || SelectionWorkStatusInfoList == null)
            {
                return;
            }

            if (this.EmployeeID == 0)
            {
                this.EmployeeID   = SelectionEmployeeInfoList[0].ID;
                this.EmployeeName = SelectionEmployeeInfoList[0].EmployeeName;
                this.EmployeeSex  = SelectionEmployeeInfoList[0].EmployeeSexStr;
                this.DepartmentID = SelectionEmployeeInfoList[0].DepartmentID;
                this.StatusID     = SelectionEmployeeInfoList[0].StatusID;
            }
            else
            {
                EmployeeInfo employeeInfo = SelectionEmployeeInfoList.Where(info => info.ID == this.EmployeeID).FirstOrDefault();
                if (employeeInfo != null)
                {
                    this.EmployeeName = employeeInfo.EmployeeName;
                    this.EmployeeSex  = employeeInfo.EmployeeSexStr;
                    this.DepartmentID = employeeInfo.DepartmentID;
                    this.StatusID     = employeeInfo.StatusID;
                }
            }

            DepartmentInfo departmentInfo = SelectionDepartmentInfoList.Where(info => info.ID == this.DepartmentID).FirstOrDefault();

            if (departmentInfo != null)
            {
                this.DepartmentName = departmentInfo.DepartmentName;
            }

            WorkStatusInfo workStatusInfo = SelectionWorkStatusInfoList.Where(info => info.ID == this.StatusID).FirstOrDefault();

            if (workStatusInfo != null)
            {
                this.EmployeeStatus = workStatusInfo.StatusName;
            }
        }