Exemple #1
0
        // 得到所有的值班时段
        public List <CommContracts.Shift> GetAllShift(string strName = "")
        {
            CommClient.Shift myd = new CommClient.Shift();

            List <CommContracts.Shift> list = new List <CommContracts.Shift>();

            list = myd.GetAllShift(strName);
            return(list);
        }
Exemple #2
0
        // 删除供值班时段
        public bool DeleteShift(int ShiftID)
        {
            CommClient.Shift myd = new CommClient.Shift();
            if (myd.DeleteShift(ShiftID))
            {
                return(true);
            }

            return(false);
        }
Exemple #3
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.NameEdit.Text.Trim()))
            {
                return;
            }

            string strStartTime = this.StartTimeContorl.GetMyValue();
            string strEndTime   = this.EndTimeContorl.GetMyValue();


            if (bIsEdit)
            {
                m_Shift.Name      = this.NameEdit.Text;
                m_Shift.StartTime = strStartTime;
                m_Shift.EndTime   = strEndTime;

                CommClient.Shift shiftClient = new CommClient.Shift();
                if (shiftClient.UpdateShift(m_Shift))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
            else
            {
                CommContracts.Shift shift = new CommContracts.Shift();
                shift.Name      = this.NameEdit.Text;
                shift.StartTime = strStartTime;
                shift.EndTime   = strEndTime;

                CommClient.Shift shiftClient = new CommClient.Shift();
                if (shiftClient.SaveShift(shift))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
        }
Exemple #4
0
        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 void ClinicVistTimeView_Loaded(object sender, RoutedEventArgs e)
 {
     CommClient.Shift myd = new CommClient.Shift();
     ShiftCombo.ItemsSource = myd.GetAllShift();
     updateAllClinicVistTimeList();
 }
Exemple #6
0
        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);
        }