Пример #1
0
        private async Task <Patient> GetFullAndPartialViewModel()
        {
            IPillRepository repo      = new PillRepository();
            var             medata    = repo.GetPatientMedications("12345678");
            var             reporting = repo.GetPatientPillReporting("12345678");

            return(new Patient()
            {
                MedicationInfos = medata, PillReportings = reporting
            });
        }
Пример #2
0
        public ActionResult Insert(PillReporting reporting)
        {
            IPillRepository repo = new PillRepository();

            try
            {
                if (reporting.PillTimeStamp.HasValue)
                {
                    reporting.PillTimeStamp = DateTime.Now.Date + reporting.PillTimeStamp.Value.TimeOfDay;
                }
                repo.InsertPill(reporting);
            }
            catch (Exception ex)
            {
                //Log errror
            }

            return(Json(new { status = "success" }));
        }