Esempio n. 1
0
 public void ExportToExcel(string firstName, string lastName)
 {
     UserListModel model = new UserListModel();
     model.SearchUsers(1, firstName, lastName, true);
     MemoryStream report = ExcelManagement.GenerateUserReport(model.SearchResult.Collection, Server.MapPath("~/Images/Logo-Voc-Iraq.png"));
     report.Position = 0;
     string currentDateTime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
     MicrosoftExcelStreamResult result = new MicrosoftExcelStreamResult(report, "UserReport" + currentDateTime + ".xlsx");
     Session.Add("UserReport", result);
 }
Esempio n. 2
0
 public ActionResult Index()
 {
     UserListModel model = new UserListModel();
     model.SearchUsers(1, string.Empty, string.Empty);
     return View(model);
 }
Esempio n. 3
0
 public PartialViewResult SearchUsers(int pageNumber, string firstName, string lastName)
 {
     UserListModel model = new UserListModel();
     model.SearchUsers(pageNumber,firstName,lastName);
     return PartialView("_UserList", model.SearchResult);
 }