Beispiel #1
0
        public string RemoveDispatch(string id)
        {
            GenericView view = new GenericView();
            DispatchRepository dispatchRepo = new DispatchRepository();

            Validator validator = new Validator();
            if (!validator.MatchRule(id, "required", "id"))
            {
                return view.Error(validator.GetDetail());
            }

            string[] idArr = id.Split(',');
            bool Ret = dispatchRepo.RemoveCourseList(Auth.User().Id, Array.ConvertAll(idArr, int.Parse));

            return Ret ? view.Success() : view.Error();
        }
        public void RemoveCourseTest()
        {
            DbContextHelper.Init(typeof(CourseDbContext), GlobalSettings.DATABASE.ConnectionString, 8);

            DispatchRepository dp = new DispatchRepository();

            Assert.AreEqual(true, dp.RemoveCourseList(1, new int[] { 1 }));
        }