Пример #1
0
 public async Task<IActionResult> OnPostDirector()
 {
     try
     {
         string cs = _config.GetConnectionString("Default");
         if (!fd.DirectorDupeCheck(cs, Request.Form["NewDirector.DirectorText"].ToString()))
         {
             fd.AddDirector(cs, Request.Form["NewDirector.DirectorText"].ToString());
             return RedirectToPage("./Index");
         }
         return RedirectToPage("./Index", new { @redirect = "directordupe", @value = Request.Form["NewDirector.DirectorText"].ToString() });
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }