/// <summary> /// Отчет за выбранный период /// </summary> private async void GetMelts() { _setLoading(true); _showReport = "none;"; _buttonState = false; _downloadable = "none;"; await Task.Delay(100); DateTime shiftTime; string template = "{0}-{1}-{2} {3}:{4}:{5}.{6}"; if (_shiftNumber == "1") { string begTmp = String.Format(template, _timeBegin.Day, _timeBegin.Month, _timeBegin.Year, "08", "00", "00", "000"); shiftTime = DateTime.Parse(begTmp); } else { string begTmp = String.Format(template, _timeBegin.Day, _timeBegin.Month, _timeBegin.Year, "20", "00", "00", "000"); shiftTime = DateTime.Parse(begTmp); } _shiftData = _shift.GetShiftByDate(shiftTime); _shiftReportData = _reports.GetShiftReports(_shiftData); string fileName = _excel.GetShiftDetailReport(_shiftReportData, _webRootPath); _url = fileName; _downloadable = "inline;"; _showReport = "block"; _buttonState = true; _setLoading(false); StateHasChanged(); }
private void Initialize() { _logger = LogManager.GetCurrentClassLogger(); _timeBegin = DateTime.Now; _shiftNumber = "1"; _showReport = "none;"; _loading = "hidden;"; _downloadable = "none;"; _url = "#"; _reports = new Reports(); _shift = new Shift(); _shiftReportData = new ShiftReportsData(); _excel = new ExcelReportGenerator(); _buttonState = true; _webRootPath = reportingService.WebHostEnvironment.WebRootPath; _webRootPath = Path.Combine(_webRootPath, "files"); RemoveOldFiles(_webRootPath); }
/// <summary> /// Отчет за предыдущую смену /// </summary> private async void GetPrevShift() { _setLoading(true); _showReport = "none;"; _buttonState = false; _downloadable = "none;"; await Task.Delay(100); // Получить данные по предыдущей смене _shiftData = _shift.GetPreviousShift(); _shiftReportData = _reports.GetShiftReports(_shiftData); ExcelReportGenerator excel = new ExcelReportGenerator(); string fileName = excel.GetShiftDetailReport(_shiftReportData, _webRootPath); _url = fileName; _downloadable = "inline;"; _showReport = "block"; _buttonState = true; _setLoading(false); StateHasChanged(); }