コード例 #1
0
 public ActionResult AddFeedPercentage(FeedingPercentageView model)
 {
     if (ModelState.IsValid)
     {
         _feedingPercentage.AddPercentage(model);
         return RedirectToAction("CreateFeedRatio");
     }
     return View(model);
 }
コード例 #2
0
 public void AddPercentage(FeedingPercentageView model)
 {
     using (var feedPerc = new FeedingPercentageRepository())
     {
         var feed = new FeedingPercentage
         {
             FeedingPercentageId = model.FeedingPercentageId,
             Percentage = model.Percentage + " %"
         };
         feedPerc.Insert(feed);
     }
 }