コード例 #1
0
        private void SaveControlFile()
        {
            Common.WriteToDebugWindow(String.Format("SaveControlFile:{0},{1},{2},{3:F2}",
                                                    CycleDate.ToShortDateString(), CurrentDate.ToShortDateString(), RecordCount, TotalAmount));

            string fileName         = null;
            string initialDirectory = OutputPath;

            if (null != (fileName = GetControlFileName()))
            {
                string outputFile = ExcelHlp.GetSaveFileName(initialDirectory, fileName);

                FileInfo fileInfo = new FileInfo(outputFile);
                OutputPath = fileInfo.DirectoryName;

                using (StreamWriter writer = new StreamWriter(outputFile))
                {
                    // TODO:(crhodes) Remove TotalAmount for CMF output
                    writer.Write(String.Format("{0},{1},{2},{3:F2}",
                                               CycleDate.ToShortDateString(), CurrentDate.ToShortDateString(), RecordCount, TotalAmount));
                    writer.Close();
                }

                pnlTask_SaveControlFile.BackColor = Color.Green;
            }
            else
            {
                pnlTask_SaveControlFile.BackColor = Color.Red;
            }
        }
コード例 #2
0
 public string CsvOutput()
 {
     if (Uploaded == false)
     {
         return($"{WaitTime},{Branch},{Number},{Certifier},{Date.ToShortDateString()},{CycleNumber},{CycleDate.ToShortDateString()}");
     }
     return($"{Year},{Number},{Date.ToShortDateString()},{CycleDate.ToShortDateString()},{CycleNumber},{Branch},{Certifier},{UploadedBy},{UploadedOn}");
 }