private string SyncOperator(bool firstSync) { string err = string.Empty; //tampungan error message deleteOperatorTmp(); //hapus tmp err = downloadOperatorTmp(); //insert tmp //cek fisrtSync if (firstSync == true) { if (err != string.Empty) { //jika terjadi error return(err); } } cQuery qr = new cQuery(); if (cekDataSqlLIte(qr.qSelectUserTmpLimit1(), false) == true) //cek tabel tmp { //jika ada datanya //pindah tabel tmp ke kendaraan deleteOperator(); copyTmpToOperator(); if (ProgressBarSinkron.Value == ProgressBarSinkron.Maximum)//jika sudah selesai tampilkan download complete { if (LbDownload.InvokeRequired) { LbDownload.BeginInvoke( new Action(() => { LbDownload.Text = "Download Complete"; } )); } } //cek firstSync if (firstSync == false) { MessageBox.Show("" + ProgressBarSinkron.Value + " Data Berhasil di Download", "BSI UMY", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (LbDownload.InvokeRequired) { LbDownload.BeginInvoke( new Action(() => { LbDownload.Text = string.Empty; } )); } } else { MessageBox.Show("Synchronize Failed", "BSI UMY", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(err); }