Пример #1
0
        public int Delete(string[] Ids)
        {
            //防止注入式漏洞
            string ids = string.Join(",", Ids);

            DAL.Course dal = new DAL.Course();
            return(dal.Delete(ids));
        }
Пример #2
0
        public static string CreateCourse(string name, string description, string author)
        {
            try
            {
                var dalCourse = new DAL.Course();
                dalCourse.Author      = author;
                dalCourse.Description = description;
                dalCourse.Lessons     = new List <Model.Lesson>();
                dalCourse.Name        = name;
                dalCourse.Statistics  = new Model.CourseStatistics();
                dalCourse.Subscribed  = new List <string>();

                return(DAL.Course.CreateCourse(dalCourse));
            }
            catch (Exception)
            {
                return(null);
            }
        }
Пример #3
0
        public void CreateCourse()
        {
            var dalCourse = new DAL.Course();

            dalCourse.Author      = "*****@*****.**";
            dalCourse.Description = "Lorem ipsum dolor sit amet";
            dalCourse.Lessons     = new List <Model.Lesson>();
            dalCourse.Name        = "Hello world!";
            dalCourse.Statistics  = new Model.CourseStatistics();
            dalCourse.Subscribed  = new List <string>();

            IDataProvider data = new MongoDataProvider();

            dalCourse = data.Create(dalCourse);
            dalCourse.Identification = dalCourse._id.ToString();

            var modelCourse = new Model.Course();

            modelCourse = dalCourse;
        }
Пример #4
0
 public List <Model.Course> GetCourse()
 {
     DAL.Course dal = new DAL.Course();
     return(dal.GetCourse());
 }
Пример #5
0
 public int AddCourseSave(string AddCourseName)
 {
     DAL.Course dal = new DAL.Course();
     return(dal.AddCourseSave(AddCourseName));
 }
Пример #6
0
 public int EditCourseSave(int CourseId, string EditCourseName)
 {
     DAL.Course dal = new DAL.Course();
     return(dal.EditCourseSave(CourseId, EditCourseName));
 }
Пример #7
0
 public int GetCount()
 {
     DAL.Course dal = new DAL.Course();
     return(dal.GetCount());;
 }
Пример #8
0
 public List <Model.Course> GetList(int pageSize, int pageNumber)
 {
     DAL.Course dal = new DAL.Course();
     return(dal.GetList(pageSize, pageNumber));
 }