Exemple #1
0
        public HttpResponse Create(string id)
        {
            var repository = commitsService.CreateCommit(id);

            if (repository == null)
            {
                return(BadRequest());
            }

            return(View(repository));
        }
Exemple #2
0
        public HttpResponse Create(string id, string description)
        {
            if (!this.IsUserSignedIn())
            {
                return(this.Redirect("/Users/Login"));
            }

            if (string.IsNullOrEmpty(description) || description.Length < 5)
            {
                return(this.Error("Description should be more than 5 symbols"));
            }

            var userId = this.GetUserId();

            commitService.CreateCommit(id, userId, description);
            return(this.Redirect("/Repositories/All"));
        }
Exemple #3
0
        public HttpResponse Create(string id, string description)
        {
            if (!this.IsUserSignedIn())
            {
                return(this.Redirect("/"));
            }

            if (description.Length < 5 || string.IsNullOrWhiteSpace(description))
            {
                return(this.Error("Description can't be less than 5 symbols!"));
            }
            var userId = this.GetUserId();

            ;
            commitsService.CreateCommit(id, userId, description);


            return(this.Redirect("/Repositories/All"));
        }