Beispiel #1
0
        public ActionResult Create([Bind(Include = "ReleaseId,ProjectId,ReleaseDate,ReleaseName,ReleaseDescription,ServerName")] Release release)
        {
            if (ModelState.IsValid)
            {
                db.Release.Add(release);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProjectId = new SelectList(db.Project, "ProjectId", "ProjectName", release.ProjectId);
            return(View(release));
        }
        public ActionResult Create([Bind(Include = "ProjectName,ProjectDescription,ProjectDeadline")] ProjectCreateModel project)
        {
            if (ModelState.IsValid)
            {
                var newProject = new Project
                {
                    ProjectName        = project.ProjectName,
                    ProjectDescription = project.ProjectDescription,
                    ProjectDeadline    = project.ProjectDeadline
                };

                db.Project.Add(newProject);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            return(View(project));
        }
        public ActionResult Create([Bind(Include = "TaskId,SprintId,TaskName,TaskDescription,IsDone")] TaskCreateModel task)
        {
            if (ModelState.IsValid)
            {
                var newTask = new Task
                {
                    TaskName        = task.TaskName,
                    SprintId        = task.SprintId,
                    TaskDescription = task.TaskDescription,
                    IsDone          = false
                };

                db.Task.Add(newTask);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.SprintId = new SelectList(db.Sprint, "SprintId", "SprintEnd", task.SprintId);
            return(View(task));
        }
        public ActionResult Create([Bind(Include = "SprintId,ProjectId,SprintStart,SpintEnd")] SprintCreateModel sprint)
        {
            if (ModelState.IsValid)
            {
                var newSprint = new Sprint
                {
                    ProjectId   = sprint.ProjectId,
                    SprintStart = sprint.SprintStart,
                    SpintEnd    = sprint.SpintEnd
                };


                db.Sprint.Add(newSprint);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            //TODO: stronly typed view
            ViewBag.ProjectId = new SelectList(db.Project, "ProjectId", "ProjectName", sprint.ProjectId);
            return(View(sprint));
        }