コード例 #1
0
        private void bwPosting_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);
                this.Close();
                return;
            }
            if (e.Cancelled)
            {
                MessageBox.Show("Proses download dibatalkan");
                this.Close();
                return;
            }
            if (MessageBox.Show(String.Format("Proses rekap data absensi selesai.\nApakah anda akan melanjutkan ke proses upload absensi ke web?"),
                                "Konfirmasi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                upload_download upload = new upload_download();
                upload.upload_download_keterangan = "Data " + tgl1.ToString("dd MMMM yyyy") + " s/d " + tgl2.ToString("dd MMMM yyyy");
                upload.upload_download_jenis      = "Upload Absen";
                upload.upload_download_tanggal    = DateTime.Now;
                fp.upload_download.Add(upload);
                fp.SaveChanges();

                FormProsesUploadAbsensiKeWeb proses = new FormProsesUploadAbsensiKeWeb();
                proses.tgl1          = tgl1;
                proses.tgl2          = tgl2;
                proses.StartPosition = FormStartPosition.CenterParent;
                proses.ShowDialog(this);
            }
            this.Close();
        }
コード例 #2
0
        private void btnSimpan_Click(object sender, EventArgs e)
        {
            try
            {
                fingerprintEntities fp     = new fingerprintEntities();
                upload_download     upload = new upload_download();
                upload.upload_download_keterangan = "Data " + dtTanggal1.Value.ToString("dd MMMM yyyy") + " s/d " + dtTanggal2.Value.ToString("dd MMMM yyyy");
                upload.upload_download_jenis      = "Upload Absen";
                upload.upload_download_tanggal    = DateTime.Now;
                fp.upload_download.Add(upload);
                fp.SaveChanges();

                FormProsesUploadAbsensiKeWeb proses = new FormProsesUploadAbsensiKeWeb();
                proses.tgl1          = dtTanggal1.Value;
                proses.tgl2          = dtTanggal2.Value;
                proses.StartPosition = FormStartPosition.CenterParent;
                proses.ShowDialog(this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }