public void ProcessFile(string pathToFile) { string excelQuery = "SELECT * FROM [" + WorksheetName.TTIn[0] + "$]"; BulkLoad load = new BulkLoad(pathToFile, WorksheetName.TTIn[0], WorksheetName.TTIn[1], _sqlConnectionString, excelQuery); load.LoadData(); SqlService sql = new SqlService(_sqlConnectionString); try { sql.ExecuteSP("MMD_spProcessTTIn"); } catch (Exception ex) { throw new Exception("UploadTTIn: " + ex.Message + Environment.NewLine + sql.SqlQuery); } }
public void ProcessFile(string pathToFile) { string sqlNotAllocated = "SELECT [Indent NO], [For Date], [Dealer], [Dlr#], [MSE], [MSEP], [HSDE], [HSDET], [MS], [MSP], [HSD],"; sqlNotAllocated += "[HSDT],[MSEF], [MSEFP], [HSDEF], [HSDEFT], [SKO], [SKOH], [Indent Date], [PAYMENT] "; sqlNotAllocated += string.Format(@"FROM [{0}$]", WorksheetName.NotAllocated[0]); BulkLoad load = new BulkLoad(pathToFile, WorksheetName.NotAllocated[0], WorksheetName.NotAllocated[1], _sqlConnectionString, sqlNotAllocated); load.LoadData(); SqlService sql = new SqlService(_sqlConnectionString); try { sql.ExecuteSP("MMD_spProcessTmpNotAllocatedOrders"); } catch (Exception ex) { throw new Exception("UploadNotAllocated: " + ex.Message + Environment.NewLine + sql.SqlQuery); } }
public void ProcessFile(string pathToFile) { string sqlAllocated = "SELECT [Indent No#], [For Date & Indent Date], [Truck No], [Dealer], [Invoice No], [MSE], [MSEP], [HSDE], [HSDET], [MS], [MSP], [HSD],"; sqlAllocated += "[HSDT],[MSEF], [MSEFP], [HSDEF], [HSDEFT], [SKO], [SKOH] "; sqlAllocated += string.Format(@"FROM [{0}$]", WorksheetName.Allocated[0]); BulkLoad load = new BulkLoad(pathToFile, WorksheetName.Allocated[0], WorksheetName.Allocated[1], _sqlConnectionString, sqlAllocated); load.LoadData(); //run sproc to process temp table into new orders //MMD_spProcessTmpAllocatedOrders SqlService sql = new SqlService(_sqlConnectionString); try { sql.ExecuteSP("MMD_spProcessTmpAllocatedOrders"); } catch (Exception ex) { throw new Exception("UploadAllocated: " + ex.Message + Environment.NewLine + sql.SqlQuery); } }