Ejemplo n.º 1
0
        public void PrintCard(tblPatientInfo patient)
        {
            var xCardSource = new List <tblPatientInfo>(1);

            xCardSource.Add(patient);
            PrintCards(xCardSource);
        }
Ejemplo n.º 2
0
        private async Task PrintaCard(tblPatientInfo currentPatient)
        {
            await FViewDataContext.SaveAllCangesAsync(); // получить все номер аи ID

            // печатаем
            currentPatient.Printed = true;
            await FViewDataContext.SaveAllCangesAsync();
        }
Ejemplo n.º 3
0
        private void cmdAddPatientAndCadr(object sender, ExecutedRoutedEventArgs e)
        {
            tblPatientInfo xNewPatient = new tblPatientInfo()
            {
                Location = CardLocation.Receptopn
            };

            ObservableCollection <tblPatientInfo> xPatientsSource = FViewDataContext.PatientInfos;

            xPatientsSource.Add(xNewPatient);
            FViewDataContext.PatientInfoViewSource.View.MoveCurrentTo(xNewPatient);
        }
Ejemplo n.º 4
0
        private async void pnlMainPanient_DateTimeLostEvent(string f, string i, string o, DateTime birthDate)
        {
            tblPatientInfo xCurrent = FViewDataContext.CurrentPatient;

            if (xCurrent == null)
            {
                return;
            }

            if (!Guid.Empty.Equals(xCurrent.ID))
            {
                return;
            }

            List <tblPatientInfo> xPatients = await FDataHelper.FindPatientIDByFIOData(f, i, o, birthDate);

            if (xPatients.Count == 0)
            {
                return;
            }

            StringBuilder xMsg = new StringBuilder();

            xMsg.AppendFormat("Такие данные уже есть.     {0} {1} {2}, дата рождения {3: dd MMMM yyyy}", f, i, o, birthDate); xMsg.AppendLine();
            xMsg.AppendLine();
            xMsg.Append(xPatients.Count > 1 ? "№ карточек:\r\n" : "№ карточки: ");
            xMsg.Append(string.Join(";\r\n", xPatients.Select(ptnt => string.Format("{0}, зарегистрирована {1: dd MMMM yyyy}", ptnt.Number, ptnt.DateCreate)).ToArray()));
            xMsg.AppendLine(".");
            xMsg.AppendLine();
            xMsg.AppendLine("Да  - Все равно ввести новые данные");
            xMsg.AppendLine("Нет - Отменить ввод и просмотреть существующие данные");

            MessageBoxResult xRes = System.Windows.MessageBox.Show(xMsg.ToString(), "Внимание", MessageBoxButton.YesNo, MessageBoxImage.Stop);

            if (xRes == MessageBoxResult.Yes)
            {
                return;
            }

            xCurrent.ForceRemove = true;
            FViewDataContext.PatientInfos.Remove(xCurrent);
            await SaveAllChanges();

            await FViewDataContext.SetCardsByFIOViewSource(f, i, o, birthDate);
        }
Ejemplo n.º 5
0
        private void cmdDeleteCurrentPatient(object sender, ExecutedRoutedEventArgs e)
        {
            tblPatientInfo xCurrent = FViewDataContext.CurrentPatient;

            if (xCurrent == null)
            {
                return;
            }

            MessageBoxResult xRes = System.Windows.MessageBox.Show(string.Format("Удалить карточку № {0}", xCurrent.Number), "Удаление", MessageBoxButton.YesNo, MessageBoxImage.Stop, MessageBoxResult.No);

            if (xRes != MessageBoxResult.Yes)
            {
                return;
            }

            FViewDataContext.PatientInfos.Remove(xCurrent);
        }
Ejemplo n.º 6
0
        private bool CheckBeforeAddDoc()
        {
            tblPatientInfo xPatient = FViewDataContext.CurrentPatient;

            if (xPatient == null)
            {
                MessageBox.Show("Не выбран пациент", "Предупреждение", MessageBoxButton.OK);
                return(false);
            }
            if (!dtpDate.SelectedDate.HasValue)
            {
                MessageBox.Show("Выберите дату", "Предупреждение", MessageBoxButton.OK);
                return(false);
            }


            return(true);
        }
Ejemplo n.º 7
0
        private void AddManipulation(tblOffer offer, tblEmployee employee = null)
        {
            tblPatientInfo xPatientInfo = FViewDataContext.CurrentPatient;

            if (xPatientInfo == null)
            {
                System.Windows.MessageBox.Show("Не выбран пациент");
                return;
            }

            tblManipulation xManipulation = new tblManipulation()
            {
                tblPatient      = xPatientInfo,
                tblOffer        = offer,
                Price           = offer.DefaultPrice,
                DateRealization = DateTime.Now,
                Eye             = Eye.OU,
                tblEmployee     = employee
            };

            xPatientInfo.tblManipulationsObs.Add(xManipulation);
        }
Ejemplo n.º 8
0
        private async void btnPrintDefaultCard(object sender, RoutedEventArgs e)
        {
            tblPatientInfo xCurrentPatient = FViewDataContext.CurrentPatient;

            await PrintaCard(xCurrentPatient);
        }
Ejemplo n.º 9
0
 public CardFormN_025uAdapter(tblPatientInfo patient)
 {
     FPatient = patient;
 }
Ejemplo n.º 10
0
 public CardDataAdapter(tblPatientInfo patient)
 {
     FPatient = patient;
 }