public async Task <ActionResult> Delete(AjaxPageRequest pageRequest) { await this._repository.DeletePage(new Page { Id = pageRequest.Id, Name = pageRequest.Name, Section = pageRequest.Section }, this.Errors); return(Json(new { Status = this.Errors.Count == 0, this.Errors })); }
public async Task <ActionResult> Copy(AjaxPageRequest pageRequest) { bool status = false; Page copiedPage = null; Page origPage = this._repository.FindPage(pageRequest.Section, pageRequest.Name); if (origPage != null) { copiedPage = await this._repository.CopyPage(origPage, this.Errors); status = copiedPage.Id > 0; if (!status) { this.Errors.Add("Server error copying page."); } } else { this.Errors.Add("Could not find page."); } return(Json(new { Status = status, NewId = copiedPage.Id, Errors = this.Errors })); }