public EditEmployeeView(CommContracts.Employee employee = null)
        {
            InitializeComponent();

            CommClient.Department myd  = new CommClient.Department();
            CommClient.Job        myd1 = new CommClient.Job();
            CommClient.Employee   myd2 = new CommClient.Employee();

            GenderCombo.ItemsSource    = Enum.GetValues(typeof(CommContracts.GenderEnum));
            GenderCombo.SelectedItem   = CommContracts.GenderEnum.男;
            DeparmentCombo.ItemsSource = myd.getALLDepartment("");
            JobCombo.ItemsSource       = myd1.GetAllJob();
            bIsEdit = false;
            if (employee != null)
            {
                this.Employee                    = employee;
                this.NameEdit.Text               = employee.Name;
                this.GenderCombo.SelectedItem    = employee.Gender;
                this.DeparmentCombo.SelectedItem = myd2.GetCurrentDepartment(employee.ID);
                this.JobCombo.SelectedItem       = myd2.GetCurrentJob(employee.ID);
                this.LoginNameEdit.Text          = employee.LoginName;
                this.PasswordEdit.Password       = "";
                bIsEdit = true;
            }
        }
Exemple #2
0
        // 得到所有的部门
        public List <CommContracts.Department> GetFindAllDepartment(string strName = "")
        {
            CommClient.Department myd = new CommClient.Department();

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

            list = myd.getALLDepartment(strName);
            return(list);
        }
Exemple #3
0
        // 删除科室
        public bool DeleteDepartment(int departmentID)
        {
            CommClient.Department myd = new CommClient.Department();
            if (myd.DeleteDepartment(departmentID))
            {
                return(true);
            }

            return(false);
        }
Exemple #4
0
        private void ClinicManagementView_Loaded(object sender, RoutedEventArgs e)
        {
            var vm = this.DataContext as HISGUIDoctorVM;

            CommClient.Department myd = new CommClient.Department();

            CommClient.Employee employeeClient = new CommClient.Employee();
            this.DepartmentBlock.Text = employeeClient.GetCurrentDepartment(vm.CurrentUser.ID).Name;

            currentManageDate = DateTime.Now.Date;
            updateDateMsg();

            updateDateClinicMsg();
        }
        public EditSickBedView(CommContracts.SickBed sickBed = null)
        {
            InitializeComponent();
            CommClient.Department myd  = new CommClient.Department();
            CommClient.SickRoom   myd1 = new CommClient.SickRoom();

            DepartmentCombo.ItemsSource = myd.getALLDepartment("");
            SickRoomCombo.ItemsSource   = myd1.GetAllSickRoom();
            bIsEdit = false;
            if (sickBed != null)
            {
                this.SickBed                      = sickBed;
                this.NameEdit.Text                = sickBed.Name;
                this.RemarksEdit.Text             = sickBed.Remarks;
                this.DepartmentCombo.SelectedItem = sickBed.SickRoom.Department;
                this.SickRoomCombo.SelectedItem   = sickBed.SickRoom;
                bIsEdit = true;
            }
        }
        public EditSickRoomView(CommContracts.SickRoom sickroom = null)
        {
            InitializeComponent();
            SickRoomCombo.ItemsSource  = Enum.GetValues(typeof(CommContracts.SickRoomEnum));
            SickRoomCombo.SelectedItem = CommContracts.SickRoomEnum.普通病房;

            CommClient.Department myd = new CommClient.Department();
            DepartmentCombo.ItemsSource = myd.getALLDepartment("");

            bIsEdit = false;
            if (sickroom != null)
            {
                this.SickRoom      = sickroom;
                this.NameEdit.Text = sickroom.Name;
                this.SickRoomCombo.SelectedItem   = sickroom.SickRoomEnum;
                this.DepartmentCombo.SelectedItem = sickroom.Department;
                this.AddressEdit.Text             = sickroom.Address;
                bIsEdit = true;
            }
        }
Exemple #7
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.NameEdit.Text.Trim()))
            {
                return;
            }

            if (this.DepartmentCombo.SelectedItem == null)
            {
                return;
            }
            if (bIsEdit)
            {
                Department.Name           = this.NameEdit.Text.Trim();
                Department.Abbr           = this.AbbrEdit.Text.Trim();
                Department.DepartmentEnum = (CommContracts.DepartmentEnum) this.DepartmentCombo.SelectedItem;

                CommClient.Department myd = new CommClient.Department();
                if (myd.UpdateDepartment(Department))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
            else
            {
                CommContracts.Department department = new CommContracts.Department();
                department.Name           = this.NameEdit.Text.Trim();
                department.Abbr           = this.AbbrEdit.Text.Trim();
                department.DepartmentEnum = (CommContracts.DepartmentEnum) this.DepartmentCombo.SelectedItem;

                CommClient.Department myd = new CommClient.Department();
                if (myd.SaveDepartment(department))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
        }
Exemple #8
0
 // 得到所有临床科室
 public List <CommContracts.Department> getAllDepartment(CommContracts.DepartmentEnum departmentEnum = CommContracts.DepartmentEnum.临床科室)
 {
     CommClient.Department myd = new CommClient.Department();
     return(myd.getALLDepartment(departmentEnum));
 }
Exemple #9
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;
            }
        }