示例#1
0
        public ActionResult AssignMeasurementTool(ViewObjects.Modals.AssignMeasurementTool model)
        {
            try
            {
                if (model.MeasurementToolId == Guid.Empty)
                {
                    throw new BusinessRuleException("Measurement Tool cannot be empty");
                }

                if (model.FrequencyId == Guid.Empty)
                {
                    throw new BusinessRuleException("Frequency cannot be empty");
                }

                _patientService.AssignMeasurmentTool(model.PatientId, model.MeasurementToolId, model.FrequencyId);
            }
            catch (BusinessRuleException ex)
            {
                TempData["Message_AssignMeasurementTool"] = ex.Message;
            }
            return(RedirectToAction("Edit", "Patient", new { patientId = model.PatientId }));
        }