public ActionResult PaperLibrary(CLoadPaper cl) { ViewBag.Grade = string.IsNullOrEmpty(cl.Grade) ? "全部" : cl.Grade; ViewBag.Subject = string.IsNullOrEmpty(cl.Subject) ? "全部" : cl.Subject; ViewBag.Year = string.IsNullOrEmpty(cl.Year) ? "全部" : cl.Year; ViewBag.Kind = string.IsNullOrEmpty(cl.Kind) ? "全部" : cl.Kind; ViewBag.Years = DateTime.Now.Year; return(View()); }
public ActionResult LoadPaper(CLoadPaper cl) { EODB eodb = new EODB(); List <PaperInfo> paperinfo = new List <PaperInfo>(); paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == ((cl.Grade == "全部") ? i.Paper_Grade : cl.Grade)) && (i.Paper_Subject == ((cl.Subject == "全部") ? i.Paper_Subject : cl.Subject)) && (i.Paper_Year == ((cl.Year == "全部") ? i.Paper_Year : cl.Year)) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) select i).ToList <PaperInfo>(); return(Json(paperinfo)); }
public ActionResult LoadPaper(CLoadPaper cl) { EODB eodb = new EODB(); List <PaperInfo> paperinfo = new List <PaperInfo>(); if (cl.Title == "小学试卷") { if (cl.Grade == "全部") { paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == "一年级" || i.Paper_Grade == "二年级" || i.Paper_Grade == "三年级" || i.Paper_Grade == "四年级" || i.Paper_Grade == "五年级" || i.Paper_Grade == "六年级") && (i.Paper_Year == ((cl.Year == "全部" ? i.Paper_Year : (cl.Year)))) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) && (i.Paper_Province == ((cl.Province == "全部" ? i.Paper_Province : cl.Province))) && (i.Paper_Subject == cl.Subject) select i).ToList <PaperInfo>(); } else { paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == cl.Grade) && (i.Paper_Year == ((cl.Year == "全部" ? i.Paper_Year : (cl.Year)))) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) && (i.Paper_Province == ((cl.Province == "全部" ? i.Paper_Province : cl.Province))) && (i.Paper_Subject == cl.Subject) select i).ToList <PaperInfo>(); } } else if (cl.Title == "初中试卷") { if (cl.Grade == "全部") { paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == "七年级" || i.Paper_Grade == "八年级" || i.Paper_Grade == "九年级") && (i.Paper_Year == ((cl.Year == "全部" ? i.Paper_Year : (cl.Year)))) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) && (i.Paper_Province == ((cl.Province == "全部" ? i.Paper_Province : cl.Province))) && (i.Paper_Subject == cl.Subject) select i).ToList <PaperInfo>(); } else { paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == cl.Grade) && (i.Paper_Year == ((cl.Year == "全部" ? i.Paper_Year : (cl.Year)))) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) && (i.Paper_Province == ((cl.Province == "全部" ? i.Paper_Province : cl.Province))) && (i.Paper_Subject == cl.Subject) select i).ToList <PaperInfo>(); } } else { if (cl.Grade == "全部") { paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == "十年级" || i.Paper_Grade == "十一年级" || i.Paper_Grade == "十二年级") && (i.Paper_Year == ((cl.Year == "全部" ? i.Paper_Year : (cl.Year)))) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) && (i.Paper_Province == ((cl.Province == "全部" ? i.Paper_Province : cl.Province))) && (i.Paper_Subject == cl.Subject) select i).ToList <PaperInfo>(); } else { paperinfo = (from i in eodb.paperinfo where (i.Paper_Grade == cl.Grade) && (i.Paper_Year == ((cl.Year == "全部" ? i.Paper_Year : (cl.Year)))) && (i.Paper_Kind == ((cl.Kind == "全部") ? i.Paper_Kind : cl.Kind)) && (i.Paper_Province == ((cl.Province == "全部" ? i.Paper_Province : cl.Province))) && (i.Paper_Subject == cl.Subject) select i).ToList <PaperInfo>(); } } return(Json(paperinfo)); }