public void TestSaveUser() { Repos<User> repos = new Repos<User>(); repos.Save(new User(111, "Name")); int id = 111; string username = "******"; Assert.AreEqual(id, repos.Get(0).Id); Assert.AreEqual(username, repos.Get(0).Username); }
public string GenerateQuery(params string[] additionalFields) { return(string.Join(" ", Enumerable.Concat( Repos .Where(r => r.RepoInclusionLevel == RepoInclusionLevel.AllItems || r.RepoInclusionLevel == RepoInclusionLevel.ItemsAssignedToPersonSet) .Select(r => $"repo:{r.Owner}/{r.Name}"), additionalFields))); }
public OpvragenDSLN() { InitializeComponent(); using (Repos rep = new Repos()) { Leerlingen = rep.VindLeerlingen(); GridLN.ItemsSource = Leerlingen; } }
public ActionResult pvModuleFilterList() { IEnumerable <ModuleFilterMenuList> lst; using (Repos repo = new Repos()) { lst = repo.GetModuleFilterMenuList(); } return(View(lst)); }
private void PopulateCategoryDropDownList(object selectedCategory = null) { IEnumerable <Category> categoryQuery; using (Repos repo = new Repos()) { categoryQuery = repo.GetCategoryList(); } ViewBag.CategoryId = new SelectList(categoryQuery.Distinct().ToList(), "CategoryId", "CategoryName", selectedCategory); }
public ActionResult DeleteConfirmed(int id) { int answerID; using (Repos repo = new Repos()) { answerID = repo.GetPictureByID(id).AnswerID; repo.DeletePicture(id); } return(RedirectToAction("edit", new { controller = "Answers", id = answerID })); }
public ActionResult AdminDeleteConfirmed(int id) { using (Repos repo = new Repos()) { if (!repo.DeleteModule(id)) { //ERROR DELETING MODULE } } return(RedirectToAction("Index", new { controller = "Profile" })); }
private void VerwijderenLN_Click(object sender, RoutedEventArgs e) { using (Repos rep = new Repos()) { Leerling l = (Leerling)GridLN.SelectedItem; rep.VerwijderenLN(l); } MessageBox.Show("Leerling verwijderd."); }
public ActionResult DeleteConfirmed(int id) { Category category; using (Repos repo = new Repos()) { category = repo.GetCategoryByID(id); repo.DeleteCategory(category.CategoryID); } return(RedirectToAction("Index")); }
public void AddRepos(List <CRepo> repos) { foreach (var repo in repos) { if (this.Repos.Exists(r => r.Name == repo.Name)) { continue; } Repos.Add(repo); } }
public ActionResult DeleteConfirmed(int id) { Answer answer; using (Repos repo = new Repos()) { answer = repo.GetAnswerByID(id); repo.DeleteAnswer(answer.AnswerID); } return(RedirectToAction("Create", new { id = answer.ModuleID })); }
public ActionResult Index() { //ConvertAllPicturesToStringData(); IEnumerable <Picture> pictures; using (Repos repo = new Repos()) { pictures = repo.GetAllPictures(); } return(View(pictures)); }
public ActionResult EditPictureView(int?id) { int ID = id ?? 0; Picture picture; using (Repos repo = new Repos()) { picture = repo.GetPictureByID(ID); } return(View(picture)); }
public ActionResult Index() { IEnumerable <Category> cats; using (Repos repo = new Repos()) { cats = repo.GetCategoryList(); } return(View(cats)); }
public async Task <IActionResult> Create([Bind("Id,Name,Path")] Repos repos) { if (ModelState.IsValid) { _context.Add(repos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(repos)); }
public ActionResult Create(int?id) { ViewBag.AnswerID = id; Picture picture = new Picture(); int ID = id ?? 0; using (Repos repo = new Repos()) { picture.Answer = repo.GetAnswerByID(ID); } return(View(picture)); }
public void TestGetUserId() { Repos<User> repos = new Repos<User>(); int id = 111; repos.Save(new User(111)); User checkingUser = new User(id); User realUser = repos.Get(0); Assert.AreEqual(checkingUser.Id, realUser.Id); Assert.IsNull(realUser.Username); }
private void VolgendeK_Click_1(object sender, RoutedEventArgs e) { using (Repos rep = new Repos()) { rep.ToevoegenK(new Klas() { Naam = KlasNaam.Text }); } MessageBox.Show("Klas toegevoegd."); }
private void VolgendeK_Click_1(object sender, RoutedEventArgs e) { using (Repos rep = new Repos()) { // geen savechanges rep.ToevoegenTV(new Test() { TestNaam = Testnaam.Text }, (TempList1[Cbt2.SelectedIndex])); } MessageBox.Show("Test toegevoegd."); }
public void TestGetUserName() { Repos<User> repos = new Repos<User>(); string username = "******"; repos.Save(new User("Name")); User checkingUser = new User(username); User realUser = repos.Get(0); Assert.AreEqual(checkingUser.Id, realUser.Id); Assert.AreEqual(checkingUser.Username, realUser.Username); }
private void VolgendeK_Click_1(object sender, RoutedEventArgs e) { using (Repos rep = new Repos()) { rep.ToevoegenT(new Test() { TestNaam = Testnaam.Text }); } MessageBox.Show("Test toegevoegd."); }
public void TestRepertoireInexistant() { if (System.IO.Directory.Exists("REP1")) { System.IO.Directory.Delete("REP1", true); } Assert.IsFalse(System.IO.Directory.Exists("REP1")); Repos MyRepos = new Repos(); MyRepos.Organize("REP1"); // Vérification de la levée l'exception DirectoryNotFoundException }
private void Cb3_SelectionChanged(object sender, SelectionChangedEventArgs e) { using (Repos rep = new Repos()) { TempList3 = rep.Testjes(TempList[Cb3.SelectedIndex]); foreach (Test t in TempList3) { Testen.Add(t.TestNaam); } } Cb4.ItemsSource = Testen; }
private void Cb1_SelectionChanged(object sender, SelectionChangedEventArgs e) { using (Repos rep = new Repos()) { TempList1 = rep.Vakjes(TempList[Cb1.SelectedIndex]); foreach (Vak v in TempList1) { Vakken.Add(v.Naam); } } Cb2.ItemsSource = Vakken; }
private void Cb2_SelectionChanged(object sender, SelectionChangedEventArgs e) { using (Repos rep = new Repos()) { TempList2 = rep.Leerlings(TempList[Cb2.SelectedIndex]); foreach (Leerling l in TempList2) { Leerlingen.Add(l.Naam); } } Cb3.ItemsSource = Leerlingen; }
public MainWindow() { InitializeComponent(); sIndicator = new StatusIndicator(Repos.Status); sIndicator.Show(); Repos.LoadRepos(); while (!Repos.IsLoaded) { Thread.Sleep(200); } sIndicator.Close(); }
public async Task <object> ConsultarAsync(object filter, Config config, Paginador paginador, IParams extraParams) { using (UnitOfWork uow = UnitOfWork.Create()) { string periodo = (extraParams as IPeriodo).Periodo.ToString("yyyy-MM-dd"); await Repos.InsertAsync("spPXQIngresosRecalculoInsert", uow, new SqlParameter { ParameterName = "@periodo", Value = periodo }); uow.Commit(); } return(await ConsultaXFiltroAsync(filter, config, paginador, extraParams)); }
public void TestGetUserFull() { Repos<User> repos = new Repos<User>(); int id = 111; string username = "******"; repos.Save(new User(111, "Name")); User checkingUser = new User(id, username); User realUser = repos.Get(0); Assert.AreEqual(checkingUser.Id, realUser.Id); Assert.AreEqual(checkingUser.Username, realUser.Username); }
public IngavePunt() { InitializeComponent(); using (Repos rep = new Repos()) { TempList = rep.Klassen(); foreach (Klas k in TempList) { Klassen.Add(k.Naam); } } Cb1.ItemsSource = Klassen; }
public void DelTest() { Repos.LoadRepos(); while (!Repos.IsLoaded) { Thread.Sleep(200); } var k = Repos.KeyWords.Create("testWord"); k.personId = 100; Repos.KeyWords.Add(k); Repos.KeyWords.Save(); }
public ActionResult pvModuleFilterList() { IEnumerable<ModuleFilterMenuList> lst; using (Repos repo = new Repos()) { lst = repo.GetModuleFilterMenuList(); } return View(lst); }
public ResidentsController(Repos.IRoomManagementRepository repo) { this._RoomManagement = repo; }
public RoomsController(Repos.IRoomManagementRepository repo) { // Gets in via dependency injection _RoomRepo = repo; }
public HomeController(Repos.IResumeRepo resRepo) { _resRepo = resRepo; }