Exemplo n.º 1
0
        //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 treatMethodDao = new TreatMethodDao())
        //        {
        //            var treatMethod = new TreatMethod();
        //            treatMethod.Name = this.NameTextBox.Text;

        //            var condition = new Dictionary<string, object>();
        //            using (var treatTypeDao = new TreatTypeDao())
        //            {
        //                condition.Clear();
        //                condition["Name"] = ComboBoxTreatType.Text;
        //                var arealist = treatTypeDao.SelectTreatType(condition);
        //                if (arealist.Count == 1)
        //                {
        //                    treatMethod.TreatTypeId = arealist[0].Id;
        //                }
        //            }
        //            treatMethod.Description = this.DescriptionTextBox.Text;
        //            treatMethod.BgColor = ((SolidColorBrush)Buttonrectangle.Fill).Color.ToString();
        //            int lastInsertId = -1;
        //            treatMethodDao.InsertTreatMethod(treatMethod, ref lastInsertId);
        //            //UI
        //            TreatMethodData treatMethodData = new TreatMethodData();
        //            treatMethodData.Id = lastInsertId;
        //            treatMethodData.Name = treatMethod.Name;
        //            treatMethodData.Type = ComboBoxTreatType.Text;
        //            treatMethodData.Description = treatMethod.Description;
        //            treatMethodData.BgColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString(treatMethod.BgColor));
        //            treatMethodData.IsAvailable = treatMethod.IsAvailable;
        //            Datalist.Add(treatMethodData);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        MainWindow.Log.WriteInfoConsole("In CTreatMethod.xaml.cs:AddButton_OnClick exception messsage: " + ex.Message);
        //    }
        //}

        //private void UpdateButton_OnClick(object sender, RoutedEventArgs e)
        //{
        //    if (ListView1.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[ListView1.SelectedIndex].Id;

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

        //        var condition2 = new Dictionary<string, object>();
        //        using (var treatTypeDao = new TreatTypeDao())
        //        {
        //            condition2.Clear();
        //            condition2["Name"] = ComboBoxTreatType.Text;
        //            var arealist = treatTypeDao.SelectTreatType(condition2);
        //            if (arealist.Count == 1)
        //            {
        //                fileds["TREATTYPEID"] = arealist[0].Id;
        //            }
        //        }
        //        fileds["DESCRIPTION"] = DescriptionTextBox.Text;
        //        fileds["ISAVAILABLE"] = CheckBoxIsAvailable.IsChecked;
        //        fileds["BGCOLOR"] = ((SolidColorBrush)Buttonrectangle.Fill).Color.ToString();

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


        //    }
        //}

        private void RefreshData()
        {
            try
            {
                using (var treatMethodDao = new TreatMethodDao())
                {
                    Datalist.Clear();
                    Dictionary <string, object> condition = new Dictionary <string, object>();
                    var list = treatMethodDao.SelectTreatMethod(condition);
                    foreach (TreatMethod pa in list)
                    {
                        var treatMethodData = new TreatMethodData();
                        treatMethodData.Id          = pa.Id;
                        treatMethodData.Name        = pa.Name;
                        treatMethodData.SinglePump  = pa.SinglePump;
                        treatMethodData.DoublePump  = pa.DoublePump;
                        treatMethodData.IsAvailable = pa.IsAvailable;
                        treatMethodData.Description = pa.Description;
                        treatMethodData.BgColor     = new SolidColorBrush((Color)ColorConverter.ConvertFromString(pa.BgColor));
                        Datalist.Add(treatMethodData);
                    }
                }

                if (Datalist.Count != 0)
                {
                    ListViewTreatMethod.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CTreatMethod.xaml.cs:AddButton_OnClick exception messsage: " + ex.Message);
            }
        }
Exemplo n.º 2
0
        //private void ListViewCTreatMethod_OnLoaded(object sender, RoutedEventArgs e)
        //{
        //    //throw new NotImplementedException();
        //    #region refresh data list
        //    try
        //    {
        //        using (var methodDao = new TreatMethodDao())
        //        {
        //            Datalist.Clear();
        //            var condition = new Dictionary<string, object>();
        //            var list = methodDao.SelectTreatMethod(condition);
        //            foreach (var pa in list)
        //            {
        //                var treatMethodData = new TreatMethodData();
        //                treatMethodData.Id = pa.Id;
        //                treatMethodData.Name = pa.Name;
        //                {
        //                    using (var treatTypeDao = new TreatTypeDao())
        //                    {
        //                        condition.Clear();
        //                        condition["ID"] = pa.TreatTypeId;
        //                        var arealist = treatTypeDao.SelectTreatType(condition);
        //                        if (arealist.Count == 1)
        //                        {
        //                            treatMethodData.Type = arealist[0].Name;
        //                        }
        //                    }
        //                }
        //                string bgColor = pa.BgColor;
        //                if(bgColor != "" && bgColor != null)
        //                    treatMethodData.BgColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString(bgColor));
        //                else
        //                    treatMethodData.BgColor = Brushes.LightGray;
        //                treatMethodData.Description = pa.Description;
        //                treatMethodData.IsAvailable = pa.IsAvailable;
        //                Datalist.Add(treatMethodData);
        //            }
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        MainWindow.Log.WriteInfoConsole("In CTreatMethod.xaml.cs:ListViewCPatientRoom_OnLoaded 3 exception messsage: " + ex.Message);
        //    }
        //    #endregion
        //}

        //private void ListViewCTreatMethod_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        //{
        //    //throw new NotImplementedException();
        //    if (ListView1.SelectedIndex >= 0)
        //    {
        //        NameTextBox.Text = Datalist[ListView1.SelectedIndex].Name;
        //        ComboBoxTreatType.Text = Datalist[ListView1.SelectedIndex].Type;
        //        DescriptionTextBox.Text = Datalist[ListView1.SelectedIndex].Description;
        //        CheckBoxIsAvailable.IsChecked = Datalist[ListView1.SelectedIndex].IsAvailable;
        //        Buttonrectangle.Fill = Datalist[ListView1.SelectedIndex].BgColor;
        //    }
        //}

        private bool CheckNameIsExist(string name)
        {
            using (var bedDao = new TreatMethodDao())
            {
                var condition = new Dictionary <string, object>();
                var list      = bedDao.SelectTreatMethod(condition);
                foreach (var pa in list)
                {
                    if (name.Equals(pa.Name))
                    {
                        return(false);
                    }
                }
                return(true);
            }
        }
Exemplo n.º 3
0
        private void ListViewTreatMethod_OnLoaded(object sender, RoutedEventArgs e)
        {
            //throw new NotImplementedException();
            try
            {
                using (TreatMethodDao treatMethodDao = new TreatMethodDao())
                {
                    Datalist.Clear();
                    Dictionary <string, object> condition = new Dictionary <string, object>();
                    var list = treatMethodDao.SelectTreatMethod(condition);
                    foreach (TreatMethod pa in list)
                    {
                        TreatMethodData treatMethodData = new TreatMethodData();
                        treatMethodData.Id          = pa.Id;
                        treatMethodData.Name        = pa.Name;
                        treatMethodData.SinglePump  = pa.SinglePump;
                        treatMethodData.DoublePump  = pa.DoublePump;
                        treatMethodData.IsAvailable = pa.IsAvailable;
                        string bgColor = pa.BgColor;

                        if (bgColor != "" && bgColor != null)
                        {
                            Brush bgBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(bgColor));
                            treatMethodData.BgColor = bgBrush;
                        }
                        else
                        {
                            treatMethodData.BgColor = Brushes.Gray;
                        }
                        treatMethodData.Description = pa.Description;
                        Datalist.Add(treatMethodData);
                    }
                }

                if (Datalist.Count != 0)
                {
                    ListViewTreatMethod.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CTreatMethod.xaml.cs:ListViewTreatMethod_OnLoaded exception messsage: " + ex.Message);
            }
        }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
0
        public void RefreshData()
        {
            try
            {
                if (Basewindow.patientGroupPanel.ListBoxPatient.SelectedIndex == -1)
                {
                    return;
                }
                TreatOrderList.Clear();
                using (MedicalOrderDao medicalOrderDao = new MedicalOrderDao())
                {
                    Dictionary <string, object> condition = new Dictionary <string, object>();
                    condition["PATIENTID"] =
                        Basewindow.patientGroupPanel.Datalist[Basewindow.patientGroupPanel.ListBoxPatient.SelectedIndex]
                        .Id;
                    var list = medicalOrderDao.SelectMedicalOrder(condition);

                    foreach (MedicalOrder medicalOrder in list)
                    {
                        TreatOrder treatOrder = new TreatOrder();
                        treatOrder.Id        = medicalOrder.Id;
                        treatOrder.Activated = medicalOrder.Activated;
                        treatOrder.Seq       = medicalOrder.Seq;
                        treatOrder.Plan      = medicalOrder.Plan;


                        treatOrder.TreatTimes  = (int)medicalOrder.Times;
                        treatOrder.Description = medicalOrder.Description;

                        if (medicalOrder.MethodId != -1)
                        {
                            using (var treatMethodDao = new TreatMethodDao())
                            {
                                condition.Clear();
                                condition["ID"] = (int)medicalOrder.MethodId;
                                var arealist = treatMethodDao.SelectTreatMethod(condition);
                                if (arealist.Count == 1)
                                {
                                    treatOrder.TreatMethod = arealist[0].Name;
                                }
                            }
                        }
                        else
                        {
                            treatOrder.TreatMethod = "NULL";
                        }
                        {
                            using (var medicalOrderParaDao = new MedicalOrderParaDao())
                            {
                                condition.Clear();
                                condition["ID"] = medicalOrder.Interval;
                                var arealist = medicalOrderParaDao.SelectInterval(condition);
                                if (arealist.Count == 1)
                                {
                                    treatOrder.Type = arealist[0].Name;
                                }
                            }
                        }

                        TreatOrderList.Add(treatOrder);
                    }
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In Order.xaml.cs:Init_OnLoaded select patient exception messsage: " + ex.Message);
            }
        }