public int Delete(string[] Ids) { //防止注入式漏洞 string ids = string.Join(",", Ids); DAL.Course dal = new DAL.Course(); return(dal.Delete(ids)); }
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); } }
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; }
public List <Model.Course> GetCourse() { DAL.Course dal = new DAL.Course(); return(dal.GetCourse()); }
public int AddCourseSave(string AddCourseName) { DAL.Course dal = new DAL.Course(); return(dal.AddCourseSave(AddCourseName)); }
public int EditCourseSave(int CourseId, string EditCourseName) { DAL.Course dal = new DAL.Course(); return(dal.EditCourseSave(CourseId, EditCourseName)); }
public int GetCount() { DAL.Course dal = new DAL.Course(); return(dal.GetCount());; }
public List <Model.Course> GetList(int pageSize, int pageNumber) { DAL.Course dal = new DAL.Course(); return(dal.GetList(pageSize, pageNumber)); }