public IActionResult StepOne(long entityId) { var entity = TestEntityRepository.GetById(entityId); var change = StateChangeFactory.CreateChange(typeof(OneToTwoChange)) as OneToTwoChange; change.SetEntity(entity); StateManagger.ManageTransition(change, TestEntityStates.SecondPlace); TestEntityRepository.SaveChanges(); return(Json(new { })); }
public IActionResult StepFour(long entityId, [FromBody] FourToFiveVM fourToFiveVM) { var entity = TestEntityRepository.GetById(entityId); var change = StateChangeFactory.CreateChange(typeof(FourToFiveChange)) as FourToFiveChange; change.SetEntity(entity); StateManagger.ManageTransition(change, TestEntityStates.FifthPlace, fourToFiveVM); TestEntityRepository.SaveChanges(); return(Json(new { })); }
public IActionResult StepThree(long entityId) { var entity = TestEntityRepository.GetById(entityId); var change = StateChangeFactory.CreateChange(typeof(ThreeToFourChange)) as ThreeToFourChange; change.SetEntity(entity); change.SetPreviousStep(typeof(TwoToThreeChange).FullName); StateManagger.ManageTransition <TestEntityModel, TestEntityStates, BasicTask, BasicTaskAcl>(change, TestEntityStates.FourthPlace, secureBasicTaskRepository); TestEntityRepository.SaveChanges(); return(Json(new { })); }
public IActionResult StepTwo(long entityId) { var entity = TestEntityRepository.GetById(entityId); var change = StateChangeFactory.CreateChange(typeof(TwoToThreeChange)) as TwoToThreeChange; change.SetEntity(entity); var tasks = StateManagger.ManageTransition <TestEntityModel, TestEntityStates, BasicTask, BasicTaskAcl>(change, TestEntityStates.ThirdPlace, secureBasicTaskRepository); //TestEntityRepository.SaveChanges(); return(Json(new { ids = tasks.Select(x => x.Id) })); }