Beispiel #1
0
        public TeethStatusForm(ToothStatus toothStatus)
        {
            InitializeComponent();

            switch (toothStatus)
            {
            case ToothStatus.Healthy:
                healthyTooth.Checked = true;
                break;

            case ToothStatus.Caries:
                cariesTooth.Checked = true;
                break;

            case ToothStatus.Seal:
                sealTooth.Checked = true;
                break;

            case ToothStatus.Removed:
                removedTooth.Checked = true;
                break;

            case ToothStatus.Root:
                rootTooth.Checked = true;
                break;

            case ToothStatus.ArtificialCrown:
                artificialCrownTooth.Checked = true;
                break;

            case ToothStatus.Artificial:
                artificialTooth.Checked = true;
                break;
            }
        }
Beispiel #2
0
 public EditDentalRecordForm(int toothNumber, DateTime date, string diagnosis,
                             ToothStatus fromToothStatus, ToothStatus toToothStatus)
     : this(toothNumber)
 {
     dateTimePicker.Value  = date;
     complaintTextBox.Text = diagnosis;
     fromToothStatusComboBox.SelectedIndex = (int)fromToothStatus;
     toToothStatusComboBox.SelectedIndex   = (int)toToothStatus;
 }
Beispiel #3
0
 public static Color ConvertToColor(this ToothStatus toothStatus)
 {
     return(toothStatus switch
     {
         ToothStatus.Healthy => Color.Green,
         ToothStatus.Caries => Color.Peru,
         ToothStatus.Seal => Color.Blue,
         ToothStatus.Removed => Color.Black,
         ToothStatus.Root => Color.Red,
         ToothStatus.ArtificialCrown => Color.Gold,
         ToothStatus.Artificial => Color.White,
         _ => Color.Purple
     });
        public ActionResult Add(int toothNumber, ToothStatusInputViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }

            var newModel = new ToothStatus
            {
                ToothNumber   = toothNumber,
                Status        = model.Status,
                Diagnose      = model.Diagnose,
                TreatmentPlan = model.TreatmentPlan,
                PatientId     = (int)this.TempData["PatientId"]
            };

            this.toothStatus.Add(newModel);

            return(this.Redirect($"/Patient/Details/{newModel.PatientId}"));
        }
Beispiel #5
0
 public void Add(ToothStatus toothStatus)
 {
     this.toothStatus.Add(toothStatus);
     this.toothStatus.Save();
 }