public ActionResult History(WarrantyFilter filter) { var list = Warranty.Find(UserID, Employee.ID, Employee.BussinessID, filter, true); if (Request.IsAjaxRequest()) { return(Json(new { result = true, html = RenderPartialViewToString(Views.HistoryPartial, list) }, JsonRequestBehavior.DenyGet)); } return(View(Views.History, list)); }
public ActionResult Remove(int id) { Warranty.Remove(UserID, Employee.ID, id); var list = Warranty.Find(UserID, Employee.ID, Employee.BussinessID); if (Request.IsAjaxRequest()) { return(Json(new { result = true, html = RenderPartialViewToString(Views.HistoryPartial, list) }, JsonRequestBehavior.AllowGet)); } return(View(Views.History, list)); }
public ActionResult Download(WarrantyFilter filter) { var result = false; try { var data = Warranty.Find(UserID, Employee.ID, Employee.BussinessID, filter, true, null); var fileName = String.Format("Warranty_{0}.xls", DateTime.Now.ToString("ddMMyyyyHHmmss")); var file = String.Format("{0}/Content/Download/{1}", SiteConfiguration.ApplicationPath, fileName); Functions.CheckDirectory(String.Format("{0}/Content/Download/", SiteConfiguration.ApplicationPath)); SaveDownload(file, data); Session[SessionKey.Download] = fileName; result = true; } catch { } return(Json(new { result = result }, JsonRequestBehavior.DenyGet)); }