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);
        }
示例#2
0
 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)));
 }
示例#3
0
        public OpvragenDSLN()
        {
            InitializeComponent();

            using (Repos rep = new Repos())
            {
                Leerlingen         = rep.VindLeerlingen();
                GridLN.ItemsSource = Leerlingen;
            }
        }
示例#4
0
        public ActionResult pvModuleFilterList()
        {
            IEnumerable <ModuleFilterMenuList> lst;

            using (Repos repo = new Repos())
            {
                lst = repo.GetModuleFilterMenuList();
            }
            return(View(lst));
        }
示例#5
0
        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);
        }
示例#6
0
        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 }));
        }
示例#7
0
 public ActionResult AdminDeleteConfirmed(int id)
 {
     using (Repos repo = new Repos())
     {
         if (!repo.DeleteModule(id))
         {
             //ERROR DELETING MODULE
         }
     }
     return(RedirectToAction("Index", new { controller = "Profile" }));
 }
示例#8
0
        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.");
        }
示例#9
0
        public ActionResult DeleteConfirmed(int id)
        {
            Category category;

            using (Repos repo = new Repos())
            {
                category = repo.GetCategoryByID(id);
                repo.DeleteCategory(category.CategoryID);
            }
            return(RedirectToAction("Index"));
        }
示例#10
0
 public void AddRepos(List <CRepo> repos)
 {
     foreach (var repo in repos)
     {
         if (this.Repos.Exists(r => r.Name == repo.Name))
         {
             continue;
         }
         Repos.Add(repo);
     }
 }
示例#11
0
        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 }));
        }
示例#12
0
        public ActionResult Index()
        {
            //ConvertAllPicturesToStringData();
            IEnumerable <Picture> pictures;

            using (Repos repo = new Repos())
            {
                pictures = repo.GetAllPictures();
            }
            return(View(pictures));
        }
示例#13
0
        public ActionResult EditPictureView(int?id)
        {
            int     ID = id ?? 0;
            Picture picture;

            using (Repos repo = new Repos())
            {
                picture = repo.GetPictureByID(ID);
            }
            return(View(picture));
        }
示例#14
0
        public ActionResult Index()
        {
            IEnumerable <Category> cats;

            using (Repos repo = new Repos())
            {
                cats = repo.GetCategoryList();
            }

            return(View(cats));
        }
示例#15
0
        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));
        }
示例#16
0
        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.");
        }
示例#19
0
        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);
        }
示例#21
0
        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.");
        }
示例#22
0
        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;
 }
示例#26
0
 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;
 }
示例#30
0
        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();
        }
示例#31
0
 public ActionResult pvModuleFilterList()
 {
     IEnumerable<ModuleFilterMenuList> lst;
     using (Repos repo = new Repos())
     {
         lst = repo.GetModuleFilterMenuList();
     }
     return View(lst);
 }
示例#32
0
 public ResidentsController(Repos.IRoomManagementRepository repo)
 {
     this._RoomManagement = repo;
 }
示例#33
0
 public RoomsController(Repos.IRoomManagementRepository repo)
 {
     // Gets in via dependency injection
     _RoomRepo = repo;
 }
示例#34
0
 public HomeController(Repos.IResumeRepo resRepo)
 {
     _resRepo = resRepo;
 }