private void Submit_Click(object sender, RoutedEventArgs e)
        {
            var viewmodel = (this.DataContext as EditDiagnoseViewModel);

            var isValid = viewmodel.IsModelValid();

            if (isValid)
            {
                viewmodel.Save.Execute(null);
                NavigationService.Navigate(new HomeDiagnoses());
            }
            else
            {
                if (this.Name.Text == null || this.Name.Text == "")
                {
                    this.Name.Text = "";
                }
                if (this.Code.Text == null || this.Code.Text == "")
                {
                    this.Code.Text = "";
                }

                var service = new DiagnoseService();

                if (service.ExistUpdate(this.Code.Text, viewmodel.Id))
                {
                    ErrorExist.Text = "Съществува диагноза с този код.";
                }
                else
                {
                    ErrorExist.Text = "";
                }
            }
        }
Beispiel #2
0
        public SetToothSymbol()
        {
            InitializeComponent();
            var button = new Button();

            button.Click   += ChooseType_Click;
            button.Height   = 35;
            button.Margin   = new Thickness(0, 2, 0, 2);
            button.FontSize = 16;
            button.Tag      = 0;
            button.Content  = "Нищо";
            this.Diagnoses.Children.Add(button);

            var items = new DiagnoseService().GetAll();

            foreach (var item in items)
            {
                var buttonRef = new Button();
                buttonRef.Click   += ChooseType_Click;
                buttonRef.Height   = 35;
                buttonRef.Margin   = new Thickness(0, 2, 0, 2);
                buttonRef.FontSize = 16;
                buttonRef.Tag      = item.Id;
                buttonRef.Content  = item.Name + " - " + item.Code;
                this.Diagnoses.Children.Add(buttonRef);
            }
        }
Beispiel #3
0
 public DiagnoseController(DiagnoseService diagnoseService, HealthCheckService healthCheckService, DoctorService doctorService, PatientService patientService, UserManager <ApplicationUser> userManager)
 {
     _diagnoseService    = diagnoseService;
     _healthCheckService = healthCheckService;
     _doctorService      = doctorService;
     _patientService     = patientService;
     _userManager        = userManager;
 }
 public UserController(UserService userService, DiagnoseService diagnoseService,
                       TreatService treatService, TreatImageService treatImageService, IOptions <MyOptions> optionsAccessor)
 {
     _userService       = userService;
     _diagnoseService   = diagnoseService;
     _treatService      = treatService;
     _treatImageService = treatImageService;
     _optionsAccessor   = optionsAccessor.Value;
     _lovePlatformApi   = new LovePlatformAdminApi(_optionsAccessor.WebApiUrl);
 }
Beispiel #5
0
 public DoctorDashboardController(PatientService patientsService, DiagnoseService diagnoseService,
                                  HealthCheckService healthCheckService, UserManager <ApplicationUser> userManager, DoctorService doctorService, TreatmentService treatmentService)
 {
     _patientsService    = patientsService;
     _diagnoseService    = diagnoseService;
     _healthCheckService = healthCheckService;
     _doctorService      = doctorService;
     _userManager        = userManager;
     _treatmentService   = treatmentService;
 }
Beispiel #6
0
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            string stringValue = "";

            if (value is BindingExpression)
            {
                // ValidationStep was UpdatedValue or CommittedValue (Validate after setting)
                // Need to pull the value out of the BindingExpression.
                BindingExpression binding = (BindingExpression)value;

                // Get the bound object and name of the property
                object dataItem = binding.DataItem;

                var model = (dataItem as KDentist.ViewModels.DiagnosesViewModels.DiagnosesHomeViewModel)
                            .AddDiagnoseViewModel;

                stringValue = model
                              .GetType()
                              .GetProperty(binding.ResolvedSourcePropertyName)
                              .GetValue(model, null)
                              .ToString();
            }
            if (String.IsNullOrEmpty(stringValue))
            {
                return(new ValidationResult(false, "Полето е задължително."));
            }
            if (stringValue.Count() > 4)
            {
                return(new ValidationResult(false, "Максималният брой символи е 4."));
            }
            var service = new DiagnoseService();

            if (service.Exist(stringValue))
            {
                return(new ValidationResult(false, "Съществува диагноза с този код."));
            }
            return(ValidationResult.ValidResult);
        }
Beispiel #7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="diagnoseService"></param>
 public DiagnoseController(DiagnoseService diagnoseService)
 {
     _diagnoseService = diagnoseService;
 }
 public ExcelController(IHostingEnvironment hostingEnvironment, UserService userService, DiagnoseService diagnoseService)
 {
     _hostingEnvironment = hostingEnvironment;
     _userService        = userService;
     _diagnoseService    = diagnoseService;
 }
 public AnalysisController(UserService userService, DiagnoseService diagnoseService)
 {
     _userService     = userService;
     _diagnoseService = diagnoseService;
 }