public ActionResult EditBatch(BatchView model)
 {
     if (ModelState.IsValid)
     {
         ViewData["BatchType"] = _db.PopulateDropDownList();
         _db.Update(model,User.Identity.GetUserId());
         return RedirectToAction("GetAllBatches");
     }
     return View(model);
 }
 public ActionResult Create(BatchView batchView)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             ViewData["BatchType"] = _db.PopulateDropDownList();
             return View(batchView);
         }
         _db.Insert(batchView,User.Identity.GetUserId());
         return RedirectToAction("InsertAnimals", "Animal");
     }
     catch
     {
         ViewData["BatchType"] = _db.PopulateDropDownList(batchView.BatchTypeid);
         return View(batchView);
     }
 }