Exemplo n.º 1
0
        public ActionResult LoginValidate(string username, string password)
        {
            GithubInfo githubInfo = new GithubInfo();

            githubInfo.httpMethod = httpVerb.GET;
            githubInfo.endPoint   = "http://api.power-supreme.com/api/Default/get";
            var returnValue = githubInfo.MakeRequest(username, password);

            Rootobject = JsonConvert.DeserializeObject <Rootobject>(returnValue);


            if (Rootobject.Username != null)
            {
                TempData["returnValues"] = returnValue;
                FormsAuthentication.SetAuthCookie(username, false);
                ViewBag.Value = 1;
                return(Redirect("Profile"));
            }
            else
            {
                ViewBag.Value = 0;
            }


            return(View(Rootobject));
        }
Exemplo n.º 2
0
 RelationCalification IEvaluatorService.Evaluate(GithubInfo githubInfo, EvaluationValue evaluationValues, List <Repository> repositories) =>
 new RelationCalification()
 {
     User  = githubInfo.User,
     Ejer1 = githubInfo.PullRequests.GetEvaluation(repositories.FirstOrDefault(x => x.Name.Contains("Ejer1"))),
     Ejer2 = githubInfo.PullRequests.GetEvaluation(repositories.FirstOrDefault(x => x.Name.Contains("Ejer2"))),
     Ejer3 = githubInfo.PullRequests.GetEvaluation(repositories.FirstOrDefault(x => x.Name.Contains("Ejer3"))),
     Ejer4 = githubInfo.PullRequests.GetEvaluation(repositories.FirstOrDefault(x => x.Name.Contains("Ejer4"))),
     Ejer5 = githubInfo.PullRequests.GetEvaluation(repositories.FirstOrDefault(x => x.Name.Contains("Ejer5")))
 };
Exemplo n.º 3
0
 RelationCalification IEvaluatorService.Evaluate(GithubInfo githubInfo, EvaluationValue evaluationValues) =>
 new RelationCalification()
 {
     User         = githubInfo.User,
     Calification = Math.Round(((double)githubInfo.PullRequests.Count / (double)evaluationValues.TotalExercises) * evaluationValues.MaxNoteForPRs, 2)
 };
Exemplo n.º 4
0
        public void Create(string firstName, string middleName, string lastName, string DOB, string email,
                           string phone, string gender, string occupation, string address, string city, string state, string country,
                           string password, string confirmPassword, string username)
        {
            GithubInfo githubInfo = new GithubInfo();

            githubInfo.httpMethod = httpVerb.POST;

            Email emaill = new Email();

            emaill.Email1 = email;

            Phone phoneTemp = new Phone();

            phoneTemp.Phone1 = phone;

            Occupation occupationTemp = new Occupation();

            occupationTemp.JobTitle = occupation;

            Address addressTemp = new Address();

            addressTemp.Address1 = address;
            addressTemp.City     = city;
            addressTemp.State    = state;
            addressTemp.Country  = country;


            if (password != confirmPassword)
            {
            }

            Rootobject rootobject = new Rootobject();

            rootobject.FirstName   = firstName;
            rootobject.MiddleName  = middleName;
            rootobject.LastName    = lastName;
            rootobject.Username    = username;
            rootobject.Password    = password;
            rootobject.CreatedDate = DateTime.Now;
            //rootobject.DOB = DOB.ToString();


            rootobject.Emails.Add(emaill);


            rootobject.Phones.Add(phoneTemp);

            ////rootobject.Gender = gender;


            rootobject.Occupations.Add(occupationTemp);


            rootobject.Addresses.Add(addressTemp);



            githubInfo.endPoint = "http://api.power-supreme.com/api/Default/PostUser";

            int returnValue = githubInfo.PostRequest(rootobject);
        }