Ejemplo n.º 1
0
        public async Task <ActionResult> Create(long taskId)
        {
            ViewBag.Repos = await GitHubInstance.GetStorageInstance().GetRepositoriesAsync();

            return(PartialView(new PullRequestCreateViewModel {
                TaskId = taskId
            }));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Chose(PullRequestChoseViewModel pullRequestModel)
        {
            if (ModelState.IsValid)
            {
                var id = await CreateHomeworkViaPullRequest(pullRequestModel.TaskId, pullRequestModel.RepositoryName, pullRequestModel.Number);

                return(id.HasValue ? RedirectToAction("Index", new { pullRequestDataId = id })
                                                                   : RedirectToAction("Index", "Home", new { errorMessage = "Ошибка при обновлении базы данных" }));
            }
            else
            {
                ViewBag.Repos = await GitHubInstance.GetStorageInstance().GetRepositoriesAsync();

                return(PartialView(pullRequestModel));
            }
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> FillPullRequest(string repository)
        {
            var pullRequests = await GitHubInstance.GetStorageInstance().GetPullRequests(repository);

            return(Json(pullRequests, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> FillBranch(string repository)
        {
            var branches = await GitHubInstance.GetStorageInstance().GetBranchesAsync(repository);

            return(Json(branches, JsonRequestBehavior.AllowGet));
        }