Пример #1
0
        public JsonResult GetHomework()
        {
            HomeworkController  obj         = new HomeworkController();
            List <tbl_homework> objHomework = obj.GetHomeworks();
            var jsonResult = Json(objHomework, JsonRequestBehavior.AllowGet);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }
Пример #2
0
        public FileResult DownloadHomework(int id)
        {
            HomeworkController  obj      = new HomeworkController();
            List <tbl_homework> ObjFiles = obj.GetHomeworks();

            var FileById = (from FC in ObjFiles
                            where FC.id.Equals(id)
                            select new { FC.name, FC.contenttype, FC.data }).FirstOrDefault();

            return(File(FileById.data, FileById.contenttype, FileById.name));
        }