Beispiel #1
0
        private bool saveData()
        {
            bool result = false;
            if (dataValidated())
            {
                smallPleaseWait pleaseWait = new smallPleaseWait();
                pleaseWait.Show();

                //  ALlow main UI thread to properly display please wait form.
                Application.DoEvents();
                result = saveDataTransaction();

                pleaseWait.Close();

                return result;
            }

            return result;
        }
        private void reprintButton_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("PRINT RECEIPT ? ", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {
                smallPleaseWait pleaseWait = new smallPleaseWait();
                pleaseWait.Show();

                //  ALlow main UI thread to properly display please wait form.
                Application.DoEvents();
                printReport(prInvoiceTextBox.Text);

                pleaseWait.Close();
            }
        }
        private void dataPenerimaanBarang_KeyDown(object sender, KeyEventArgs e)
        {
            string selectedPRInvoice = "";
            string selectedPOInvoice = "";
            string selectedPMInvoice = "";

            if (e.KeyCode == Keys.Enter)
            { 
                if (dataPenerimaanBarang.Rows.Count <= 0)
                    return;

                int rowSelectedIndex = (dataPenerimaanBarang.SelectedCells[0].RowIndex);
                DataGridViewRow selectedRow = dataPenerimaanBarang.Rows[rowSelectedIndex];
                selectedPRInvoice = selectedRow.Cells["NO PENERIMAAN"].Value.ToString();
                selectedPOInvoice = selectedRow.Cells["PURCHASE_INVOICE"].Value.ToString();
                selectedPMInvoice = selectedRow.Cells["PM_INVOICE"].Value.ToString();

                if (DialogResult.Yes == MessageBox.Show("PRINT RECEIPT ?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                    smallPleaseWait pleaseWait = new smallPleaseWait();
                    pleaseWait.Show();

                    //  ALlow main UI thread to properly display please wait form.
                    Application.DoEvents();
                    printReport(selectedPRInvoice, selectedPMInvoice, selectedPOInvoice);

                    pleaseWait.Close();
                }
            }
        }
        private void restoreButton_Click(object sender, EventArgs e)
        {
            if (fileNameTextbox.Text != "")
            {
                smallPleaseWait pleaseWait = new smallPleaseWait();
                pleaseWait.Show();

                //  ALlow main UI thread to properly display please wait form.
                Application.DoEvents();
                //restore database from file
                restoreDatabase(fileNameTextbox.Text);

                pleaseWait.Close();

                gUtil.saveUserChangeLog(globalConstants.MENU_SINKRONISASI_INFORMASI, globalConstants.CHANGE_LOG_UPDATE, "RESTORE DATABASE FROM LOCAL BACKUP");
            }
            else
            {
                String errormessage = "Filename is blank." + Environment.NewLine + "Please find the appropriate file!";
                gUtil.showError(errormessage);
            }
        }
        private void saveButton_Click(object sender, EventArgs e)
        {
            gUtil.saveSystemDebugLog(globalConstants.MENU_PENERIMAAN_BARANG, "SAVE PENERIMAAN BARANG");

            if (saveData())
            {
                gUtil.saveSystemDebugLog(globalConstants.MENU_PENERIMAAN_BARANG, "PENERIMAAN BARANG SAVED");

                if (originModuleId == globalConstants.PENERIMAAN_BARANG_DARI_MUTASI)
                {
                    gUtil.saveSystemDebugLog(globalConstants.MENU_PENERIMAAN_BARANG, "PENERIMAAN BARANG FROM MUTASI, UPDATE HQ DATA");

                    // UPDATE DATA AT HQ
                    if (!sendUpdateToHQ())
                    {
                        gUtil.saveSystemDebugLog(globalConstants.MENU_PENERIMAAN_BARANG, "FAILED TO UPDATE HQ DATA");
                        MessageBox.Show("KONEKSI KE PUSAT GAGAL");
                    }
                    gUtil.saveUserChangeLog(globalConstants.MENU_MUTASI_BARANG, globalConstants.CHANGE_LOG_INSERT, "PENERIMAAN BARANG [" + prInvoiceTextBox.Text + "] DARI MUTASI[" + noMutasiTextBox.Text + "]");
                }
                else
                    gUtil.saveUserChangeLog(globalConstants.MENU_MUTASI_BARANG, globalConstants.CHANGE_LOG_INSERT, "PENERIMAAN BARANG [" + prInvoiceTextBox.Text + "] NO PO [" + selectedInvoice + "]");

                if (DialogResult.Yes == MessageBox.Show("PRINT RECEIPT ? ", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                    smallPleaseWait pleaseWait = new smallPleaseWait();
                    pleaseWait.Show();

                    //  ALlow main UI thread to properly display please wait form.
                    Application.DoEvents();
                    printReport(prInvoiceTextBox.Text);

                    pleaseWait.Close();
                }

                saveButton.Visible = false;
                reprintButton.Visible = true;

                gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

                prInvoiceTextBox.Enabled = false;
                PRDtPicker.Enabled = false;
                detailGridView.ReadOnly = true;
                gUtil.showSuccess(gUtil.INS);
            }
        }
        private void backupButton_Click(object sender, EventArgs e)
        {
            string localDate = "";
            string fileName = "";
            localDate = String.Format(culture, "{0:ddMMyyyy}", DateTime.Now);
            fileName = "BACKUP_" + localDate + ".sql";

            saveFileDialog1.FileName = fileName;
            saveFileDialog1.AddExtension = true;
            saveFileDialog1.DefaultExt = "sql";
            saveFileDialog1.Filter = "SQL File (.sql)|*.sql";

            if (DialogResult.OK == saveFileDialog1.ShowDialog())
                if (gUtil.allTrim(saveFileDialog1.FileName).Length > 0)
                {
                    smallPleaseWait pleaseWait = new smallPleaseWait();
                    pleaseWait.Show();

                    //  ALlow main UI thread to properly display please wait form.
                    Application.DoEvents();
                    backupDatabase(saveFileDialog1.FileName);

                    pleaseWait.Close();
                }
        }
Beispiel #7
0
        private void messagingForm_Load(object sender, EventArgs e)
        {
            smallPleaseWait pleaseWait = new smallPleaseWait();
            pleaseWait.Show();

            //  ALlow main UI thread to properly display please wait form.
            Application.DoEvents();

            pullMessageData();

            pleaseWait.Close();

            loadMessageData();
        }
        private void importFromServerButton_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("PASTIKAN TIDAK ADA KONEKSI AKTIF KE DATABASE LOKAL, SEMUA USER DIPASTIKAN LOG OUT", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
            {
                smallPleaseWait pleaseWait = new smallPleaseWait();
                pleaseWait.Show();
                //  ALlow main UI thread to properly display please wait form.
                Application.DoEvents();

                if (syncToCentralHQ())
                { 
                    gutil.saveUserChangeLog(globalConstants.MENU_SINKRONISASI_INFORMASI, globalConstants.CHANGE_LOG_UPDATE, "SINKRONISASI INFORMASI DENGAN SERVER VIA ONLINE CONNECTION");
                }
                pleaseWait.Close();
            }
        }
        private void importFromFileButton_Click(object sender, EventArgs e)
        {
            if (fileNameTextbox.Text != "")
            {
                //this.Cursor = Cursors.WaitCursor;

                //restore database from file
                gutil.saveSystemDebugLog(globalConstants.MENU_SINKRONISASI_INFORMASI, "SINKRONISASI INFORMASI, FILENAME [" + fileNameTextbox.Text + "]");
                smallPleaseWait pleaseWait = new smallPleaseWait();
                pleaseWait.Show();
                //  ALlow main UI thread to properly display please wait form.
                Application.DoEvents();

                syncInformation(fileNameTextbox.Text);

                pleaseWait.Close();

                gutil.saveUserChangeLog(globalConstants.MENU_SINKRONISASI_INFORMASI, globalConstants.CHANGE_LOG_UPDATE, "SINKRONISASI INFORMASI DENGAN SERVER VIA USB EXPORT");
                
            }
            else
            {
                String errormessage = "Filename is blank." + Environment.NewLine + "Please find the appropriate file!";
                gutil.showError(errormessage);
            }
        }
        private void exportDataButton_Click(object sender, EventArgs e)
        {
            string localDate = "";
            string fileName = "";
            localDate = String.Format(culture, "{0:ddMMyyyy}", DateTime.Now);
            fileName = "SYNCINFO_PRODUCT_" + localDate + ".sql";

            saveFileDialog1.FileName = fileName;
            saveFileDialog1.AddExtension = true;
            saveFileDialog1.DefaultExt = "sql";
            saveFileDialog1.Filter = "SQL File (.sql)|*.sql";
            saveFileDialog1.ShowDialog();

            smallPleaseWait pleaseWait = new smallPleaseWait();
            pleaseWait.Show();

            //  ALlow main UI thread to properly display please wait form.
            Application.DoEvents();
            exportData(saveFileDialog1.FileName, DS);

            pleaseWait.Close();

            gutil.saveSystemDebugLog(globalConstants.MENU_SINKRONISASI_INFORMASI, "EXPORTED FILE NAME = " + saveFileDialog1.FileName);
            MessageBox.Show("DONE");
        }