Esempio n. 1
0
        public ActionResult Project()
        {
            UserBissnessLayer businessLayer = new UserBissnessLayer();
            List <Project>    projects      = businessLayer.GetAllProject();

            return(View(projects));
        }
Esempio n. 2
0
        public ActionResult Delete(String Id)
        {
            ViewBag.ProjectId = Id;
            UserBissnessLayer userBissnessLayer = new UserBissnessLayer();
            Task task = userBissnessLayer.getTaskFromId(Id);

            return(View(task));
        }
Esempio n. 3
0
        public ActionResult Task(String id)
        {
            UserBissnessLayer bissnessLayer = new UserBissnessLayer();
            List <Task>       TaskList      = bissnessLayer.GetTaskForProject(id);

            ViewBag.ProjectId = id;
            return(View(TaskList));
        }
Esempio n. 4
0
        public ActionResult SubmitRemoveUserFromProject(String User, String Project)
        {
            UserBissnessLayer bissnessLayer = new UserBissnessLayer();
            string            userId        = bissnessLayer.GetUserIdFromName(User);

            bissnessLayer.RemoveProjectFromUser(userId, Project);
            return(RedirectToAction("UsersInProject", new { id = Project }));
        }
Esempio n. 5
0
        public ActionResult SubmitRemoveProject(String id)
        {
            UserBissnessLayer bissnessLayer = new UserBissnessLayer();

            bissnessLayer.DeleteProject(id);
            bissnessLayer.DeletePermissions(id);
            bissnessLayer.DeleteTaskFromProject(id);
            return(RedirectToAction("Project", "Home"));
        }
Esempio n. 6
0
        public ActionResult UsersInProject(String id, String projectId)
        {
            UserBissnessLayer   bissnessLayer = new UserBissnessLayer();
            List <UserWithPerm> user          = bissnessLayer.UserInProject(id).ToList();

            ViewBag.Id        = id;
            ViewBag.ProjectId = projectId;
            return(View(user));
        }
Esempio n. 7
0
        public ActionResult AddNewProject(String id, FormCollection formCollection)
        {
            UserBissnessLayer bissnessLayer = new UserBissnessLayer();
            Project           project       = MapProject(formCollection);

            bissnessLayer.AddProject(project);
            bissnessLayer.AddPermissionToProject(id, project.Id, "1");
            return(RedirectToAction("Project", "Home"));
        }
Esempio n. 8
0
        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"));
        }
Esempio n. 9
0
        public ActionResult Create(String ProjectId, FormCollection Form)
        {
            System.Diagnostics.Debug.WriteLine(Convert.ToString(Form.AllKeys.ToList().ElementAt(2) + Form.AllKeys.ToList().ElementAt(3)));
            if (Form["Name"] == "")
            {
                return(RedirectToAction("Error", "Task", new { ProjectId = ProjectId }));
            }
            UserBissnessLayer userBissnessLayer = new UserBissnessLayer();
            Task task = mapTask(ProjectId, Form);

            userBissnessLayer.createTask(task);
            return(RedirectToAction("Task", "Project", new { id = ProjectId }));
        }
Esempio n. 10
0
        public ActionResult Edit(FormCollection form)
        {
            UserBissnessLayer userBissnessLayer = new UserBissnessLayer();
            Task task = new Task();

            userBissnessLayer.DeleteTask(form["Id"]);
            task.Id          = form["Id"];
            task.Hour        = form["Hour"] == "" ? 0 : Convert.ToInt32(form["Hour"].ToString());
            task.Name        = form["Name"];
            task.Description = form["Description"];
            task.Assigne     = form["Assigne"];
            task.ProjectId   = form["ProjectId"];
            userBissnessLayer.createTask(task);
            return(RedirectToAction("Task", "Project", new { id = task.ProjectId }));
        }