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"] })); }
public int SaveLinkage(LinkageToUpdate linkage) { DB.ReportLinkage lk = DB_MSBDW.ReportLinkages.FirstOrDefault(l => l.ID == linkage.ID); switch (linkage.ColumnToUpdate) { case "LinkageLocation": lk.LinkLocation = linkage.FieldValue; break; default: break; } DB_MSBDW.SaveChanges(); return(1); }