Exemple #1
0
        public ActionResult Steps(string id)
        {
            if (!Common.CheckUserSession())
            {
                return(this.RedirectToAction("Index", "Login"));
            }

            var project = new ProjectService(Common.GetConnectionString()).Load(x => x.GUID == id).FirstOrDefault();

            ViewBag.ProjectName = project.Title;
            ViewBag.ProjectId   = project.ProjectId;
            ViewBag.ProjectGUID = id;

            var projectStepService = new ProjectStepService(Common.GetConnectionString());

            ViewBag.StepIds = projectStepService.Load(x => x.ProjectId == project.ProjectId).Select(x => x.ProjectStepId).ToList();

            ProjectStep firstStep = null;

            if (Session["ActiveStep"] != null)
            {
                int projectStepId = Convert.ToInt16(Session["ActiveStep"]);
                firstStep = projectStepService.Load(x => x.ProjectId == project.ProjectId && x.ProjectStepId == projectStepId).FirstOrDefault();
            }

            if (firstStep == null)
            {
                firstStep = projectStepService.Load(x => x.ProjectId == project.ProjectId).FirstOrDefault();
            }

            return(View(firstStep));
        }
Exemple #2
0
        public ActionResult Steps(ProjectStepList stepList)
        {
            if (!Common.CheckUserSession())
            {
                return(this.RedirectToAction("Index", "Login"));
            }

            var success = new ProjectStepService(Common.GetConnectionString()).SaveSteps(stepList);

            if (success)
            {
                return(RedirectToAction("Index"));
            }
            return(View(new { id = stepList.projectId }));
        }
Exemple #3
0
        public ActionResult StepDetail(string id)
        {
            if (!Common.CheckUserSession())
            {
                return(this.RedirectToAction("Index", "Login"));
            }

            int projectId = Convert.ToInt16(id);
            var step      = new ProjectStepService(Common.GetConnectionString()).Load(x => x.ProjectStepId == projectId).FirstOrDefault();

            var projectName = new ProjectService(Common.GetConnectionString()).Load(x => x.ProjectId == step.ProjectId).Select(x => x.Title).SingleOrDefault();

            ViewBag.ProjectName = projectName;


            return(View("_StepDetail", step));
        }