private void sendDataCustomerToPabrik() { globalSynchronizeLib gSync = new globalSynchronizeLib(); if (gSync.sendDataToServer("MASTER_CUSTOMER", "CUSTOMER_ID", custID)) { gSync.updateSyncFlag("MASTER_CUSTOMER", "CUSTOMER_ID", custID); } }
public void closeShopProcedure() { string sqlCommand; DateTime defaultSuccessDate = DateTime.Now; defaultSuccessDate = defaultSuccessDate.AddDays(-1); sqlCommand = "SELECT COUNT(1) FROM CLOSE_SHOP_HISTORY"; if (Convert.ToInt32(DS.getDataSingleValue(sqlCommand)) <= 0) firstTimeClose = true; else { sqlCommand = "SELECT IFNULL(DATE_FORMAT(LAST_SUCCESS_LOCAL_DATE, '%Y%m%d'), '') FROM CLOSE_SHOP_HISTORY LIMIT 1"; localSuccessDate = DS.getDataSingleValue(sqlCommand).ToString(); if (localSuccessDate.Length <= 0) localSuccessDate = String.Format(culture, "{0:yyyyMMdd}", defaultSuccessDate); sqlCommand = "SELECT IFNULL(DATE_FORMAT(LAST_SUCCESS_SERVER_DATE, '%Y%m%d'), '') FROM CLOSE_SHOP_HISTORY LIMIT 1"; serverSuccessDate = DS.getDataSingleValue(sqlCommand).ToString(); if (serverSuccessDate.Length <= 0) serverSuccessDate = String.Format(culture, "{0:yyyyMMdd}", defaultSuccessDate); firstTimeClose = false; } // PRINT OUT SUMMARY printOutSummary(); localSuccess = true; if (gUtil.isServerApp() == 0) { // SEND DATA PESANAN TO PABRIK // =================================================== if (gSync.sendDataToServer("MASTER_CUSTOMER")) gSync.updateSyncFlag("MASTER_CUSTOMER"); if (gSync.sendDataToServer("SALES_HEADER")) gSync.updateSyncFlag("SALES_HEADER"); if (gSync.sendDataToServer("SALES_DETAIL")) gSync.updateSyncFlag("SALES_DETAIL"); if (gSync.sendDataToServer("SALES_DETAIL_FULFILLMENT")) gSync.updateSyncFlag("SALES_DETAIL_FULFILLMENT"); // =================================================== } // SYNCHRONIZE TO SERVER //if (synchronizeDataToServer()) if (gSync.syncDataForCloseShop()) serverSuccess = true; // EXPORT TO FILE //exportData(); if (serverSuccess) { // CLEAR DATA PENJUALAN TUNAI LUNAS clearDailyTransaction(); // CLEAR DATA JURNAL HARIAN clearDailyJournal(); } updateLastSuccessDate(); }