public ActionResult PageEdit(SourcePage model)
        {
            if (!ValidatePage(model))
            {
                ViewBag.Error = "Certains champs sont mal rempli ou incomplet, veuillez les remplirs correctements.";
                if (model.Id != null)
                {
                    ViewBag.HeadTitle = "Edition";
                }
                else
                {
                    ViewBag.HeadTitle = "Creation";
                }
                return(View("PageEdit", model));
            }
            FoireMusesConnection connection = GetConnection();

            try
            {
                if (model.Id == null)
                {
                    model = connection.CreateSourcePage(model, new Result <SourcePage>()).Wait();
                }
                else
                {
                    SourcePage current = connection.GetSourcePage(model.Id, new Result <SourcePage>()).Wait();
                    if (current == null)
                    {
                        return(RedirectToAction("Problem", "Error", null));
                    }
                    TryUpdateModel(current);
                    model = connection.EditSourcePage(current, new Result <SourcePage>()).Wait();
                }
            }
            catch (Exception e)
            {
                return(RedirectToAction("Problem", "Error", null));
            }
            if (model == null)
            {
                return(RedirectToAction("Problem", "Error", null));
            }
            return(View("PageDetails", model));
        }