Exemplo n.º 1
0
        public ActionResult Update(VideosPO form)
        {
            //Declaring local variables
            ActionResult oResponse = RedirectToAction("Index", "Videos", new { form.VideoID, form.MunitionID });

            if (ModelState.IsValid)
            {
                try
                {
                    VideosDO dataObject = VideosMapper.MapPOtoDO(form);
                    dataAccess.UpdateVideo(dataObject);
                    TempData["Message"] = $"Successfully updated video";
                }
                catch (Exception ex)
                {
                    oResponse = View(form);
                }
            }
            else
            {
                oResponse = View(form);
            }
            return(oResponse);
        }