public IContentReader GetCurrentDescriptorContent()
        {
            var current = _folder.GetBlockBlobReference(FileNameMaker.CurrentFileName()).DownloadTextAsync().Result
                          .Trim();

            if (string.IsNullOrEmpty(current))
            {
                throw new InvalidDataException("bad CURRENT file");
            }

            return(new StreamContentReader(_folder.GetBlockBlobReference(current).OpenReadAsync().Result));
        }
示例#2
0
        private void MakeReport(ReportType type)
        {
            DateTime day  = ScheduleView.SelectedSlot.Start;
            DateTime from = day.GetFirstDayOfWeek();
            DateTime to   = day.GetLastDayOfWeek();

            CheckFlag  selectedFlag       = (CheckFlag)CheckStatusComboBox.SelectedItem;
            Department selectedDepartment = (DepartmentComboBox.SelectedItem as Department);
            Bank       selectedBank       = (BankComboBox.SelectedItem as Bank);

            ReportParameter param = new ReportParameter()
            {
                Type           = type,
                CheckFlag      = selectedFlag,
                DepartmentId   = selectedDepartment.Id,
                BankId         = (int)selectedBank.Id,
                DepartmentName = selectedDepartment.Name,
                BankName       = selectedBank.BankName,
                Day            = day,
                From           = from,
                To             = to
            };

            FileNameMaker maker    = new FileNameMaker(param);
            string        fileName = maker.GetFileName();

            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter   = "Excel Documents (*.xlsx)|*.xlsx";
            saveFileDialog.FileName = fileName;
            if (saveFileDialog.ShowDialog() == true)
            {
                try{
                    ExportReport(param, saveFileDialog.FileName);
                    MessageBox.Show("Report Generated!");
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message, "Error Exporting Report");
                }
            }
        }
示例#3
0
 public string TableFileName(ulong number)
 {
     return(FullPath(FileNameMaker.TableFileName(number)));
 }
示例#4
0
 public string DescriptorFileName(ulong number)
 {
     return(FullPath(FileNameMaker.DescriptorFileName(number)));
 }
示例#5
0
 public string CurrentFileName()
 {
     return(FullPath(FileNameMaker.CurrentFileName()));
 }
 public IContentReader GetTableContentById(ulong num)
 {
     return(new BlockBlobContentReader(_folder.GetBlockBlobReference(FileNameMaker.TableFileName(num))));
 }