public void startImporting()
        {
            #region To Import Debit Note
            DataSet dsPath = new DataSet();
            dsPath = getPathDetail("FlexDownload");
            string ImportPath = dsPath.Tables[0].Rows[0]["KeyValue"].ToString();
            if (!Directory.Exists(ImportPath))
            {
                try
                {
                    CreateNewFolder(ImportPath);
                }
                catch { throw; }
            }

            ds = new DataSet();
            ds = getDebitNoteDetailToCsv();
            if (ds.Tables["TM_FlexDebitNote_BSToFlex"].Rows.Count > 0)
            {
                GenerateCsvFile objCSv  = new GenerateCsvFile();
                string          strFile = "DBN" + ".csv";

                string FilePath = ImportPath + strFile + "";
                objCSv.exportToCSVfile(ds, ",", "\n", FilePath);

                objBstoCsv                     = new FlexBsToCsv();
                objBstoCsv.csvId               = 0;
                objBstoCsv.InternalFileName    = strFile;
                objBstoCsv.ImportFor           = "DBN";
                objBstoCsv.Total_No_of_Records = ds.Tables["TM_FlexDebitNote_BSToFlex"].Rows.Count;
                SaveDebitNoteDetailToCsv(objBstoCsv);
            }
            #endregion
        }
 public DataSet SaveDebitNoteDetailToCsv(FlexBsToCsv objFlexcsv)
 {
     object[] parameter = new object[] { objFlexcsv.csvId,
                                         objFlexcsv.InternalFileName,
                                         objFlexcsv.DisplayFileName,
                                         objFlexcsv.ImportFor,
                                         objBstoCsv.FileType,
                                         objBstoCsv.Total_No_of_Records,
                                         objBstoCsv.BatchRefId, };
     DataAccessDs = new DataAccess();
     return(DataAccessDs.LoadDataSet(parameter, "P_TM_FlexIRMToFlexCsvFile_List_InsertUpdate", "TM_FlexDebitNote_IRMToFlex"));
 }
        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
        }