Exemplo n.º 1
0
 /// <summary>
 /// Фильтр персоны, ФИО и Дата
 /// </summary>
 /// <returns></returns>
 private async Task ApplyPersonFiltr()
 {
     ClearDateReceiptFiltr();
     //if (!(fTextBox.IsFocused || iTextBox.IsFocused || oTextBox.IsFocused || dateBirthDayDateePicker.IsFocused))
     //    return;
     await FViewDataContext.SetCardsByFIOViewSource(fTextBox.Text, iTextBox.Text, oTextBox.Text, dateBirthDayDateePicker.SelectedDate);
 }
Exemplo n.º 2
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);
        }