Exemple #1
0
        private void FrmDetailSPD_Load(object sender, EventArgs e)
        {
            //hide label dan komponen passing data
            lblkomitmen.Visible     = false;
            lblnip_komitmen.Visible = false;

            data_.Visible     = false;
            lama.Visible      = false;
            asal.Visible      = false;
            tujuan.Visible    = false;
            total.Visible     = false;
            terbilang.Visible = false;

            Form1 _nm1 = new Form1();

            spd = DbQuery.getSpdById(id);
            foreach (var s in spd)
            {
                lblPNama.Text        = s.p_nama;
                lblKode.Text         = s.kode;
                lblNip.Text          = s.nip;
                lblMaksud.Text       = s.maksud;
                lblTB.Text           = s.tb;
                lblTransportasi.Text = s.transport;
                lblTBerangkat.Text   = s.t_berangkat;
                lblTTujuan.Text      = s.t_tujuan;
                lblTNama.Text        = s.penjabat;
                lblJabatan.Text      = s.t_jabatan;
                lblTglBerangkat.Text = s.tgl_berangkat;
                lblTglKemabali.Text  = s.tgl_kembali;
                lblLama.Text         = s.lama.ToString();
                lblNoSurat.Text      = s.no_surat;
                lblTglSurat.Text     = s.tgl_tugas;
                lblAkun.Text         = s.akun;

                tujuan.Text = s.t_tujuan;


                lblkomitmen.Text     = komitmens;
                lblnip_komitmen.Text = nipss;
            }

            biaya = DbQuery.getBiayaBydata(id);
            foreach (var b in biaya)
            {
                lblUangHarian.Text     = "Rp. " + b.h_total.ToString();
                lblPenginapan.Text     = "Rp. " + b.p_total.ToString();
                lblTransportPP.Text    = "Rp. " + b.transport_pp.ToString();
                lblTransportLokal.Text = "Rp. " + b.transport_loak.ToString();
                lblDamri.Text          = "Rp. " + b.damri.ToString();
                lblLainLain.Text       = "Rp. " + b.lain_lain.ToString();

                data_.Text = b.id.ToString();

                lama.Text  = b.h_lama.ToString() + " Hari";
                _total     = (b.h_total) + (b.p_total) + (b.transport_pp) + (b.transport_loak) + (b.damri) + (b.lain_lain);
                total.Text = " Rp." + _total.ToString("N0", CultureInfo.InvariantCulture);

                _Terbilang ter = new _Terbilang();
                terbilang.Text = ter.Terbilang(_total).TrimStart() + " RUPIAH";
            }

            pengikut = DbQuery.getPengikutByData(id);
            if (pengikut.ElementAtOrDefault(0) != null)
            {
                Pegawai p = DbQuery.GetPegawaiById(pengikut[0].pegawai);
                lblNPengikut1.Text   = p.nama;
                lblTglPengikut1.Text = pengikut[0].t_lahir;
                lblKetPengikut1.Text = pengikut[0].ket;
            }

            if (pengikut.ElementAtOrDefault(1) != null)
            {
                Pegawai p = DbQuery.GetPegawaiById(pengikut[1].pegawai);
                lblNPengikut2.Text   = p.nama;
                lblTglPengikut2.Text = pengikut[1].t_lahir;
                lblKetPengikut2.Text = pengikut[1].ket;
            }

            if (pengikut.ElementAtOrDefault(2) != null)
            {
                Pegawai p = DbQuery.GetPegawaiById(pengikut[2].pegawai);
                lblNPengikut3.Text   = p.nama;
                lblTglPengikut3.Text = pengikut[2].t_lahir;
                lblKetPengikut3.Text = pengikut[2].ket;
            }
        }