Example #1
0
        public void makeCsvForInValidRecords(DataSet dsRecord)
        {
            GenerateCsvFile objCSv      = new GenerateCsvFile();
            string          strDestPath = mstrSourceFilePath + "ExceptionFiles";

            if (!Directory.Exists(strDestPath))
            {
                try
                {
                    CreateNewFolder(strDestPath);
                }
                catch { throw; }
            }
            //string FilePath = strCurrFileName.Substring(0, strCurrFileName.LastIndexOf(@"\")) + @"\ExceptionFiles\" + strCurrFileName.Substring(strCurrFileName.LastIndexOf(@"\") + 1);
            string FilePath = strDestPath + "\\" + strFileName;

            objCSv.exportToCSVfile(dsRecord, ",", "\n", FilePath);
        }
        public void startICAMImporting()
        {
            #region To Import ICAM
            DataSet dsPath = new DataSet();
            dsPath = getPathDetail("IRM_ICAMDownload");
            string ImportPath = dsPath.Tables[0].Rows[0]["KeyValue"].ToString();

            if (!Directory.Exists(ImportPath))
            {
                try
                {
                    CreateNewFolder(ImportPath);
                }
                catch { throw; }
            }

            ds = new DataSet();
            ds = getICAMDetailToCsv();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                GenerateCsvFile objCSv = new GenerateCsvFile();
                //string strFile = "IRMCLIENT" + System.DateTime.Now.ToString("yyyyMMdd").Trim().Replace(" ", "").Replace("/", "_").Replace(":", "_") + ".csv";
                string strFile = "IRMCLIENT" + ".csv";

                string FilePath = ImportPath + strFile + "";
                //EventLog.WriteEntry("NWI_IRMFlexProcess", "Importing Started Successfully", System.Diagnostics.EventLogEntryType.Error);
                objCSv.exportToCSVfile(ds, ",", "\n", FilePath);
                objBstoCsv                     = new FlexBsToCsv();
                objBstoCsv.csvId               = 0;
                objBstoCsv.InternalFileName    = strFile;
                objBstoCsv.ImportFor           = "IRM";
                objBstoCsv.Total_No_of_Records = ds.Tables[0].Rows.Count;
                SaveDebitNoteDetailToCsv(objBstoCsv);
            }
            #endregion
        }