private void Button_Click(object sender, RoutedEventArgs e) { CommClient.Employee myd = new CommClient.Employee(); // 得到医生 CommClient.EmployeeDepartmentHistory historyClient = new CommClient.EmployeeDepartmentHistory(); List <CommContracts.Employee> listOfSignalSource = historyClient.GetAllDepartmentEmployee(0); this.listView1.ItemsSource = listOfSignalSource; SelectDoctor = new CommContracts.Employee(); }
private bool UpdateEmployeeDepartmentHistory(int employeeID, int demaprtmentID) { bool bIsOk = true; CommContracts.EmployeeDepartmentHistory history = new CommContracts.EmployeeDepartmentHistory(); history.EmployeeID = employeeID; history.DepartmentID = demaprtmentID; CommClient.EmployeeDepartmentHistory historyClient = new CommClient.EmployeeDepartmentHistory(); if (!historyClient.SaveEmployeeDepartmentHistory(history)) { bIsOk = false; } return(bIsOk); }
private void MyDataNameList_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { TreeViewItem item = MyDataNameList.SelectedItem as TreeViewItem; if (item == null) { return; } if (item.Header == null) { return; } if (this.listView1 == null) { return; } string strCurrentName = item.Header.ToString(); SetMenuEnable(false); if (strCurrentName == "值班时段字典") { this.listView1.View = this.Resources["ChuZhenShiDuan"] as GridView; var vm = this.DataContext as HISGUIDoctorVM; CommClient.Shift client = new CommClient.Shift(); List <CommContracts.Shift> list = client.GetAllShift(); this.listView1.ItemsSource = list; } //else if (strCurrentName == "号别字典") //{ // this.listView1.View = this.Resources["HaoBie"] as GridView; // var vm = this.DataContext as HISGUIDoctorVM; // CommClient.SignalItem client = new CommClient.SignalItem(); // List<CommContracts.SignalType> list = client.GetAllSignalItem(); // this.listView1.ItemsSource = list; //} else if (strCurrentName == "科室字典") { this.listView1.View = this.Resources["KeShi"] as GridView; var vm = this.DataContext as HISGUIDoctorVM; CommClient.Department client = new CommClient.Department(); List <CommContracts.Department> list = client.getALLDepartment(CommContracts.DepartmentEnum.临床科室); this.listView1.ItemsSource = list; } else if (strCurrentName == "医生字典") { this.listView1.View = this.Resources["YiSheng"] as GridView; SetMenuEnable(true); var vm = this.DataContext as HISGUIDoctorVM; CommClient.Employee employeeClient = new CommClient.Employee(); int nCurrentDepartmentID = employeeClient.GetCurrentDepartment(vm.CurrentUser.ID).ID; CommClient.EmployeeDepartmentHistory historyClient = new CommClient.EmployeeDepartmentHistory(); List <CommContracts.Employee> list = historyClient.GetAllDepartmentEmployee(nCurrentDepartmentID); this.listView1.ItemsSource = list; } }
private List <PaiBan> updateDateClinicMsgGrid() { var vm = this.DataContext as HISGUIDoctorVM; CommClient.Employee employeeClient = new CommClient.Employee(); var department = employeeClient.GetCurrentDepartment(vm.CurrentUser.ID); if (department == null) { return(null); } if (department.ID < 0) { return(null); } CommClient.EmployeeDepartmentHistory historyClient = new CommClient.EmployeeDepartmentHistory(); List <CommContracts.Employee> DoctorList = historyClient.GetAllDepartmentDoctor(department.ID); if (DoctorList == null) { return(null); } CommClient.Shift vistTimeClient = new CommClient.Shift(); List <CommContracts.Shift> shiftList = vistTimeClient.GetAllShift(); if (shiftList == null) { return(null); } DateTime monday = getMonday(currentManageDate); List <PaiBan> data = new List <PaiBan>(); for (int i = 0; i < DoctorList.Count(); i++) { CommContracts.Employee employee = DoctorList.ElementAt(i); if (employee == null) { continue; } List <CommContracts.WorkPlan> sourceList = vm?.GetSignalSourceList(department.ID, employee.ID, monday, monday.AddDays(6), 0); if (sourceList == null || sourceList.Count <= 0) { foreach (var shift in shiftList) { PaiBan paiBan = new PaiBan(); paiBan.EmployeeID = employee.ID; paiBan.Name = employee.Name; paiBan.ShiftID = shift.ID; paiBan.ShiftName = shift.Name; paiBan.MaxVistNum = 0; data.Add(paiBan); } } else { foreach (var vistTime in shiftList) { PaiBan paiBan = new PaiBan(); paiBan.EmployeeID = employee.ID; paiBan.Name = employee.Name; paiBan.ShiftID = vistTime.ID; paiBan.ShiftName = vistTime.Name; foreach (var tem in sourceList) { if (tem == null) { continue; } if (tem.ShiftID != vistTime.ID) { continue; } DayOfWeek dayOfWeek = tem.WorkPlanDate.Value.DayOfWeek; paiBan.WorkPlanIDList[(int)dayOfWeek] = tem.ID; paiBan.WorkPlanWorkTypeList[(int)dayOfWeek] = tem.WorkType; paiBan.MaxVistNum = tem.MaxNum; } data.Add(paiBan); } } } return(data); }