public IActionResult Index() { ViewBag.Email = HttpContext.Session.GetString("Email"); ViewBag.Password = HttpContext.Session.GetString("Password"); ViewBag.AuthUser = _userDAO.RetrieveUserType(ViewBag.Email); if (ViewBag.Email != null) { ViewBag.DisplayName = _userDAO.RetrieveUserDisplay(ViewBag.Email); } if (string.IsNullOrWhiteSpace(_hostingEnvironment.WebRootPath)) { _hostingEnvironment.WebRootPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"); } string webRoot = _hostingEnvironment.WebRootPath; var file = new HistoryServices(); string filePath = webRoot + @"\Images\Gallery\2003"; var _service = new HistoryServices(); ViewBag.fileCount2003Folder = _service.CountFiles(webRoot + @"\Images\Gallery\2003"); ViewBag.fileName = file.FileName(filePath); return(View("Gallery2003CarShow")); }
public ActionResult ReportTransactionCounts(DateTime?When, DateTime?StartDate, String ByWhat = "", String Period = "Daily") { DateTime EndDate; DateTime ToStart; try { ReportTransactionCountModel ToShow = new ReportTransactionCountModel(); List <DailyCountModel> ReportData = new List <DailyCountModel>(); using (GiftEntities GiftEntity = new GiftEntities()) { HistoryServices HiInstance = new HistoryServices(GiftEntity); if (When == null) { EndDate = DateTime.Now.Date; } else { EndDate = When.Value; } ToStart = DateTime.Now.Date; if (StartDate != null) { ToStart = StartDate.Value; } ReportData = HiInstance.GetTransactionCounts(EndDate, ToStart, Period, ByWhat); Receipt FormattedReport = FormatTransactionCountReport(ReportData, EndDate, Period, ByWhat); TempData["Report"] = FormattedReport; } ToShow.Period = Period; ToShow.When = EndDate; ToShow.ByWhat = ByWhat; return(View(ToShow)); } catch (Exception Ex) { TempData["Error"] = Common.StandardExceptionErrorMessage(Ex); return(RedirectToAction("ViewErrorMessage")); } }
// GET: /<controller>/ public IActionResult Index() { ViewBag.Email = HttpContext.Session.GetString("Email"); ViewBag.Password = HttpContext.Session.GetString("Password"); ViewBag.AuthUser = _userDAO.RetrieveUserType(ViewBag.Email); if (string.IsNullOrWhiteSpace(_hostingEnvironment.WebRootPath)) { _hostingEnvironment.WebRootPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"); } string webRoot = _hostingEnvironment.WebRootPath; if (ViewBag.Email != null) { ViewBag.DisplayName = _userDAO.RetrieveUserDisplay(ViewBag.Email); } var _service = new HistoryServices(); ViewBag.fileCount2002Folder = _service.CountFiles(webRoot + @"\Images\Gallery\2002"); ViewBag.file2002ModifiedDate = _service.LastDateModified(webRoot + @"\Images\Gallery\2002"); ViewBag.fileCount2003Folder = _service.CountFiles(webRoot + @"\Images\Gallery\2003"); ViewBag.file2003ModifiedDate = _service.LastDateModified(webRoot + @"\Images\Gallery\2003"); ViewBag.fileCount2004Folder = _service.CountFiles(webRoot + @"\Images\Gallery\2004"); ViewBag.file2004ModifiedDate = _service.LastDateModified(webRoot + @"\Images\Gallery\2004"); ViewBag.fileCount2005Folder = _service.CountFiles(webRoot + @"\Images\Gallery\2005"); ViewBag.file2005ModifiedDate = _service.LastDateModified(webRoot + @"\Images\Gallery\2005"); ViewBag.fileCount2006Folder = _service.CountFiles(webRoot + @"\Images\Gallery\2006"); ViewBag.file2006ModifiedDate = _service.LastDateModified(webRoot + @"\Images\Gallery\2006"); //ViewBag.fileCount2007Folder = _service.CountFiles(@"Images\Gallery\2007"); //ViewBag.file2007ModifiedDate = _service.LastDateModified(@"Images\Gallery\2007"); return(View("History")); }
public ActionResult ReportSummary(DateTime?When, DateTime?StartDate, String Period = "Daily", String Reseller = "", String ChainSelected = "", String MerchantGroup = "", String MerchantSelected = "") { try { SummaryReportingData ToShow = new SummaryReportingData(); using (GiftEntities GiftEntity = new GiftEntities()) { IHistoryDAO HistoryRepositoryInstance = new HistoryDAO(GiftEntity); HistoryServices HiInstance = new HistoryServices(GiftEntity); DateTime EndDate; if (When == null) { EndDate = DateTime.Now.Date; } else { EndDate = When.Value; } DateTime ToStart = DateTime.Now.Date; if (StartDate != null) { ToStart = StartDate.Value; } ToShow.ReportData = HiInstance.GetSummaryReport(EndDate, ToStart, Period, Reseller, ChainSelected, MerchantGroup, MerchantSelected); ToShow.When = EndDate; ToShow.When = EndDate; } return(View(ToShow)); } catch (Exception Ex) { TempData["Error"] = Common.StandardExceptionErrorMessage(Ex); return(RedirectToAction("ViewErrorMessage")); } }
static void Main(string[] args) { while (true) { Console.Clear(); Console.WriteLine("Жил-был однажды колобок скучно и боязно ему было с бабкой да дедом."); Console.WriteLine("Решил он однажды укатиться от них.."); Console.WriteLine("Катится он...катится как вдруг.."); _historyServices = new HistoryServices(); for (int i = 0; i < _historyServices.CountEnemyHeroes; i++) { if (Meeting()) { break; } } if (_historyServices.IsLive()) { Console.WriteLine("Колобок не смог укатиться от бабки с дедом, потому что злые звери были сильнее него."); } else { Console.WriteLine("Колобок был хитрее и проворнее всех остальных и смог убежать"); } Console.WriteLine(""); Console.WriteLine("Хотите попробывать еще раз? Y/N"); if (!Console.ReadKey().Key.Equals(ConsoleKey.Y)) { break; } } }