public async Task <IActionResult> Index(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);

            ViewBag.menuItems = await a.TopMenu(DefaultLanguageID);


            var ProcessTemplateStep = (from c in  _processTemplateStep.GetAllProcessTemplateSteps()
                                       join l in _processTemplateStepLanguage.GetAllProcessTemplateStepLanguages()
                                       on c.Id equals l.StepId
                                       where c.ProcessTemplateId == Id &&
                                       l.LanguageId == CurrentUser.DefaultLanguageId
                                       orderby l.Name
                                       select new SuObjectVM
            {
                Id = c.Id
                ,
                Name = l.Name
                ,
                ObjectId = c.ProcessTemplateId
            }).ToList();

            ViewBag.ObjectId = Id.ToString();


            return(View(ProcessTemplateStep));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Index(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);



            var Steps = (from sf in _processTemplateStepField.GetAllProcessTemplateStepFields()
                         join s in _processTemplateStepLanguage.GetAllProcessTemplateStepLanguages()
                         on sf.StepId equals s.StepId
                         join f in _processTemplateFieldLanguage.GetAllProcessTemplateFieldLanguages()
                         on sf.FieldId equals f.ProcessTemplateFieldId
                         where sf.FieldId == Id &&
                         s.LanguageId == CurrentUser.DefaultLanguageId &&
                         f.LanguageId == CurrentUser.DefaultLanguageId
                         orderby sf.Sequence
                         select new SuObjectVM
            {
                Id = sf.Id
                ,
                Name = s.Name,
                Description = f.Name

                ,
                ObjectId = sf.StepId
            }).ToList();

            ViewBag.ObjectId = Id.ToString();
            //PETER TODO add a classification label so you know to which classification the levels belong.
            return(View(Steps));
        }
        public async Task <IActionResult> Edit(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);

            ViewBag.menuItems = await a.TopMenu(DefaultLanguageID);

            var Flow = (from f in _processTemplateFlow.GetAllProcessTemplateFlows()
                        join l in _processTemplateFlowLanguage.GetAllProcessTemplateFlowLanguages()
                        on f.Id equals l.FlowId
                        where f.Id == Id && l.LanguageId == CurrentUser.DefaultLanguageId
                        orderby l.Name
                        select new SuObjectVMPageSection
            {
                Id = f.ProcessTemplateId
                ,
                ObjectId = f.Id
                ,
                LanguageId = l.LanguageId
                ,
                ObjectLanguageId = l.Id
                ,
                Name = l.Name
                ,
                Description = l.Description
                ,
                MouseOver = l.MouseOver
                ,
                NotNullId = f.ProcessTemplateFromStepId
                ,
                NotNullId2 = f.ProcessTemplateToStepId
            }).First();

            //Existing levels
            List <SelectListItem> StepList = (from s in _processTemplateStep.GetAllProcessTemplateSteps()
                                              join l in _processTemplateStepLanguage.GetAllProcessTemplateStepLanguages()
                                              on s.Id equals l.StepId
                                              where l.LanguageId == CurrentUser.DefaultLanguageId &&
                                              s.ProcessTemplateId == Flow.Id
                                              orderby l.Name
                                              select new SelectListItem
            {
                Value = s.Id.ToString()
                ,
                Text = l.Name
            }).ToList();



            StepList.Add(new SelectListItem {
                Text = "No selection", Value = "0"
            });


            var ClassificationAndStatus = new PageSectionAndStatusViewModel {
                SuObject = Flow, SomeKindINumSelectListItem = StepList
            };

            return(View(ClassificationAndStatus));
        }