public ActionResult AddLinkagesResult() { int SSRSReportId = Convert.ToInt32(Request.Form["selectedReportId"]); string selectedEuName = Request.Form["CreatedEndUser"]; DB.ReportLinkage temp = new DB.ReportLinkage(); temp.SSRSReportId = SSRSReportId; temp.LinkageType = Request.Form["LinkageType"]; temp.LinkLocation = Request.Form["LinkLocation"]; temp.CreateEnduserId = DB_MSBDW.endusers.FirstOrDefault(eu => eu.full_name == selectedEuName).id; temp.RowCreateDate = DateTime.Now; DB_MSBDW.ReportLinkages.Add(temp); DB_MSBDW.SaveChanges(); List <DB.ReportLinkage> reportLink = DB_MSBDW.ReportLinkages.Where(sp => sp.SSRSReportId == SSRSReportId).OrderByDescending(sp => sp.RowCreateDate).ToList(); LinkagesViewModel storedProcsViewModel = new LinkagesViewModel(reportLink); ViewData["selectedReportId"] = SSRSReportId; ViewData["buttonName"] = "LK"; ViewData["selectedReportName"] = Request.Form["selectedReportName"]; return(RedirectToAction("Index", "Linkages", new { id = SSRSReportId, name = Request.Form["selectedReportName"] })); }
// GET: Linkages public ActionResult Index(int id, string name) { int selectedReport = id; string selectedReportName = name; List <DB.ReportLinkage> reportLink = DB_MSBDW.ReportLinkages.Where(sp => sp.SSRSReportId == selectedReport).OrderByDescending(sp => sp.RowCreateDate).ToList(); LinkagesViewModel storedProcsViewModel = new LinkagesViewModel(reportLink); ViewData["selectedReportId"] = selectedReport; ViewData["buttonName"] = "LK"; ViewData["selectedReportName"] = selectedReportName; return(View(storedProcsViewModel.reportLinkages)); }