protected void LoadData(PreviousMedicalRecord pmr) { if (pmr != null) { RadEditor1.Content = pmr.Content; } }
protected void UnloadData(PreviousMedicalRecord pmr) { if (pmr == null) { pmr = new PreviousMedicalRecord(); pmr.Patient = patient; ctx.Add(pmr); ctx.SaveChanges(); } pmr.Content = RadEditor1.Content; ctx.SaveChanges(); RadWindowManager1.RadConfirm(Resources.GeneralResource.DataStoredOk, "noHaceNada()", null, null, null, Resources.GeneralResource.Warning); }
public static void LoadPreviousMedicalRecords(RdcModel ctxRid, AriClinicContext ctx) { // definiciones int nr = 0, r = 0; // numero de registros, registro actual // primero hay que cargar los historiales anteriores nr = ctxRid.Historials.Count(); r = 0; foreach (Historial his in ctxRid.Historials) { Console.WriteLine("Previous MR -> {1:000000}/{2:000000} {0} ", his.Nombre, ++r, nr); PreviousMedicalRecord pmr = new PreviousMedicalRecord(); Patient patient = (from p in ctx.Patients where p.OftId == his.Id_historia select p).FirstOrDefault <Patient>(); if (patient != null) { pmr.Patient = patient; pmr.Content = his.Historia_anterior; ctx.Add(pmr); ctx.SaveChanges(); } } }
protected void Page_Init(object sender, EventArgs e) { ctx = new AriClinicContext("AriClinicContext"); // security control, it must be a user logged if (Session["User"] == null) { Response.Redirect("Default.aspx"); } else { } if (Request.QueryString["PatientId"] != null) { patient = CntAriCli.GetPatient(int.Parse(Request.QueryString["PatientId"]), ctx); pmr = patient.PreviousMedicalRecords.FirstOrDefault <PreviousMedicalRecord>(); // we load RadEditor with content lblTitle.Text = String.Format("{0} ({1})", Resources.GeneralResource.PreviousMedicalRecord, patient.FullName); LoadData(pmr); } else { // What will it happen here? } }