Beispiel #1
0
        public JsonResult Create(CarePlanViewModel model)
        {
            if (model.Completed == true)
            {
                Validate(model);
            }
            var carePlan = new API.Models.CarePlan
            {
                CarePlanId      = model.CarePlanId,
                Title           = model.Title,
                PatientName     = model.PatientName,
                UserName        = model.UserName,
                ActualStartDate = model.ActualStartDate,
                TargetDate      = model.TargetDate,
                Reason          = model.Reason,
                Action          = model.Action,
                Completed       = model.Completed,
                EndDate         = model.EndDate,
                OutCome         = model.OutCome
            };

            if (ModelState.IsValid)
            {
                Db.CarePlan.Add(carePlan);
                Db.SaveChanges();
            }
            return(Json(new { Success = true }));
        }
 public CarePlanDetails(API.Models.CarePlan carePlan)
 {
     CarePlanId      = carePlan.CarePlanId;
     Title           = carePlan.Title;
     PatientName     = carePlan.PatientName;
     UserName        = carePlan.UserName;
     ActualStartDate = carePlan.ActualStartDate;
     TargetDate      = carePlan.TargetDate;
     Reason          = carePlan.Reason;
     Action          = carePlan.Action;
     Completed       = carePlan.Completed;
     EndDate         = carePlan.EndDate;
     OutCome         = carePlan.OutCome;
 }