private void BtnSelectPerson_Click(object sender, RoutedEventArgs e) { var winPersonSearch = new WinPersonSearch(); winPersonSearch.ShowDialog(); if (winPersonSearch.PersonId == 0) { return; } if (PersonId.Contains(winPersonSearch.PersonId)) { Utility.Message("خطا", "این شخص یکبار انتخاب شده است", "Stop.png"); return; } PersonId.Add(winPersonSearch.PersonId); PersonName.Add(winPersonSearch.PersonName); PersonFamily.Add(winPersonSearch.PersonFamily); PersonFather.Add(winPersonSearch.PersonFather); PersonCode.Add(winPersonSearch.PersonCode); _createPersons = new List <CreatePerson>(); for (var i = 0; i < PersonId.Count; i++) { _createPersons.Add(new CreatePerson(PersonId[i], PersonName[i], PersonFamily[i], PersonFather[i], PersonCode[i])); } DgdPerson.ItemsSource = _createPersons; }
/// <summary> /// 删除某员工的学历信息 /// </summary> /// <param name="PersonId">员工编号</param> /// <returns></returns> private bool SchoolDelete(params int[] PersonId) { bool IsTrue = false; IEnumerable <EyouSoft.Data.SchoolInfo> Lists = from item in dcDal.SchoolInfo where PersonId.Contains(item.PersonId) select item; dcDal.SchoolInfo.DeleteAllOnSubmit <EyouSoft.Data.SchoolInfo>(Lists); dcDal.SubmitChanges(); if (dcDal.ChangeConflicts.Count == 0) { IsTrue = true; } Lists = null; return(IsTrue); }
/// <summary> /// 删除某员工的学历信息 /// </summary> /// <param name="CompanyId">员工编号</param> /// <returns></returns> private bool HistoryDelete(params int[] PersonId) { bool IsTrue = false; IEnumerable <EyouSoft.Data.PersonalHistory> Lists = from item in dcDal.PersonalHistory where PersonId.Contains(item.PersonId) select item; if (Lists != null) { dcDal.PersonalHistory.DeleteAllOnSubmit <EyouSoft.Data.PersonalHistory>(Lists); dcDal.SubmitChanges(); if (dcDal.ChangeConflicts.Count == 0) { IsTrue = true; } Lists = null; } return(IsTrue); }