示例#1
0
        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;
            }
        }
示例#2
0
        // 得到所有的职位
        public List <CommContracts.Job> GetAllJob(string strName = "")
        {
            CommClient.Job myd = new CommClient.Job();

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

            list = myd.GetAllJob(strName);
            return(list);
        }
        private void SignalTypeSetView_Loaded(object sender, RoutedEventArgs e)
        {
            CommClient.Job      jobClient  = new CommClient.Job();
            CommClient.WorkType typeClient = new CommClient.WorkType();

            SignalItemDoctorJobComBo.ItemsSource = jobClient.GetAllTypeJob(CommContracts.JobTypeEnum.医师);
            SignalItemWorkTypeComBo.ItemsSource  = typeClient.GetAllWorkType();
            UpdateAllDate();
        }
示例#4
0
        // 删除职位
        public bool DeleteJob(int jobID)
        {
            CommClient.Job myd = new CommClient.Job();
            if (myd.DeleteJob(jobID))
            {
                return(true);
            }

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

            if (this.JobGradeCombo.SelectedItem == null)
            {
                return;
            }
            if (this.PowerEnum.SelectedItem == null)
            {
                return;
            }

            if (bIsEdit)
            {
                Job.Name      = this.NameEdit.Text.Trim();
                Job.JobGrade  = (CommContracts.JobGradeEnum) this.JobGradeCombo.SelectedItem;
                Job.PowerEnum = (CommContracts.PowerEnum) this.PowerEnum.SelectedItem;
                Job.JobType   = (CommContracts.JobTypeEnum) this.JobTypeCombo.SelectedItem;

                CommClient.Job myd = new CommClient.Job();
                if (myd.UpdateJob(Job))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
            else
            {
                CommContracts.Job job = new CommContracts.Job();
                job.Name      = this.NameEdit.Text.Trim();
                job.JobGrade  = (CommContracts.JobGradeEnum) this.JobGradeCombo.SelectedItem;
                job.PowerEnum = (CommContracts.PowerEnum) this.PowerEnum.SelectedItem;
                job.JobType   = (CommContracts.JobTypeEnum) this.JobTypeCombo.SelectedItem;

                CommClient.Job myd = new CommClient.Job();
                if (myd.SaveJob(job))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
        }