Пример #1
0
        public ActionResult PostCatch(UserStatusViewModel collection)
        {
            if (ModelState.IsValid)
            {
                int    zoneID = collection.myCatch.zoneID;
                int    baitID = collection.myCatch.baitTypeID;
                int    fishID = collection.myCatch.fishTypeId;
                double?length = collection.myCatch.length;
                double?weight = collection.myCatch.weight;

                var   myCatchRepo = new StatusRepository();
                Catch newCatch    = myCatchRepo.CatchToDB(zoneID, baitID, fishID, length, weight);

                var catchId = newCatch.ID;
                PostStatus(collection, catchId);
            }
            else
            {
                return(View("error"));
            }

            return(RedirectToAction("Index", "Home"));
        }