/// <summary>
        /// Saves the Employee Profile Maintenance
        /// </summary>
        /// <param name="employee">Employee Info</param>
        /// <param name="saveCriteria">Call Criteria Info</param>
        /// <param name="saveCriteriaValueList">New Call Criteria Value Info</param>
        /// <param name="offCall">Off Call Info</param>
        /// <param name="coverage">Coverage Info</param>
        /// <param name="username">Username</param>
        /// <param name="isCoverage">Indicates if the employee is in Coverage</param>
        /// <param name="isOffCall">Indicates if the employee is in Off Call</param>
        public void SaveEmployee(CS_Employee employee, CS_EmployeeOffCallHistory offCall, CS_EmployeeCoverage coverage, string username, bool isCoverage, bool isOffCall, List<PhoneNumberVO> additionalPhoneNumbersList)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                DateTime saveDate = DateTime.Now;
                CS_Employee oldEmployee = _employeeRepository.Get(e => e.ID == employee.ID);

                try
                {
                    // Update Employee Table
                    bool hasAddressChanges = false;
                    bool hasPhoneChanges = false;
                    if (null != oldEmployee)
                    {
                        // Saving Employee Info
                        if (IsNull(oldEmployee.Address) != IsNull(employee.Address))
                        {
                            oldEmployee.Address = employee.Address;
                            hasAddressChanges = true;
                        }
                        if (IsNull(oldEmployee.City) != IsNull(employee.City))
                        {
                            oldEmployee.City = employee.City;
                            hasAddressChanges = true;
                        }
                        if (IsNull(oldEmployee.StateProvinceCode) != IsNull(employee.StateProvinceCode))
                        {
                            oldEmployee.StateProvinceCode = employee.StateProvinceCode;
                            hasAddressChanges = true;
                        }
                        if (IsNull(oldEmployee.CountryCode) != IsNull(employee.CountryCode))
                        {
                            oldEmployee.CountryCode = employee.CountryCode;
                            hasAddressChanges = true;
                        }
                        if (IsNull(oldEmployee.Address2) != IsNull(employee.Address2))
                        {
                            oldEmployee.Address2 = employee.Address2;
                            hasAddressChanges = true;
                        }
                        if (IsNull(oldEmployee.PostalCode) != IsNull(employee.PostalCode))
                        {
                            oldEmployee.PostalCode = employee.PostalCode;
                            hasAddressChanges = true;
                        }
                        if (IsNull(oldEmployee.DayAreaCode) != IsNull(employee.DayAreaCode))
                        {
                            oldEmployee.DayAreaCode = employee.DayAreaCode;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.DayPhone) != IsNull(employee.DayPhone))
                        {
                            oldEmployee.DayPhone = employee.DayPhone;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.HomeAreaCode) != IsNull(employee.HomeAreaCode))
                        {
                            oldEmployee.HomeAreaCode = employee.HomeAreaCode;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.HomePhone) != IsNull(employee.HomePhone))
                        {
                            oldEmployee.HomePhone = employee.HomePhone;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.FaxAreaCode) != IsNull(employee.FaxAreaCode))
                        {
                            oldEmployee.FaxAreaCode = employee.FaxAreaCode;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.FaxPhone) != IsNull(employee.FaxPhone))
                        {
                            oldEmployee.FaxPhone = employee.FaxPhone;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.MobileAreaCode) != IsNull(employee.MobileAreaCode))
                        {
                            oldEmployee.MobileAreaCode = employee.MobileAreaCode;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.MobilePhone) != IsNull(employee.MobilePhone))
                        {
                            oldEmployee.MobilePhone = employee.MobilePhone;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.OtherPhoneAreaCode) != IsNull(employee.OtherPhoneAreaCode))
                        {
                            oldEmployee.OtherPhoneAreaCode = employee.OtherPhoneAreaCode;
                            hasPhoneChanges = true;
                        }
                        if (IsNull(oldEmployee.OtherPhone) != IsNull(employee.OtherPhone))
                        {
                            oldEmployee.OtherPhone = employee.OtherPhone;
                            hasPhoneChanges = true;
                        }

                        if (hasAddressChanges)
                            oldEmployee.HasAddressChanges = hasAddressChanges;

                        if (hasPhoneChanges)
                            oldEmployee.HasPhoneChanges = hasPhoneChanges;

                        oldEmployee.ModifiedBy = username;
                        oldEmployee.ModificationDate = saveDate;
                        //employee.ModificationID = null;
                        oldEmployee.IsKeyPerson = employee.IsKeyPerson;
                        oldEmployee.IsDentonPersonal = employee.IsDentonPersonal;
                        CS_Employee employeeToUpdate = new CS_Employee();
                        employeeToUpdate = oldEmployee;

                        _employeeRepository.Update(employeeToUpdate);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error occured while trying to updating Employee information.\n{0}\n{1}", ex, ex.InnerException));
                    throw new Exception("Error while updating Employee information", ex);
                }

                try
                {
                    // Send Email to Pam And Curry
                    if (null != oldEmployee)
                        if (oldEmployee.HasAddressChanges)
                            SendNotificationForAddressChange(oldEmployee);
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error occured while trying to Send the email update for Address Change.\n{0}\n{1}", ex, ex.InnerException));
                    throw new Exception("Error while notifying Address changes", ex);
                }

                try
                {
                    //Send Email to Pam
                    if (null != oldEmployee)
                        if (oldEmployee.HasPhoneChanges)
                            SendNotificationForContactPhoneChange(oldEmployee);
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error occured while trying to Send the email update for Phone Change.\n{0}\n{1}", ex, ex.InnerException));
                    throw new Exception("Error while notifying Phone changes", ex);
                }

                try
                {
                    // Update Off Call
                    if (offCall != null)
                    {
                        CS_EmployeeOffCallHistory oldOffCall = _employeeOffCallRepository.Get(e => e.EmployeeID == offCall.EmployeeID && e.Active);
                        if (oldOffCall == null)
                        {
                            offCall.Active = true;
                            offCall.CreatedBy = username;
                            offCall.CreationDate = saveDate;
                            //offCall.CreationID = null;
                            offCall.ModifiedBy = username;
                            offCall.ModificationDate = saveDate;
                            //offCall.ModificationID = null;

                            if (isOffCall)
                            {
                                _employeeOffCallRepository.Add(offCall);
                                _callLogModel.GenerateOffCalCallLog(offCall);
                            }
                        }
                        else
                        {
                            oldOffCall.EmployeeID = offCall.EmployeeID;
                            oldOffCall.ProxyEmployeeID = offCall.ProxyEmployeeID;
                            oldOffCall.OffCallStartDate = offCall.OffCallStartDate;
                            oldOffCall.OffCallEndDate = offCall.OffCallEndDate;
                            oldOffCall.OffCallReturnTime = offCall.OffCallReturnTime;
                            oldOffCall.Active = isOffCall;
                            oldOffCall.ModifiedBy = username;
                            oldOffCall.ModificationDate = saveDate;
                            //oldOffCall.ModificationID = null;

                            _employeeOffCallRepository.Update(oldOffCall);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error occured while trying to Update Off Call Information.\n{0}\n{1}", ex, ex.InnerException));
                    throw new Exception("Error while updating Off Call information", ex);
                }

                try
                {
                    // Update Coverage
                    if (coverage != null)
                    {

                        CS_EmployeeCoverage oldCoverage = _employeeCoverageRepository.Get(e => e.EmployeeID == coverage.EmployeeID && e.Active);
                        if (oldCoverage == null)
                        {
                            coverage.Active = true;
                            coverage.CreatedBy = username;
                            coverage.CreationDate = saveDate;
                            //coverage.CreationID = null;
                            coverage.ModifiedBy = username;
                            coverage.ModificationDate = saveDate;
                            //coverage.ModificationID = null;

                            if (isCoverage)
                            {
                                int? jobId = this.GetJobIdFromResource(coverage.EmployeeID);

                                if (jobId.HasValue)
                                {
                                    JobModel jobModel = new JobModel(_unitOfWork);
                                    jobModel.AddDivisionToJob(coverage.DivisionID, jobId.Value, username);
                                }

                                _employeeCoverageRepository.Add(coverage);
                                _callLogModel.GenerateEmployeeCoverageCalCallLog(coverage);
                            }
                        }
                        else
                        {
                            oldCoverage.EmployeeID = coverage.EmployeeID;
                            oldCoverage.DivisionID = coverage.DivisionID;
                            oldCoverage.Duration = coverage.Duration;
                            oldCoverage.CoverageStartDate = coverage.CoverageStartDate;
                            oldCoverage.CoverageEndDate = coverage.CoverageEndDate;
                            oldCoverage.Active = isCoverage;
                            oldCoverage.ModifiedBy = username;
                            offCall.ModificationDate = saveDate;
                            //oldCoverage.ModificationID = null;

                            _employeeCoverageRepository.Update(oldCoverage);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error occured while trying to Update Off Call Information.\n{0}\n{1}", ex, ex.InnerException));
                    throw new Exception("Error while updating Off Call information", ex);
                }

                try
                {
                    if (null != oldEmployee)
                    {
                        List<CS_PhoneNumber> oldPhoneList = ListAllPhonesByEmployee(oldEmployee.ID);
                        List<CS_PhoneNumber> newPhoneList = GetListFromPhoneVO(additionalPhoneNumbersList);

                        List<CS_PhoneNumber> removedPhoneList = oldPhoneList.Where(e => !newPhoneList.Any(f => f.ID == e.ID)).ToList();
                        List<CS_PhoneNumber> addedPhoneList = newPhoneList.Where(e => e.ID == 0).ToList();

                        for (int i = 0; i < removedPhoneList.Count; i++)
                        {
                            removedPhoneList[i].ModifiedBy = username;
                            removedPhoneList[i].ModificationDate = saveDate;
                            removedPhoneList[i].Active = false;
                        }

                        for (int i = 0; i < addedPhoneList.Count; i++)
                        {
                            addedPhoneList[i].EmployeeID = oldEmployee.ID;
                            addedPhoneList[i].CreatedBy = username;
                            addedPhoneList[i].CreationDate = saveDate;
                            //addedPhoneList[i].CreationID =
                            addedPhoneList[i].ModifiedBy = username;
                            addedPhoneList[i].ModificationDate = saveDate;
                            //addedPhoneList[i].ModificationID =
                            addedPhoneList[i].Active = true;
                        }

                        _phoneNumberRepository.UpdateList(removedPhoneList);
                        _phoneNumberRepository.AddList(addedPhoneList);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Write(string.Format("An error occured while trying to Update Additional Contact Information.\n{0}\n{1}", ex, ex.InnerException));
                    throw new Exception("Error while updating Additional Contact Information", ex);
                }

                scope.Complete();
            }
        }