示例#1
0
        public ResultPakage <bool> CreateCourse(Dal.Course course)
        {
            Db db = new Db();
            //var imageName = Util.SaveImage("UploadCourseImagePath", HttpContext.Current);
            //if (imageName != null && imageName.Length > 0) {
            //    course.PicUrl = imageName;
            //}
            var user = SSOManager.GetUserInfoFromHeader();

            course.CreatePerson = user.Id;
            course.CreateTime   = DateTime.Now;
            db.Courses.Add(course);
            db.SaveChanges();
            return(Util.ReturnOkResult(true));
        }