public ActionResult ShowProductListing(Models.SearchDate dt) { try { Session["ShowResults"] = null; string st = dt.providedSearchDate.ToShortDateString(); if (string.IsNullOrEmpty(st) == false) { ViewBag.Message = "Show Products Details by Date - iICE Environment"; ViewBag.Date = st; //check if there are products for that date var foundProductsiICE = (from m in db.iICE_Staging where DbFunctions.TruncateTime(m.TransferredDate) == DbFunctions.TruncateTime(dt.providedSearchDate) select m).ToList(); //count int countOFoundProductsiICE = foundProductsiICE.Count(); if (countOFoundProductsiICE > 0) { Session["ShowResults"] = true; ViewBag.CounteriICE = countOFoundProductsiICE; ViewBag.productsiice = "There were" + " " + ViewBag.CounteriICE + " " + "Products Sent From iice on the Provided Date:" + " " + ViewBag.Date; return(View(foundProductsiICE)); } else { Session["ShowResults"] = null; ViewBag.CounteriICE = countOFoundProductsiICE; ViewBag.productsiice = "There were" + " " + ViewBag.CounteriICE + " " + "Products Sent From iice on the Provided Date" + " " + ViewBag.Date; return(View()); } } else { ViewBag.Message = "Something Went Wrong!- Date came through as null"; return(View()); } } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "iICEStaging", "ShowProductListing"))); } }
public ActionResult ShowProductDetailsByDate(Models.SearchDate dt) { try { Session["ShowHGResultsByDate"] = null; string st = dt.providedSearchDate.ToShortDateString(); if (string.IsNullOrEmpty(st) == false) { ViewBag.Message = "Product Listing - HG Environment "; ViewBag.Date = st; //check if there are products for that date var foundHGProductsByDate = (from m in hg.HG_PDM where DbFunctions.TruncateTime(m.TransferredDate) == DbFunctions.TruncateTime(dt.providedSearchDate) select m).ToList(); //count int countOfFoundHGProductsByDate = foundHGProductsByDate.Count(); if (countOfFoundHGProductsByDate > 0) { Session["ShowHGResultsByDate"] = true; ViewBag.CounterHG = countOfFoundHGProductsByDate; ViewBag.productsHG = "There were" + " " + ViewBag.CounterHG + " " + "Products Sent from HG on the Provided Date:" + " " + ViewBag.Date; return(View(foundHGProductsByDate)); } else { Session["ShowHGResultsByDate"] = null; ViewBag.CounterHG = countOfFoundHGProductsByDate; ViewBag.productsHG = "There were" + " " + ViewBag.CounterHG + " " + "Products Sent from HG on the Provided Date:" + " " + ViewBag.Date; return(View()); } } else { ViewBag.Message = "Something Went Wrong!- Date came through as null"; return(View()); } } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "HG", "ShowProductDetailsByDate"))); } }