public ActionResult Index() { using (var db = new amozeshEntities()) { var fostad = (from x in db.fostads join y in db.fostad_head on x.code_ostad equals y.ocode where x.vaz_fali == 1 select new { x.code_ostad, x.idd_meli, }).ToList(); var fOstadList_amozeshDb = (from x in fostad select new IndexVM { CodeOstad = x.code_ostad.ToString(), CodeMeli = x.idd_meli, DbName = "AmodeshDb" }).ToList(); var Os_tbList_thesesDb = db.vOs_tb_TheseDb.Select(s => new IndexVM { CodeOstad = s.id_os.ToString(), CodeMeli = s.code_meli, DbName = "ThesesDb" }).ToList(); objCheckCodeMeli = new CheckCodeMeliClass(); List <IndexVM> finalList = objCheckCodeMeli.GetInvalidList(fOstadList_amozeshDb, Os_tbList_thesesDb); ViewBag.TotalCount = finalList.Count; return(View(finalList)); } }
//################################################ //################################################ public ActionResult SqlView() { using (var ctx = new amozeshEntities()) { var dd = ctx.fn_GetInvalidNationalCodesList(); newModel = new List <SqlViewVM>(); newModel = dd.Select(x => new SqlViewVM { CodeOstad = x.code_ostad.ToString(), IddMeli = x.idd_meli, Name = x.name, Family = x.family, DbName = x.dbName }).ToList(); ViewBag.TotalCount = newModel.Count; TempData["excel"] = newModel; return(View(newModel)); } }