Exemplo n.º 1
0
        public virtual ActionResult updateNextStep()
        {
            //Not implemented
            //stepsRepository.up.upups.updateSteps();
            //stepsRepository.Save();
            ////get current status

            var result = new jr { success = "true" };
            return Json(result);
        }
Exemplo n.º 2
0
        public Ijr Create(
            ImmutableList <IjrCrossJoinElement> value)
        {
            Ijr crossJoin = null;

            try
            {
                crossJoin = new jr(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(crossJoin);
        }
Exemplo n.º 3
0
 public virtual ActionResult UpdatePriority(int[] priority)
 {
     Scenario s;
     var result = new jr { success = "true" };
     if (ModelState.IsValid)
     {
         try
         {
             for (int i = 0; i < priority.Length; i++)
             {
                  s = scenarioRepository.GetByID(priority[i]);
                  s.Priority = i + 1;
                  scenarioRepository.Save();
             }
             //update complete status on steps
             var stepsRepository = new StepsRepository();
             stepsRepository.UpdateSteps();
             stepsRepository.Save();
         }
         catch
         {//For Error w/o defined message
             ModelState.AddModelError("ID", "Not Added Sucessfully");
              result = new jr { success = "false" };
              return Json(result);
         }//end catch
     }//else not valid
     else ModelState.AddModelError("ID", "Record not Added Sucessfully");
     ModelState.Clear(); // this is the key, you could also just clear ModelState for the field
     var vmodel = ScenarioViewModel.CreateIndex(scenarioRepository);
     return View(vmodel);
 }
Exemplo n.º 4
0
        public virtual ActionResult UpdatePriority(int[] priority)
        {
            ModelState.Clear();

            //priority keeps coming in null, even though posted
            if (priority == null)
            {
                HttpContext ctx = System.Web.HttpContext.Current;
                string[] valArr = ctx.Request.Params.GetValues(0);
                Array.Resize(ref priority, valArr.Length);

                for (int i = 0; i < valArr.Length; i++)
                {
                    priority[i] = Convert.ToInt16(valArr[i]);
                }//end for
            }//end if

            Scenario s;
            s = scenarioRepository.GetByID(priority[1]);
            var result = new jr { success = "true" };
            if (ModelState.IsValid)
            {
                try
                {
                    for (int i = 0; i < priority.Length; i++)
                    {
                         s = scenarioRepository.GetByID(priority[i]);
                         s.Priority = i + 1;
                         scenarioRepository.Save();
                    }
                    //update complete status on steps
                    scenarioRepository.ClearVotesBottomTwoThirds(s.ProjectID);
                    var stepsRepository = new StepsRepository();
                    stepsRepository.UpdateSteps(s.ProjectID);
                    stepsRepository.Save();
                }
                catch
                {//For Error w/o defined message
                    ModelState.AddModelError("ID", "Not Added Sucessfully");
                    //var vmodelError = ScenarioViewModel.CreateIndex(scenarioRepository, s.ProjectID);
                    //return View(vmodelError);
                     result = new jr { success = "false" };
                     return Json(result);
                }//end catch
            }//else not valid
            else ModelState.AddModelError("ID", "Record not Added Sucessfully");
            ModelState.Clear(); // this is the key, you could also just clear ModelState for the field

            var vmodel = ScenarioViewModel.CreateIndex(scenarioRepository, s.Project.ID);
            var scenarios = vmodel.Scenarios;
            return PartialView("ScenarioList", scenarios);

            //return View(vmodel);
            //return Action (Index);
        }