Exemple #1
0
        public async Task <IActionResult> UploadExhibition([Bind("Exhibit, Member")] ProfileViewModel profileView)
        {
            var startDate = Request.Form["trip-start"];
            var stopDate  = Request.Form["trip-stop"];

            profileView.Exhibit.StartDate = DateTime.Parse(startDate);
            profileView.Exhibit.StopDate  = DateTime.Parse(stopDate);
            bool exist = ArtRepository.CheckIfIdExists(profileView.Member);

            try
            {
                if (ModelState.IsValid)
                {
                    if (exist == true)
                    {
                        await ArtRepository.UpdateExhibition(profileView.Member, profileView.Exhibit);
                    }
                }
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
            string Id = profileView.Member.MemberId;

            return(RedirectToAction($"Index", new { Id }));
        }