// Copy needed word template of invoice
        private int CopyTemplate()
        {
            var fName = "";

            switch (invoice.brokerCode.ToLower())
            {
            case "kord":
                fName = "Korund";
                break;

            case "altk":
                fName = "Altaik";
                break;

            case "akal":
                fName = "AkAltyn";
                break;
            }

            var wherePath = Service.GetDirectory();

            if (wherePath != null)
            {
                fPath = wherePath.FullName;

                System.IO.File.Copy(FileArchiveTransport.GetTemplatesPath() + "\\" + "bill" + fName + ".docx", fPath + "\\Счет (" + invoice.invoiceNumber + ") от " + invoice.brokerCode + ".docx");
            }
            else
            {
                return(0);
            }

            return(1);
        }
Beispiel #2
0
        private void Copy()
        {
            if (!Directory.Exists(where))
            {
                return;
            }

            try {
                System.IO.File.Copy(FileArchiveTransport.GetTemplatesPath() + "\\" + TEMPLATE_FILE_NAME, where + "\\Заявка.xlsx", true);
            } catch (Exception ex) { Debug.Write("Внимание: Problem with copying Order file " + ex.Message); }
        }
 private Boolean SaveAs(string toFullFileName)
 {
     try
     {
         File.Copy(FileArchiveTransport.GetOrderTemplatePath() + TEMPLATE_FILE_NAME, toFullFileName, true);
         outName = toFullFileName;
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
        private void CopyTemplate()
        {
            var wherePath = Service.GetDirectory();

            if (wherePath != null)
            {
                fPath = wherePath.FullName;
                fName = fPath + "\\Акт о несостоявшемся торге под №" + fName + ".docx";

                try {
                    System.IO.File.Copy(FileArchiveTransport.GetTemplatesPath() + "\\failedAuction.docx", fName);
                } catch (Exception ex) {
                    Debug.WriteLine(ex.Message);
                }
            }
        }
Beispiel #5
0
        public static int MakeNewReport(string reportFile, int type)
        {
            var    reportCount    = 0;
            string targetFileName = "";

            foreach (var report in ETSReportConverter.GetReports(reportFile))
            {
                targetFileName = FileArchiveTransport.GetOutcomingReportFileName((type == 1 ? DFConfig.ClientReportFileName : DFConfig.SupplierReportFileName +
                                                                                  report.ClientName.Replace("'", " ").Trim().Replace("\"", "") + " по лоту ") + report.Code + ".docx", report.Id, report.Code);

                ReportService.CreateReport(targetFileName, report, type);

                reportCount++;
            }

            return(reportCount);
        }
Beispiel #6
0
        /// <summary>
        /// Makes and Returns new reports from single file
        /// </summary>
        /// <returns></returns>
        public static int MakeNewReport(string reportFile)
        {
            var    reportCount    = 0;
            string targetFileName = "";

            foreach (var report in ETSReportConverter.GetReports(reportFile))
            {
                targetFileName = FileArchiveTransport.GetOutcomingReportFileName((string.Equals(report.Id.ToLower(), "altk", StringComparison.OrdinalIgnoreCase) ?
                                                                                  DFConfig.ClientReportFileName : DFConfig.SupplierReportFileName +
                                                                                  report.ClientName.Replace("'", " ").Trim().Replace("\"", "") + " по лоту ") + report.Code + ".docx", report.Id, report.Code);

                //ReportService.CreateReport(targetFileName, report);

                reportCount++;
            }

            return(reportCount);
        }
Beispiel #7
0
        private void OnWriteInJournal()
        {
            var formC01Service = new FormC01Service(FileArchiveTransport.GetJournalC01FileName());
            var formC01        = new FormC01();

            formC01.code   = OurCompany.code;
            formC01.bin    = BIN;
            formC01.date   = Convert.ToDateTime(DateTxt);
            formC01.name   = OurCompany.name;
            formC01.broker = OurCompany;

            var wherePath = Service.GetDirectory();

            if (wherePath != null)
            {
                formC01 = formC01Service.InsertCompany(formC01);
                formC01Service.CreateTemplate(formC01, wherePath.FullName);
            }
        }
Beispiel #8
0
        public void CreateTemplate(FormC01 form, string saveTo)
        {
            var FILE_NAME = "formC01.docx";

            System.IO.File.Copy(FileArchiveTransport.GetFormC01TemplateFileName(), saveTo + "\\" + FILE_NAME, true);

            var word = new WordService(saveTo + "\\" + FILE_NAME, false);

            word.SetCell(1, 1, 2, form.broker.name);
            word.SetCell(1, 2, 2, form.broker.code);
            word.SetCell(2, 2, 1, form.code);
            word.SetCell(2, 2, 2, form.bin);
            word.SetCell(2, 2, 3, form.name);
            word.SetCell(2, 2, 5, form.codeG + " " + form.codeS);
            word.SetCell(2, 2, 6, form.codeP);

            word.CloseDocument(true);
            word.CloseWord(true);
        }
        public static List <JournalC01Company> GetCompanies(string brokerCode)
        {
            var journalC01Companies = new List <JournalC01Company>();
            var excel = new ExcelService(FileArchiveTransport.GetJournalC01FileName());

            excel.SetActiveSheetByName(brokerCode);

            for (var iRow = excel.GetRowsCount(); iRow > 0; iRow--)
            {
                var name = excel.GetCell(iRow, "C");
                if (!string.IsNullOrEmpty(name))
                {
                    journalC01Companies.Add(new JournalC01Company {
                        name = name, bin = excel.GetCell(iRow, "D"), code = excel.GetCell(iRow, "E")
                    });
                }
            }

            excel.CloseWorkbook(false);
            excel.CloseExcel();

            return(journalC01Companies);
        }
Beispiel #10
0
 public void CopyTemplates()
 {
     System.IO.File.Copy(FileArchiveTransport.GetCommissionToDealTemplateFileName(), path + "\\" + FILE_NAME_COMMISSION, true);
 }
 private void FillSettings()
 {
     PathSettings = FileArchiveTransport.LoadConfiguration();
 }
 private void CopyTemplate()
 {
     System.IO.File.Copy(FileArchiveTransport.GetWaitingListTemplateFileName(), fPath + "\\" + FILE_NAME, true);
 }
Beispiel #13
0
 public static string GetReportsPath()
 {
     return(FileArchiveTransport.GetReportPath());
 }
Beispiel #14
0
 public void CopyTemplateToEndPath()
 {
     System.IO.File.Copy(FileArchiveTransport.GetEntryOrderTemplateFileName(), wherePath + "\\" + FILE_NAME, true);
 }
Beispiel #15
0
 private void CopyTemplate()
 {
     System.IO.File.Copy(FileArchiveTransport.GetMoneyTransferTemplateFileName(), fPath + "\\" + FILE_NAME, true);
 }