public virtual ActionResult Publish(string uuid) { PagePublishViewModel model = new PagePublishViewModel() { UUID = uuid, PublishDate = DateTime.Now, OfflineDate = DateTime.Now, PublishTime = "00:00", OfflineTime = "00:00" }; return(View(model)); }
public virtual ActionResult Publish(string fullName) { PagePublishViewModel model = new PagePublishViewModel() { FullName = fullName, PublishDate = DateTime.Now, OfflineDate = DateTime.Now, PublishTime = "00:00", OfflineTime = "00:00" }; return(View(model)); }
public virtual ActionResult Publish(PagePublishViewModel model, string @return) { var data = new JsonResultData(ModelState); data.RunWithTry((resultData) => { if (ModelState.IsValid) { var page = new Page(Site, model.UUID); var publishDate = DateTime.Parse(model.PublishDate.ToShortDateString() + " " + model.PublishTime); var offlineDate = DateTime.Parse(model.OfflineDate.ToShortDateString() + " " + model.OfflineTime); ServiceFactory.PageManager.Publish(page, model.PublishSchedule, model.PublishDraft, model.Period, publishDate, offlineDate, User.Identity.Name); } resultData.ReloadPage = true; resultData.RedirectUrl = @return; }); return(Json(data)); }
public virtual ActionResult Publish(PagePublishViewModel model) { JsonResultEntry entry = new JsonResultEntry(); try { if (ModelState.IsValid) { var page = new Page(Site, model.FullName); var publishDate = DateTime.Parse(model.PublishDate.ToShortDateString() + " " + model.PublishTime); var offlineDate = DateTime.Parse(model.OfflineDate.ToShortDateString() + " " + model.OfflineTime); ServiceFactory.PageManager.Publish(page, model.PublishSchedule, model.PublishDraft, model.Period, publishDate, offlineDate, User.Identity.Name); } entry.RedirectToOpener = true; entry.RedirectUrl = Url.Action("Index", this.ControllerContext.RequestContext.AllRouteValues()); } catch (Exception e) { entry.AddException(e); } return(Json(entry)); }