// GET: Manage/DirectoryMembers public ActionResult Index(int? page, long? filter, string search, string theme) { ViewBag.Error = null; long f = (filter == null) ? 0 : filter.Value; ContextManager cm = new ContextManager(); List<DirectoryMember> members = cm.DirectoryContext.DirectoryMembers.GetByFilter(f, search); ViewBag.Filter = f; if (theme != null) Session["Theme"] = theme; List<DirectoryMember> dd = new List<DirectoryMember>(); foreach (DirectoryMember d in members) { DirectoryMember m = new DirectoryMember(d); m.Id = d.Id; dd.Add(m); } Session[DirMemberSessionVar] = dd; page = (page == null) ? 1 : page; ViewBag.Page = page.Value; ViewBag.Action = "Index"; ViewBag.Header = "Directory Members"; ViewBag.Total = dd.Count(); PagedList<DirectoryMember> pg = new PagedList<DirectoryMember>(dd, page.Value, 12); return View(pg); }
public FileResult Download(long? filter, string search) { Lcps.UI.Context.ContextManager cm = new ContextManager(); List<DirectoryMember> members = (List<DirectoryMember>)Session[DirMemberSessionVar]; byte[] fileBytes = DirectoryMemberRepository.SerializeMembers(members); string fileName = "directory.xml"; return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName); }