public ActionResult Edit(InsulinDosageModel dosageModel)
 {
     if (!ModelState.IsValid)
     {
         return View(dosageModel);
     }
     RavenSession.Store(dosageModel);
     return RedirectToAction("Details", dosageModel);
 }
示例#2
0
 public InsulinDosageModel this[InsulinEnum insulinType]
 {
     get
     {
         return(GetInsulinModel(insulinType));
     }
     set
     {
         InsulinDosageModel currentModel = GetInsulinModel(insulinType);
         if (null == currentModel)
         {
             currentModel = value;
         }
     }
 }
示例#3
0
        private InsulinDosageModel GetInsulinModel(InsulinEnum insulinType)
        {
            if (null == InsulinDosages)
            {
                return(null);
            }
            InsulinDosageModel rtn = null;

            foreach (InsulinDosageModel model in InsulinDosages)
            {
                if (model.InsulinType.Equals(insulinType))
                {
                    rtn = model;
                    break;
                }
            }
            return(rtn);
        }
 private ViewResult Details(InsulinDosageModel entryModel)
 {
     return View(entryModel);
 }