public ActionResult DeleteConfirmed(int id) { Reposit reposit = db.Reposits.Find(id); db.Reposits.Remove(reposit); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Description,hasDownloads,hasIsues,htmlURL,Language,CreatedAt,UpdatedAt")] Reposit reposit) { if (ModelState.IsValid) { db.Entry(reposit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(reposit)); }
// GET: Reposits/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Reposit reposit = db.Reposits.Find(id); if (reposit == null) { return(HttpNotFound()); } return(View(reposit)); }
private void InsereObj(Reposit r, DateTime dataAgora) { Reposit reposit = new Reposit(); reposit.CreatedAt = r.CreatedAt; reposit.Description = r.Description; reposit.hasDownloads = r.hasDownloads; reposit.hasIssues = r.hasIssues; reposit.htmlURL = r.htmlURL; reposit.Language = r.Language; reposit.UpdatedAt = r.UpdatedAt; reposit.InseridoNoBD = dataAgora; reposit.Stars = r.Stars; reposit.Name = r.Name; db.Reposits.Add(reposit); db.SaveChanges(); }
/* Função que deleta os repositorios inseridos no banco, busca os repositórios de 5 linguagens com mais estrelas * Utilizando Api Octokit para comunicação com Api do Github */ public ActionResult Atualiza() { DateTime dataAgora = DateTime.Now; repoCsharp = new Reposit(); repoJavaScript = new Reposit(); repoArduino = new Reposit(); repoGroovy = new Reposit(); repoRuby = new Reposit(); var ghCliente = new GitHubClient(new ProductHeaderValue("HudsonLimaTesting")); ghCliente.Credentials = new Credentials(AppSettings.Settings.userName, AppSettings.Settings.password); Task task1 = new Task(() => ListUserReposAsync(ghCliente)); task1.Start(); //Deleta registros da tabela reposit DeleteReposits(); while (repoCsharp.Name is null || repoJavaScript.Name is null || repoArduino.Name is null || repoGroovy.Name is null || repoRuby.Name is null) // { Thread.Sleep(1000); } InsereObj(repoCsharp, dataAgora); InsereObj(repoJavaScript, dataAgora); InsereObj(repoArduino, dataAgora); InsereObj(repoGroovy, dataAgora); InsereObj(repoRuby, dataAgora); TempData["Success"] = "Dados Atualizados com sucesso em " + dataAgora.ToString(); return(RedirectToAction("Index")); }
public BAL(Reposit _Iobj) { Iobj = _Iobj; }
public BAL(Reposit obj2) { obj1 = obj2; }
public BAl(Reposit Iobj1) { Iobj = Iobj1; }
public BAL(Reposit _Iobj) { }