private void AddButton_OnClick(object sender, RoutedEventArgs e)
        {
            //throw new NotImplementedException();
            try
            {
                if (this.NameTextBox.Text.Equals("") || !CheckNameIsExist(this.NameTextBox.Text))
                {
                    var a = new RemindMessageBox1();
                    a.remindText.Text = (string)FindResource("Message1001");;
                    a.ShowDialog();
                    return;
                }

                using (var medicalOrderParaDao = new MedicalOrderParaDao())
                {
                    var medicalOrderPara = new MedicalOrderPara();
                    medicalOrderPara.Name        = this.NameTextBox.Text;
                    medicalOrderPara.Type        = this.ComboBoxType.Text;
                    medicalOrderPara.Count       = Int32.Parse(this.CountTextBox.Text);
                    medicalOrderPara.Description = this.DescriptionTextBox.Text;
                    int lastInsertId = -1;
                    medicalOrderParaDao.InsertInterval(medicalOrderPara, ref lastInsertId);
                    //UI
                    var medicalOrderParaData = new MedicalOrderParaData();
                    medicalOrderParaData.Id          = medicalOrderPara.Id;
                    medicalOrderParaData.Name        = medicalOrderPara.Name;
                    medicalOrderParaData.Type        = medicalOrderPara.Type;
                    medicalOrderParaData.Count       = medicalOrderPara.Count;
                    medicalOrderParaData.Description = medicalOrderPara.Description;
                    Datalist.Add(medicalOrderParaData);
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CMedicalOrderPara.xaml.cs:AddButton_OnClick exception messsage: " + ex.Message);
            }
        }
        private void UpdateButton_OnClick(object sender, RoutedEventArgs e)
        {
            //throw new NotImplementedException();
            try
            {
                if (ListView1.SelectedIndex == -1)
                {
                    return;
                }

                if (this.NameTextBox.Text.Equals(""))
                {
                    var a = new RemindMessageBox1();
                    a.remindText.Text = (string)FindResource("Message1001");;
                    a.ShowDialog();
                    return;
                }
                using (var medicalOrderParaDao = new MedicalOrderParaDao())
                {
                    var condition = new Dictionary <string, object>();
                    condition["ID"] = Datalist[ListView1.SelectedIndex].Id;

                    var fileds = new Dictionary <string, object>();
                    fileds["NAME"]        = NameTextBox.Text;
                    fileds["TYPE"]        = ComboBoxType.Text;
                    fileds["COUNT"]       = Int32.Parse(CountTextBox.Text);
                    fileds["DESCRIPTION"] = DescriptionTextBox.Text;
                    medicalOrderParaDao.UpdateInterval(fileds, condition);
                    RefreshData();
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CMedicalOrderPara.xaml.cs:UpdateButton_OnClick exception messsage: " + ex.Message);
            }
        }
Esempio n. 3
0
        private void ButtonApply_OnClick(object sender, RoutedEventArgs e)
        {
            if (ListViewTreatMethod.SelectedIndex == -1)
            {
                return;
            }

            if (this.NameTextBox.Text.Equals(""))
            {
                var a = new RemindMessageBox1();
                a.remindText.Text = (string)FindResource("Message1001");;
                a.ShowDialog();
                return;
            }
            //throw new NotImplementedException();
            using (var treatMethodDao = new TreatMethodDao())
            {
                var condition = new Dictionary <string, object>();
                condition["ID"] = Datalist[ListViewTreatMethod.SelectedIndex].Id;

                var fileds = new Dictionary <string, object>();
                fileds["NAME"] = NameTextBox.Text;
                if ((bool)(this.CheckBox1.IsChecked))
                {
                    fileds["SINGLEPUMP"] = true;
                }
                else
                {
                    fileds["SINGLEPUMP"] = false;
                }
                if ((bool)(this.CheckBox2.IsChecked))
                {
                    fileds["DOUBLEPUMP"] = true;
                }
                else
                {
                    fileds["DOUBLEPUMP"] = false;
                }

                if ((bool)(this.RadioButton1.IsChecked))
                {
                    fileds["ISAVAILABLE"] = true;
                }
                else if ((bool)(this.RadioButton2.IsChecked))
                {
                    fileds["ISAVAILABLE"] = false;
                }

                fileds["DESCRIPTION"] = DescriptionTextBox.Text;

                fileds["BGCOLOR"] = ((SolidColorBrush)Buttonrectangle.Fill).Color.ToString();

                var messageBox2 = new RemindMessageBox2();
                messageBox2.textBlock1.Text = "执行该操作将影响医嘱及排班";
                messageBox2.ShowDialog();
                if (messageBox2.remindflag == 1)
                {
                    treatMethodDao.UpdateTreatMethod(fileds, condition);
                    int temp = this.ListViewTreatMethod.SelectedIndex;
                    RefreshData();
                    this.ListViewTreatMethod.SelectedIndex = temp;
                }
            }

            this.ButtonApply.IsEnabled = false;
        }
        private void ButtonApply_OnClick(object sender, RoutedEventArgs e)
        {
            if (isNew)
            {
                //throw new NotImplementedException();
                try
                {
                    if (this.NameTextBox.Text.Equals("") || !CheckNameIsExist(this.NameTextBox.Text))
                    {
                        var a = new RemindMessageBox1();
                        a.remindText.Text = (string)FindResource("Message1001");;
                        a.ShowDialog();
                        return;
                    }
                    using (var infectTypeDao = new InfectTypeDao())
                    {
                        var infectType = new InfectType();
                        infectType.Name        = this.NameTextBox.Text;
                        infectType.Description = this.DescriptionTextBox.Text;
                        int lastInsertId = -1;
                        infectTypeDao.InsertInfectType(infectType, ref lastInsertId);
                        //UI
                        var infectTypeData = new InfectTypeData();
                        infectTypeData.Id          = infectType.Id;
                        infectTypeData.Name        = infectType.Name;
                        infectTypeData.Description = infectType.Description;
                        Datalist.Add(infectTypeData);
                    }
                }
                catch (Exception ex)
                {
                    MainWindow.Log.WriteInfoConsole("In CInfectType.xaml.cs:AddButton_OnClick exception messsage: " + ex.Message);
                }
            }
            else
            {
                if (ListViewInfectType.SelectedIndex == -1)
                {
                    return;
                }

                if (this.NameTextBox.Text.Equals(""))
                {
                    var a = new RemindMessageBox1();
                    a.remindText.Text = (string)FindResource("Message1001");;
                    a.ShowDialog();
                    return;
                }

                //throw new NotImplementedException();
                using (var infectTypeDao = new InfectTypeDao())
                {
                    var condition = new Dictionary <string, object>();
                    condition["ID"] = Datalist[ListViewInfectType.SelectedIndex].Id;

                    var fileds = new Dictionary <string, object>();
                    fileds["NAME"]        = NameTextBox.Text;
                    fileds["DESCRIPTION"] = DescriptionTextBox.Text;
                    infectTypeDao.UpdateInfectType(fileds, condition);
                    int temp = this.ListViewInfectType.SelectedIndex;
                    RefreshData();
                    this.ListViewInfectType.SelectedIndex = temp;
                }
                isNew = false;
            }
            this.ButtonApply.IsEnabled = false;
        }
        private void ButtonApply_OnClick(object sender, RoutedEventArgs e)
        {
            if (isNew)
            {
                //throw new NotImplementedException();
                try
                {
                    int index = ListViewPatientGroup.SelectedIndex;
                    if (index == -1)
                    {
                        return;
                    }

                    if (Datalist[index].Name.Equals("") || !CheckNameIsExist(Datalist[index].Name))
                    {
                        var a = new RemindMessageBox1();
                        a.remindText.Text = (string)FindResource("Message1001");;
                        a.ShowDialog();
                        return;
                    }

                    using (PatientGroupDao patientGroupDao = new PatientGroupDao())
                    {
                        PatientGroup patientGroup = new PatientGroup();
                        patientGroup.Name        = Datalist[index].Name;
                        patientGroup.Description = Datalist[index].Description;
                        int lastInsertId = -1;
                        patientGroupDao.InsertPatientGroup(patientGroup, ref lastInsertId);
                        //UI
                        //PatientGroupData patientGroupData = new PatientGroupData();
                        //patientGroupData.Id = lastInsertId;
                        //patientGroupData.Name = patientGroup.Name;
                        //patientGroupData.Description = patientGroup.Description;

                        //Datalist.Add(patientGroupData);
                        var patientData = new PatientData();
                        patientData.Id   = lastInsertId;
                        patientData.Name = patientGroup.Name;
                        //Basewindow.patientGroupPanel.Datalist.Add(patientData);

                        Basewindow.patientGroupPanel.ComboBoxPatientGroup.Items.Add(patientGroup.Name);
                        Basewindow.sheduleContent.PatientGroupComboBoxItems.Add(patientGroup.Name);

                        Datalist[index].Id = lastInsertId;
                    }
                    RefreshData();
                }
                catch (Exception ex)
                {
                    MainWindow.Log.WriteInfoConsole("In CPatientGroup.xaml.cs:ButtonApply_OnClick exception messsage: " + ex.Message);
                    return;
                }
                this.ButtonNew.IsEnabled    = true;
                this.ButtonDelete.IsEnabled = true;
                this.ButtonApply.IsEnabled  = true;
                this.ButtonCancel.IsEnabled = true;
                isNew = false;
            }
            else
            {
                int index = ListViewPatientGroup.SelectedIndex;
                if (index == -1)
                {
                    return;
                }

                if (this.Datalist[index].Name.Equals(""))
                {
                    var a = new RemindMessageBox1();
                    a.remindText.Text = (string)FindResource("Message1001");;
                    a.ShowDialog();
                    return;
                }

                //throw new NotImplementedException();
                using (var patientGroupDao = new PatientGroupDao())
                {
                    var condition = new Dictionary <string, object>();
                    condition["ID"] = Datalist[index].Id;

                    var fileds = new Dictionary <string, object>();
                    fileds["NAME"]        = Datalist[index].Name;
                    fileds["DESCRIPTION"] = Datalist[index].Description;
                    patientGroupDao.UpdatePatientGroup(fileds, condition);
                    int temp = this.ListViewPatientGroup.SelectedIndex;
                    RefreshData();
                    this.ListViewPatientGroup.SelectedIndex = temp;
                }
            }

            this.ButtonDelete.IsEnabled = true;

            this.ButtonApply.IsEnabled  = false;
            this.ButtonCancel.IsEnabled = false;

            ParSettingGrid.IsEnabled           = true;
            ListViewPatientGroupPara.IsEnabled = true;
        }
        private void ButtonApply_OnClick(object sender, RoutedEventArgs e)
        {
            if (isNew)
            {
                //throw new NotImplementedException();
                try
                {
                    if (this.NameTextBox.Text.Equals("") || !CheckNameIsExist(this.NameTextBox.Text) || SeqTextBox.Text.Equals(""))
                    {
                        var a = new RemindMessageBox1();
                        a.remindText.Text = "请完善信息!";
                        a.ShowDialog();
                        return;
                    }

                    using (PatientAreaDao patientAreaDao = new PatientAreaDao())
                    {
                        PatientArea patientArea = new PatientArea();
                        patientArea.Name = this.NameTextBox.Text;
                        var condition = new Dictionary <string, object>();
                        using (var infectTypeDao = new InfectTypeDao())
                        {
                            condition.Clear();
                            condition["Name"] = InfectionComboBox.Text;
                            var arealist = infectTypeDao.SelectInfectType(condition);
                            if (arealist.Count == 1)
                            {
                                patientArea.InfectTypeId = arealist[0].Id;
                            }
                            else
                            {
                                patientArea.InfectTypeId = 1;
                            }
                        }
                        if ((bool)this.RadioButton1.IsChecked)
                        {
                            patientArea.Type = "0";
                        }
                        else if ((bool)this.RadioButton2.IsChecked)
                        {
                            patientArea.Type = "1";
                        }
                        patientArea.Description = this.DescriptionTextBox.Text;
                        patientArea.Position    = this.PositionTextBox.Text;
                        patientArea.Seq         = int.Parse(this.SeqTextBox.Text);
                        int lastInsertId = -1;
                        patientAreaDao.InsertPatientArea(patientArea, ref lastInsertId);
                        //UI
                        PatientAreaData patientAreaData = new PatientAreaData();
                        patientAreaData.Name = patientArea.Name;
                        if ((bool)this.RadioButton1.IsChecked)
                        {
                            patientAreaData.InfectionType = "阴性";
                            patientAreaData.Type          = "0";
                        }

                        else if ((bool)this.RadioButton2.IsChecked)
                        {
                            patientAreaData.Type = "1";
                        }

                        patientAreaData.Description = patientArea.Description;
                        patientAreaData.Position    = patientArea.Position;
                        patientAreaData.Seq         = patientArea.Seq;

                        Datalist.Add(patientAreaData);
                    }
                }
                catch (Exception ex)
                {
                    MainWindow.Log.WriteInfoConsole("In CPatientArea.xaml.cs:ButtonApply_OnClick exception messsage: " + ex.Message);
                    return;
                }
                this.ButtonNew.IsEnabled    = true;
                this.ButtonDelete.IsEnabled = true;
                this.ButtonApply.IsEnabled  = true;
                this.ButtonCancel.IsEnabled = true;
            }
            else
            {
                if (ListViewPatientArea.SelectedIndex == -1)
                {
                    return;
                }

                if (this.NameTextBox.Text.Equals(""))
                {
                    var a = new RemindMessageBox1();
                    a.remindText.Text = (string)FindResource("Message1001");;
                    a.ShowDialog();
                    return;
                }

                //throw new NotImplementedException();
                using (var patientAreaDao = new PatientAreaDao())
                {
                    var condition = new Dictionary <string, object>();
                    condition["ID"] = Datalist[ListViewPatientArea.SelectedIndex].Id;

                    var fileds = new Dictionary <string, object>();
                    fileds["NAME"] = NameTextBox.Text;
                    var condition2 = new Dictionary <string, object>();
                    using (var infectTypeDao = new InfectTypeDao())
                    {
                        condition2.Clear();
                        condition2["NAME"] = InfectionComboBox.Text;
                        var arealist = infectTypeDao.SelectInfectType(condition2);
                        if (arealist.Count == 1)
                        {
                            fileds["INFECTTYPEID"] = arealist[0].Id;
                        }
                        else
                        {
                            fileds["INFECTTYPEID"] = 1;
                        }
                    }
                    if ((bool)this.RadioButton1.IsChecked)
                    {
                        fileds["TYPE"] = "0";
                    }
                    else if ((bool)this.RadioButton2.IsChecked)
                    {
                        fileds["TYPE"] = "1";
                    }
                    fileds["SEQ"]         = SeqTextBox.Text;
                    fileds["POSITION"]    = PositionTextBox.Text;
                    fileds["DESCRIPTION"] = DescriptionTextBox.Text;
                    patientAreaDao.UpdatePatientArea(fileds, condition);
                    int temp = this.ListViewPatientArea.SelectedIndex;
                    RefreshData();
                    this.ListViewPatientArea.SelectedIndex = temp;
                }
                isNew = false;
            }
            this.ButtonApply.IsEnabled  = false;
            this.ButtonCancel.IsEnabled = false;
        }
Esempio n. 7
0
        private void ButtonApply_OnClick(object sender, RoutedEventArgs e)
        {
            if (isNew)
            {
                try
                {
                    if (this.NameTextBox.Text.Equals("") || !CheckNameIsExist(this.NameTextBox.Text))
                    {
                        var a = new RemindMessageBox1();
                        a.remindText.Text = (string)FindResource("Message1001");;
                        a.ShowDialog();
                        return;
                    }

                    using (var bedDao = new BedDao())
                    {
                        var bed = new DAOModule.Bed();
                        bed.Name = this.NameTextBox.Text;

                        var condition = new Dictionary <string, object>();
                        //using (var machianTypeDao = new MachineTypeDao())
                        //{
                        //    condition.Clear();
                        //    condition["Name"] = MachineTypeComboBox.Text;
                        //    var arealist = machianTypeDao.SelectMachineType(condition);
                        //    if (arealist.Count == 1)
                        //    {
                        //        bed.MachineTypeId = arealist[0].Id;
                        //    }
                        //}
                        if ((bool)(this.RadioButton1.IsChecked))
                        {
                            bed.MachineTypeId = 0;
                        }
                        else if ((bool)(this.RadioButton2.IsChecked))
                        {
                            bed.MachineTypeId = 1;
                        }
                        using (var patientAreaDao = new PatientAreaDao())
                        {
                            condition.Clear();
                            condition["Name"] = ComboBoxPatientArea.Text;
                            var arealist = patientAreaDao.SelectPatientArea(condition);
                            if (arealist.Count == 1)
                            {
                                bed.PatientAreaId = arealist[0].Id;
                            }
                        }

                        if ((bool)(RadioButton3.IsChecked))
                        {
                            bed.IsAvailable = true;
                        }
                        else if ((bool)(RadioButton4.IsChecked))
                        {
                            bed.IsAvailable = false;
                        }

                        if ((bool)(RadioButton5.IsChecked))
                        {
                            bed.IsTemp = true;
                        }
                        else if ((bool)(RadioButton6.IsChecked))
                        {
                            bed.IsTemp = false;
                        }

                        bed.IsOccupy    = false;
                        bed.Description = this.DescriptionTextBox.Text;
                        int lastInsertId = -1;
                        bedDao.InsertBed(bed, ref lastInsertId);
                        //UI
                        BedData bedData = new BedData();
                        bedData.Id          = lastInsertId;
                        bedData.Name        = bed.Name;
                        bedData.PatientArea = ComboBoxPatientArea.Text;
                        bedData.TreatType   = "";
                        bedData.IsTemp      = bed.IsTemp;
                        if (bed.MachineTypeId == 0)
                        {
                            bedData.MachineType = "单泵机";
                        }
                        else if (bed.MachineTypeId == 1)
                        {
                            bedData.MachineType = "双泵机";
                        }
                        bedData.InfectType  = "";
                        bedData.IsAvailable = bed.IsAvailable;
                        bedData.IsOccupy    = bed.IsOccupy;
                        bedData.Description = bed.Description;
                        int temp = this.ListViewBed.SelectedIndex;
                        RefreshData();
                        this.ListViewBed.SelectedIndex = temp;
                    }
                }
                catch (Exception ex)
                {
                    MainWindow.Log.WriteInfoConsole("In CBed.xaml.cs:AddButton_OnClick exception messsage: " + ex.Message);
                }
                this.ButtonNew.IsEnabled    = true;
                this.ButtonDelete.IsEnabled = true;
                this.ButtonApply.IsEnabled  = true;
                this.ButtonCancel.IsEnabled = true;
            }
            else
            {
                if (ListViewBed.SelectedIndex == -1)
                {
                    return;
                }

                if (this.NameTextBox.Text.Equals(""))
                {
                    var a = new RemindMessageBox1();
                    a.remindText.Text = (string)FindResource("Message1001");;
                    a.ShowDialog();
                    return;
                }
                //throw new NotImplementedException();
                using (var bedDao = new BedDao())
                {
                    var condition = new Dictionary <string, object>();
                    condition["ID"] = Datalist[ListViewBed.SelectedIndex].Id;

                    var fileds = new Dictionary <string, object>();
                    fileds["NAME"] = NameTextBox.Text;

                    var condition2 = new Dictionary <string, object>();

                    //using (var machianTypeDao = new MachineTypeDao())
                    //{
                    //    condition2.Clear();
                    //    condition2["Name"] = MachineTypeComboBox.Text;
                    //    var arealist = machianTypeDao.SelectMachineType(condition2);
                    //    if (arealist.Count == 1)
                    //    {
                    //        fileds["MachineTypeId"] = arealist[0].Id;
                    //    }
                    //}

                    if ((bool)(this.RadioButton1.IsChecked))
                    {
                        fileds["MachineTypeId"] = 0;
                    }
                    else if ((bool)(this.RadioButton2.IsChecked))
                    {
                        fileds["MachineTypeId"] = 1;
                    }

                    using (var patientAreaDao = new PatientAreaDao())
                    {
                        condition2.Clear();
                        condition2["Name"] = ComboBoxPatientArea.Text;
                        var arealist = patientAreaDao.SelectPatientArea(condition2);
                        if (arealist.Count == 1)
                        {
                            fileds["PATIENTAREAID"] = arealist[0].Id;
                        }
                    }
                    if ((bool)(this.RadioButton3.IsChecked))
                    {
                        fileds["ISAVAILABLE"] = true;
                    }
                    else if ((bool)(this.RadioButton4.IsChecked))
                    {
                        fileds["ISAVAILABLE"] = false;
                    }

                    if ((bool)(this.RadioButton5.IsChecked))
                    {
                        fileds["ISTEMP"] = true;
                    }
                    else if ((bool)(this.RadioButton6.IsChecked))
                    {
                        fileds["ISTEMP"] = false;
                    }

                    //fileds["ISOCCUPY"] = CheckBoxIsOccupy.IsChecked;
                    fileds["DESCRIPTION"] = DescriptionTextBox.Text;
                    bedDao.UpdateBed(fileds, condition);
                    if ((bool)(this.RadioButton4.IsChecked))
                    {
                        using (ScheduleTemplateDao scheduleDao = new ScheduleTemplateDao())
                        {
                            scheduleDao.UpdateScheduleTemplate1("-1", Datalist[ListViewBed.SelectedIndex].Id.ToString(), DateTime.Now.Date);
                        }
                    }
                    int temp = this.ListViewBed.SelectedIndex;
                    RefreshData();
                    this.ListViewBed.SelectedIndex = temp;
                }
                isNew = false;
            }
            this.ButtonApply.IsEnabled = false;
        }