public Dosage(int i,string dosage, Medicine _for) { this.id = i; this.dose = dosage; this.md = _for; }
public void addCurrentDosageToGrid() { TextBox t = null; string mi, ni, ei, di; textViews.TryGetValue("morningRoot_txt", out t); mi = t.Text; textViews.TryGetValue("afternoonRoot_txt", out t); ni = t.Text; textViews.TryGetValue("eveningRoot_txt", out t); ei = t.Text; textViews.TryGetValue("dosageRoot_txt", out t); di = t.Text; if (currentDosage.getMedicine() == null) // we have'nt seen this med before so lets save it. { textViews.TryGetValue("medicationRoot_txt", out t); int medId = DB.addMedicine(t.Text); Medicine newMed = new Medicine(medId, t.Text); currentDosage = new Dosage(di, newMed); currentDosage.setDose(Int32.Parse(mi), Int32.Parse(ni), Int32.Parse(ei)); } else { currentDosage.replaceIfUpdated(di, Int32.Parse(mi), Int32.Parse(ni), Int32.Parse(ei)); } int[] mne = currentDosage.getDose(); medGrid.Rows.Add(currentDosage.getMedicine().getName(), currentDosage.getRecommended(), mne[0], mne[1], mne[2]); patientInView.getCurrentPrescription().add(currentDosage); currentDosage = new Dosage("", null); }
public Dosage(string dosage,Medicine _for) { this.dose = dosage; this.md = _for; }