} //End public List<SkhlistVM> getDatalist() public List <SkhlistitemVM> getDatalist(SkhstudentVM poViewModel = null) { List <SkhlistitemVM> vReturn; using (var db = new DBMAINContext()) { var oQRY = from tb in db.Skh_infos select new SkhlistitemVM { YEAR_ID = tb.YEAR_ID, SEMESTER_ID = tb.SEMESTER_ID, CLASSTYPE_ID = tb.CLASSTYPE_ID, THEME_ID = tb.THEME_ID, WEEKNUM = tb.WEEKNUM, DATEFROM = tb.DATEFROM, ID = tb.ID, ACTIVITY = tb.ACTIVITY, INDICATOR = tb.INDICATOR, MEDIA = tb.MEDIA }; if (poViewModel != null) { if (poViewModel.FILTER_YEAR_ID != null) { oQRY = oQRY.Where(fld => fld.YEAR_ID == poViewModel.FILTER_YEAR_ID); } //End if (poViewModel.YEAR_ID != null) if (poViewModel.FILTER_SEMESTER_ID != null) { oQRY = oQRY.Where(fld => fld.SEMESTER_ID == poViewModel.FILTER_SEMESTER_ID); } //End if (poViewModel.SEMESTER_ID != null) if (poViewModel.FILTER_CLASSTYPE_ID != null) { oQRY = oQRY.Where(fld => fld.CLASSTYPE_ID == poViewModel.FILTER_CLASSTYPE_ID); } //End if (poViewModel.CLASSTYPE_ID != null) if (poViewModel.FILTER_WEEKNUM != null) { oQRY = oQRY.Where(fld => fld.WEEKNUM == poViewModel.FILTER_WEEKNUM); } //End if (poViewModel.CLASSTYPE_ID != null) if (poViewModel.FILTER_DATEFROM != null) { oQRY = oQRY.Where(fld => fld.DATEFROM == poViewModel.FILTER_DATEFROM); } //End if (poViewModel.CLASSTYPE_ID != null) if (poViewModel.FILTER_THEME_ID != null) { oQRY = oQRY.Where(fld => fld.THEME_ID == poViewModel.FILTER_THEME_ID); } //End if (poViewModel.CLASSTYPE_ID != null) } //End if (poViewModel != null) vReturn = oQRY.ToList(); } //End using (var = new DbContext()) return(vReturn); } //End public List<SkhlistVM> getDatalist()
} //End public Skhstudent_Validation() //Constructor 2 public Skhstudent_Validation(SkhstudentVM poViewModel) { oViewModelfilter = poViewModel; } //End public Skhstudent_Validation()
} //End public SkhstudentDS public List <SkhstudentlistitemVM> getDatalist(SkhstudentVM poViewModel = null) { List <SkhstudentlistitemVM> vReturn; using (var db = new DBMAINContext()) { var oQRY = from tb in db.Skhstudent_infos select new SkhstudentlistitemVM { YEAR_ID = tb.YEAR_ID, SEMESTER_ID = tb.SEMESTER_ID, CLASSTYPE_ID = tb.CLASSTYPE_ID, THEME_ID = tb.THEME_ID, ID = tb.ID, DTA_STS = tb.DTA_STS, SKH_ID = tb.SKH_ID, MEDIA = tb.MEDIA, STUDENT_ID = tb.STUDENT_ID, NAME = tb.NAME, NIS = tb.NIS, RATEA_DESC = tb.RATEA_CODE, RATESE_DESC = tb.RATESE_CODE, RATEB_DESC = tb.RATEB_CODE, RATEK_DESC = tb.RATEK_CODE, RATEMH_DESC = tb.RATEMH_CODE, RATEMK_DESC = tb.RATEMK_CODE, RATES_DESC = tb.RATES_CODE }; if (poViewModel != null) { if (poViewModel.FILTER_YEAR_ID != null) { oQRY = oQRY.Where(fld => fld.YEAR_ID == poViewModel.FILTER_YEAR_ID); } //End if (poViewModel.YEAR_ID != null) if (poViewModel.FILTER_SEMESTER_ID != null) { oQRY = oQRY.Where(fld => fld.SEMESTER_ID == poViewModel.FILTER_SEMESTER_ID); } //End if (poViewModel.SEMESTER_ID != null) if (poViewModel.FILTER_CLASSTYPE_ID != null) { oQRY = oQRY.Where(fld => fld.CLASSTYPE_ID == poViewModel.FILTER_CLASSTYPE_ID); } //End if (poViewModel.CLASSTYPE_ID != null) if (poViewModel.FILTER_WEEKNUM != null) { oQRY = oQRY.Where(fld => fld.WEEKNUM == poViewModel.FILTER_WEEKNUM); } //End if (poViewModel.CLASSTYPE_ID != null) if (poViewModel.FILTER_DATEFROM != null) { oQRY = oQRY.Where(fld => fld.DATEFROM == poViewModel.FILTER_DATEFROM); } //End if (poViewModel.CLASSTYPE_ID != null) if (poViewModel.FILTER_THEME_ID != null) { oQRY = oQRY.Where(fld => fld.THEME_ID == poViewModel.FILTER_THEME_ID); } //End if (poViewModel.CLASSTYPE_ID != null) } //End if (poViewModel != null) vReturn = oQRY.ToList(); } //End using (var = new DbContext()) return(vReturn); } //End public List<SkhstudentlistVM> getDatalist()