public ActionResult Worksheets(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); ViewData.Model = w; return(View("Details", w)); }
public ActionResult DetailsLoading(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); ViewData.Model = w; return(View()); }
/// <summary> /// This returns the actual worksheet with cells /// Partial View for async wait message while loading /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Worksheet(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); int complete = w.Complete; int numTries = 0; while (complete == 0 && numTries < 20) { System.Threading.Thread.Sleep(500); w.GetWorksheet(id); complete = w.Complete; numTries++; } w.GetWorksheetCells(id);//Cells exist ViewData.Model = w; return(PartialView(w)); }
public ActionResult DetailsDemo(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); if (w.Owner.ToUpper() != "DEMO") { return(RedirectToAction("Unauthorized")); } ViewData.Model = w; return(View()); }
public ActionResult Delete(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); if (w.Owner.ToUpper() != User.Identity.Name.ToUpper()) { return(RedirectToAction("Unauthorized")); } w.DeleteWorksheet(id); return(Redirect(Request.UrlReferrer.ToString()));//This should be User Page }
public ActionResult EditNew(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); if (w.Owner.ToUpper() != User.Identity.Name.ToUpper()) { return(RedirectToAction("Unauthorized")); } ViewData.Model = w; return(View()); }
public ActionResult Details(int id) { Models.Worksheet w = new Models.Worksheet(); w.GetWorksheet(id); if (!w.Private || User.Identity.Name.ToUpper() == w.Owner.ToUpper()) //public or match { ViewData.Model = w; return(View()); } else if (w.Private && !User.Identity.IsAuthenticated) //private, not logged in { return(RedirectToAction("LogOn", "Account", new { returnUrl = "/Worksheet/" + id })); } else //Logged on, wrong user { return(View("UnauthorizedDetail")); } }