예제 #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);
 }
예제 #2
0
 public ActionResult Index()
 {
     UserListModel model = new UserListModel();
     model.SearchUsers(1, string.Empty, string.Empty);
     return View(model);
 }
예제 #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);
 }