Beispiel #1
0
        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            if (IsValidForm())
            {
                DbStatus status = await medicalTitleService.Update(new MedicalTitle()
                {
                    Name           = NameBox.Text,
                    IdMedicalTitle = medicalTitle.IdMedicalTitle
                });

                OperationStatus = StatusHandler.Handle(OperationType.Edit, status);
                Close();
            }
            else
            {
                FieldValidation.WriteMessage(ErrorLabel, language.SelectValues);
            }
        }
        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            MedicalTitle entity = new MedicalTitle()
            {
                Name           = NameBox.Text,
                IdMedicalTitle = medicalTitle.IdMedicalTitle
            };

            DbStatus status = await medicalTitleService.Update(entity);

            if (status == DbStatus.SUCCESS)
            {
                WindowHelper.WriteMessage(language.UpdatingSuccess, MessageLabel, true);
            }
            else if (status == DbStatus.NOT_FOUND)
            {
                WindowHelper.WriteMessage(language.EntityNotFound, MessageLabel, false);
            }
            NameBox.Text         = string.Empty;
            SaveButton.IsEnabled = false;
        }