public ActionResult Update(string content) { try { UserModel m = CurrentUserModel; m.CheckIsAdmin(); Application app = CurrentServiceModel.GetApplication(m.CurrentApplication.Id); app.Description = content; CurrentServiceModel.UpdateApplication(app); Cydin.Views.ViewHelper.ClearCache(); return(RedirectToAction("Index")); } catch (Exception ex) { return(Content(ex.ToString())); } }
public ActionResult UpdateApplication(Application app) { UserModel m = CurrentUserModel; m.CheckIsSiteAdmin(); if (app.Id != -1) { Application capp = CurrentServiceModel.GetApplication(app.Id); capp.Name = app.Name; capp.Subdomain = app.Subdomain; capp.Platforms = app.Platforms; CurrentServiceModel.UpdateApplication(capp); } else { app.Description = "<p>This is the home page of the add-in repository for " + app.Name + "</p><p>Click on the 'Edit Page' link to change the content of this welcome page</p>"; CurrentServiceModel.CreateApplication(app); } return(RedirectToAction("Index")); }