/// <summary> /// Saves the platelets count. /// </summary> /// <param name="platList">The plat list.</param> public void savePlateletsCount(List <PlateletsCount> platList) { PlateletsCount platelets = db.MCDTs.Find(platList.Single().MCDT_ID) as PlateletsCount; platelets.LabExam_data_in = DateTime.Now; foreach (PlateletsCount p in platList) { platelets.Count = p.Count; platelets.LabExam_date_out = DateTime.Now; } InsertStaffId(currentUser.AccessDatabase(HttpContext.Current.User.Identity.Name), platelets); db.SaveChanges(); }
/// <summary> /// Creates an instance of a specific mcdt ,associates it with the current date and /// save to database by calling the auxilliary function below /// </summary> /// <param name="listPrsecribedMCDT">list of prescribed mcdts</param> public void SavePrescribedMCDT(List <string> listPrsecribedMCDT) { MCDT newUnregularMcdt; LabExams labExam; foreach (string mcdt in listPrsecribedMCDT) { if (mcdt.Equals("Physical")) { newUnregularMcdt = new PhysicalExam { MCDT_date = DateTime.Now }; SavePrescribedMcdtAUX(newUnregularMcdt); } else if (mcdt.Equals("Pyschiatric")) { newUnregularMcdt = new PsychiatricExam { MCDT_date = DateTime.Now }; SavePrescribedMcdtAUX(newUnregularMcdt); } else if (mcdt.Equals("KFT")) { labExam = new KFT { MCDT_date = DateTime.Now, MCDT_type = MCDTType.KFT }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("LFT")) { labExam = new LFT { MCDT_date = DateTime.Now, MCDT_type = MCDTType.LFT }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("LymphocytesSubsets")) { labExam = new LymphocytesSubsets { MCDT_date = DateTime.Now, MCDT_type = MCDTType.LymphocytesSubsets }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("RBCS")) { labExam = new RBCS { MCDT_date = DateTime.Now, MCDT_type = MCDTType.RBCS }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("PlateletsCount")) { labExam = new PlateletsCount { MCDT_date = DateTime.Now, MCDT_type = MCDTType.PlateletsCount }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("RBCIndices")) { labExam = new RBCIndices { MCDT_date = DateTime.Now, MCDT_type = MCDTType.RBCIndices }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("WBCS")) { labExam = new WBCS { MCDT_date = DateTime.Now, MCDT_type = MCDTType.WBCS }; SavePrescribedMcdtAUX(labExam); } else if (mcdt.Equals("ViralLoad")) { labExam = new ViralLoad { MCDT_date = DateTime.Now, MCDT_type = MCDTType.ViralLoad }; SavePrescribedMcdtAUX(labExam); } } //LabExams lab= db.LabExams.Add(e); //CreateMCDT(lab); }