private void CheckTestimoniesAndAddNew()
        {
            List <EmployeeRelativeDTO> testimonies = new EmployeeRelativeService(true)
                                                     .GetAll()
                                                     .Where(ag => ag.EmployeeId == Employee.Id && ag.Type == RelativeTypes.Testimony).ToList();

            if (!testimonies.Any())
            {
                var empRelativeService   = new EmployeeRelativeService();
                var fEmployeeTestimonies = new ObservableCollection <EmployeeRelativeDTO>(TestimonyPersons.Take(NoOfTestimonials));

                foreach (var filteredEmployeeTestimony in fEmployeeTestimonies)
                {
                    var feTestimony = AddNewRelative();
                    feTestimony.FullName            = filteredEmployeeTestimony.FullName;
                    feTestimony.Address.SubCity     = filteredEmployeeTestimony.Address.SubCity;
                    feTestimony.Address.Woreda      = filteredEmployeeTestimony.Address.Woreda;
                    feTestimony.Address.Kebele      = filteredEmployeeTestimony.Address.Kebele;
                    feTestimony.Address.HouseNumber = filteredEmployeeTestimony.Address.HouseNumber;
                    feTestimony.Address.Mobile      = filteredEmployeeTestimony.Address.Mobile;
                    empRelativeService.InsertOrUpdate(feTestimony);
                }
                empRelativeService.Dispose();
            }
        }
        private void LoadContactPersons()
        {
            var cri = new SearchCriteria <EmployeeRelativeDTO>();

            cri.FiList.Add(e => e.Type == RelativeTypes.ContactPerson);
            var emergencyPrs = new EmployeeRelativeService(true).GetAll(cri).ToList().Distinct();

            ContactPersons = new ObservableCollection <EmployeeRelativeDTO>(emergencyPrs);
        }
        private void LoadTestimonyPersons()
        {
            try
            {
                var cri = new SearchCriteria <EmployeeRelativeDTO>();

                cri.FiList.Add(t => t.Type == RelativeTypes.Testimony);
                IEnumerable <EmployeeRelativeDTO> testimonies = new EmployeeRelativeService(true)
                                                                .GetAll(cri)
                                                                .GroupBy(o => o.FullName).Select(g => g.FirstOrDefault());//.Distinct();
                TestimonyPersons = new ObservableCollection <EmployeeRelativeDTO>(testimonies);
            }
            catch
            {
                NotifyUtility.ShowCustomBalloon("Can't Load", "Can't Load Previously added testimonial!", 4000);
            }
        }