public ActionResult Project() { UserBissnessLayer businessLayer = new UserBissnessLayer(); List <Project> projects = businessLayer.GetAllProject(); return(View(projects)); }
public ActionResult Xml(String id) { UserBissnessLayer layer = new UserBissnessLayer(); Project project = layer.GetAllProject().Find(x => x.Id == id); List <Task> tasks = layer.GetTaskForProject(id); List <UserWithPerm> users = layer.UserInProject(id).ToList(); Response.AppendHeader("Content-Disposition", "attachment;filename=project.xml"); byte[] file = Encoding.ASCII.GetBytes(layer.createXML(project, tasks, users)); return(File(file, "text/xml", "project.xml")); }