Exemplo n.º 1
0
        public ActionResult AddMedicinesAndTests(AddMedicinesAndTestViewModel model, string returnUrl)
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            Diagnosis diagnosis = new Diagnosis();

            diagnosis.AppointmentId = model.AppointmentId;
            diagnosis.Remark        = model.Remark;
            List <MedicineRecord> medicinesList = model.ToMedicineList();
            var testsList = model.ToTestsList();
            AddDiagnosisAndRecord addDiagnoseAndRecord = new AddDiagnosisAndRecord();

            addDiagnoseAndRecord.CreateDiagnosisAndRecord(diagnosis, medicinesList, testsList);

            return(Json("Appointments"));
        }
Exemplo n.º 2
0
        public ActionResult AddRemark(RemarkViewModel model)
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            Diagnosis diagnosis = new Diagnosis();

            AutoMapper.Mapper.Map(model, diagnosis);
            AddDiagnosisAndRecord addDiagnoseAndRecord = new AddDiagnosisAndRecord();

            try
            {
                addDiagnoseAndRecord.CreateDiagnosisAndRecord(diagnosis);
                return(RedirectToAction("AppointmentList"));
            }
            catch (Exception)
            {
                return(RedirectToAction("AppointmentList"));
            }
        }