private void SaveBtn_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(this.NameEdit.Text.Trim())) { return; } if (bIsEdit) { m_WorkType.Name = this.NameEdit.Text; CommClient.WorkType WorkTypeClient = new CommClient.WorkType(); if (WorkTypeClient.UpdateWorkType(m_WorkType)) { (this.Parent as Window).DialogResult = true; (this.Parent as Window).Close(); } } else { CommContracts.WorkType WorkType = new CommContracts.WorkType(); WorkType.Name = this.NameEdit.Text; CommClient.WorkType WorkTypeClient = new CommClient.WorkType(); if (WorkTypeClient.SaveWorkType(WorkType)) { (this.Parent as Window).DialogResult = true; (this.Parent as Window).Close(); } } }
// 得到所有的值班类别 public List <CommContracts.WorkType> GetAllWorkType(string strName = "") { CommClient.WorkType myd = new CommClient.WorkType(); List <CommContracts.WorkType> list = new List <CommContracts.WorkType>(); list = myd.GetAllWorkType(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(); }
// 删除供值班类别 public bool DeleteWorkType(int WorkTypeID) { CommClient.WorkType myd = new CommClient.WorkType(); if (myd.DeleteWorkType(WorkTypeID)) { return(true); } return(false); }
private void initDateClinicMsgGrid() { this.DateClinicMsgGrid.Columns.Clear(); CommClient.WorkType myd = new CommClient.WorkType(); List <CommContracts.WorkType> listOfAllWorkTypes = myd.GetAllWorkType(); DataGridLength length = new DataGridLength(1, DataGridLengthUnitType.Star); this.DateClinicMsgGrid.Columns.Add(new DataGridTextColumn() { Header = "人员", Binding = new Binding("Name"), Width = 100, IsReadOnly = true //, //Foreground = Brushes.Blue // 设置该列字体颜色 }); this.DateClinicMsgGrid.Columns.Add(new DataGridTextColumn() { Header = "时段", Binding = new Binding("ShiftName"), Width = 100, IsReadOnly = true //, //Foreground = Brushes.Blue // 设置该列字体颜色 }); for (int i = 0; i < 7; i++) { DateTime tempDate = getMonday(currentManageDate).AddDays(i); this.DateClinicMsgGrid.Columns.Add(new DataGridComboBoxColumn() { Header = tempDate.ToString("yyyy-MM-dd dddd"), SelectedItemBinding = new Binding("WorkPlanWorkTypeList[" + (int)tempDate.DayOfWeek + "]"), ItemsSource = listOfAllWorkTypes, Width = length, IsReadOnly = (tempDate.Date >= DateTime.Now.Date ? false : true) }); } this.DateClinicMsgGrid.Columns.Add(new DataGridTextColumn() { Header = "最大工作量", Binding = new Binding("MaxVistNum"), Width = 100, IsReadOnly = false, Foreground = Brushes.Green // 设置该列字体颜色 }); }