Esempio n. 1
0
        public async Task <ActionResult> AddEdit(int?id)
        {
            var model = new TermModel();

            if (id.HasValue)
            {
                model = await ApiUtility.GetAsyncById <TermModel>(Services.Terms, id.Value);

                if (!model.IsNew)
                {
                    var project = await ApiUtility.GetAsyncById <ProjectModel>(Services.Projects, model.ProjectId);

                    if (project != null)
                    {
                        model.ProjectName = project.Name;
                        model.Projects.Add(project);
                    }
                }
            }
            else
            {
                var projects = await ApiUtility.GetAsync <ProjectModel>(Services.Projects);

                model.Projects.AddRange(projects);
            }

            return(View(model));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit()
        {
            var model = await ApiUtility.GetAsyncById <UserModel>(Services.Users, UserSession.UserId);

            var projects = await ApiUtility.GetAsync <ProjectModel>(Services.Projects);

            model.Projects.AddRange(projects);
            return(View(model));
        }
Esempio n. 3
0
        public async Task <ActionResult> AddEdit(int?id)
        {
            ProjectModel model = new ProjectModel();

            if (id.HasValue)
            {
                model = await ApiUtility.GetAsyncById <ProjectModel>(Services.Projects, id.Value);
            }

            return(View(model));
        }
Esempio n. 4
0
        public async Task <ActionResult> Index()
        {
            var model = await ApiUtility.GetAsyncById <UserModel>(Services.Users, UserSession.UserId);

            if (!model.IsNew)
            {
                var project = await ApiUtility.GetAsyncById <ProjectModel>(Services.Projects, model.ProjectId);

                if (project != null)
                {
                    model.ProjectName = project.Name;
                }
            }
            return(View(model));
        }
Esempio n. 5
0
        public async Task <ActionResult> Process(int id)
        {
            var model = await ApiUtility.GetAsyncById <BuildModel>(Services.Builds, id);

            return(View(model));
        }