예제 #1
0
        private void frmUangMukaSubsidiUpdate_Load(object sender, EventArgs e)
        {
            txtTglJual.Enabled       = false;
            txtTglJual.ReadOnly      = true;
            txtTglPelunasan.Enabled  = false;
            txtTglPelunasan.ReadOnly = true;

            txtTglPelunasan.DateValue = GlobalVar.GetServerDate;

            cbxBentukPembayaran.SelectedIndex = 1;
            txtNoTrans.Text     = "";
            txtNoTrans.Enabled  = false;
            txtNoTrans.ReadOnly = true;
            txtNominal.Text     = "0";
            DisabledControlBG();

            DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");

            dt2.DefaultView.Sort      = "MataUangID ASC";
            cbxMataUang.DisplayMember = "MataUangID";
            cbxMataUang.ValueMember   = "MataUangID";
            cbxMataUang.DataSource    = dt2.DefaultView;

            DataTable dt = new DataTable();

            using (Database db = new Database())
            {
                db.Commands.Add(db.CreateCommand("usp_Penjualan_LIST_for_DPSubsidi"));
                db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _PenjualanRowID));
                dt = db.Commands[0].ExecuteDataTable();
            }
            if (dt.Rows.Count > 0)
            {
                _LeasingRowID          = new Guid(Tools.isNull(dt.Rows[0]["LeasingRowID"], "").ToString());
                _PembelianRowID        = new Guid(Tools.isNull(dt.Rows[0]["PembRowID"], "").ToString());
                lblAlamat.Text         = Tools.isNull(dt.Rows[0]["AlamatLeasing"], "").ToString();
                lblKotaProv.Text       = Tools.isNull(dt.Rows[0]["KotaProv"], "").ToString();
                lblNamaLeasing.Text    = Tools.isNull(dt.Rows[0]["NamaLeasing"], "").ToString();
                lblNominalSubsidi.Text = Convert.ToDouble(Tools.isNull(dt.Rows[0]["DPSubsidi"], 0)).ToString("N2");
                lblNopol.Text          = Tools.isNull(dt.Rows[0]["NoPol"], "").ToString();
                lblNoTrans.Text        = Tools.isNull(dt.Rows[0]["NoTrans"], "").ToString();
                txtTglJual.Text        = Tools.isNull(dt.Rows[0]["TglJual"], DateTime.MaxValue).ToString();
                lblSisaSubsidi.Text    = Convert.ToDouble(Tools.isNull(dt.Rows[0]["SBDSisa"], 0)).ToString("N2");
                _SisaSBD        = Convert.ToDouble(Tools.isNull(dt.Rows[0]["SBDSisa"], 0));
                txtNominal.Text = Convert.ToDouble(Tools.isNull(dt.Rows[0]["SBDSisa"], 0)).ToString();
                txtRefund.Text  = Convert.ToDouble(Tools.isNull(dt.Rows[0]["SBDSisa"], 0)).ToString();;
                txtSelisih.Text = "0";
            }
            else
            {
                MessageBox.Show("Data tidak dapat ditemukan!");
                this.Close();
            }

            if (GlobalVar.CabangID.Contains("06"))
            {
                txtTglPelunasan.Enabled  = true;
                txtTglPelunasan.ReadOnly = false;
            }
        }
예제 #2
0
        private void frmKonsinyasiUpdate_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                DataTable dt = FillComboBox.DBGetCabang("");
                dt.DefaultView.Sort     = "NamaPanjang ASC";
                cboCabang.DisplayMember = "NamaPanjang";
                cboCabang.ValueMember   = "CabangID";
                cboCabang.DataSource    = dt.DefaultView;

                DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");
                dt2.DefaultView.Sort      = "MataUangID ASC";
                cboMataUang.DisplayMember = "MataUangID";
                cboMataUang.ValueMember   = "MataUangID";
                cboMataUang.DataSource    = dt2.DefaultView;

                if (mode == FormMode.New)
                {
                    lookUpStokMotor1.txtNopol.Text = "";
                    txtTanggal.DateValue           = GlobalVar.GetServerDate;
                    txtHarga.Text = "0";

                    DataTable dummyMU = new DataTable();
                    using (Database dbsubMU = new Database())
                    {
                        dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST"));
                        dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG"));
                        dummyMU          = dbsubMU.Commands[0].ExecuteDataTable();
                        cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString();
                    }
                }
                else
                {
                    DataTable _dt = new DataTable();
                    using (Database db = new Database())
                    {
                        db.Commands.Add(db.CreateCommand("usp_Konsinyasi_LIST"));
                        db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _rowID));
                        db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _cabangID));
                        _dt = db.Commands[0].ExecuteDataTable();
                    }
                    lblNoBukti.Text = Tools.isNull(_dt.Rows[0]["Bukti"], "").ToString();
                    _pembRowID      = (Guid)Tools.isNull(_dt.Rows[0]["PembRowID"], Guid.Empty);
                    lookUpStokMotor1.txtNopol.Text = Tools.isNull(_dt.Rows[0]["Nopol"], "").ToString();
                    txtTanggal.DateValue           = (DateTime)Tools.isNull(_dt.Rows[0]["Tanggal"], DateTime.MinValue);
                    cboMataUang.Text = Tools.isNull(_dt.Rows[0]["MataUangID"], "").ToString();
                    txtHarga.Text    = Tools.isNull(_dt.Rows[0]["Harga"], "").ToString();
                    cboCabang.Text   = Tools.isNull(_dt.Rows[0]["CabangPenerima"], "").ToString();
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #3
0
        private void InitControls()
        {
            DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");

            dt2.DefaultView.Sort              = "MataUangID ASC";
            cboMataUang.DisplayMember         = "MataUangID";
            cboMataUang.ValueMember           = "MataUangID";
            cboMataUang.DataSource            = dt2.DefaultView;
            cbxBentukPembayaran.SelectedIndex = 0;
        }
예제 #4
0
        private void frmTitipanAdjustment_Load(object sender, EventArgs e)
        {
            txtTanggal.DateValue = GlobalVar.GetServerDate;

            DataTable dt = FillComboBox.DBGetMataUang(Guid.Empty, "");

            dt.DefaultView.Sort       = "MataUangID ASC";
            cboMataUang.DisplayMember = "MataUangID";
            cboMataUang.ValueMember   = "MataUangID";
            cboMataUang.DataSource    = dt.DefaultView;

            using (Database db = new Database())
            {
                DataTable dummy = new DataTable();
                db.Commands.Add(db.CreateCommand("usp_PenerimaanTitipan_LIST_Adjustment"));
                db.Commands[0].Parameters.Add(new Parameter("@TitipanRowID", SqlDbType.UniqueIdentifier, _TitipanRowID));
                dummy = db.Commands[0].ExecuteDataTable();
                if (dummy.Rows.Count > 0)
                {
                    _CustomerRowID       = new Guid(Tools.isNull(dummy.Rows[0]["CustomerRowID"], Guid.Empty).ToString());
                    lblNama.Text         = Tools.isNull(dummy.Rows[0]["Nama"], "").ToString().Trim();
                    lblNoTrans.Text      = Tools.isNull(dummy.Rows[0]["NoTrans"], "").ToString().Trim();
                    txtNominal.Text      = Convert.ToDouble(Tools.isNull(dummy.Rows[0]["SaldoTitipan"], "").ToString()).ToString();
                    txtSaldoTitipan.Text = Convert.ToDouble(Tools.isNull(dummy.Rows[0]["SaldoTitipan"], "").ToString()).ToString();

                    txtSaldoTitipan.Enabled  = false;
                    txtSaldoTitipan.ReadOnly = true;

                    rbKorPA.Checked    = true;
                    cmdSearch.Enabled  = true;
                    txtNoAngs.Enabled  = false;
                    txtNoAngs.ReadOnly = true;
                }
                else
                {
                    MessageBox.Show("Data tidak dapat diproses!");
                    this.Close();
                    return;
                }
            }
        }
예제 #5
0
        private void frmAngsuranChange_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                DataTable dt = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_PenerimaanANG_LIST_ALL"));
                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _penjRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _cabangID));
                    dt               = db.Commands[0].ExecuteDataTable();
                    lblNama.Text     = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                    lblAlamat.Text   = Tools.isNull(dt.Rows[0]["Alamat"], "").ToString();
                    lblKelkec.Text   = Tools.isNull(dt.Rows[0]["KelKec"], "").ToString();
                    lblKotaProv.Text = Tools.isNull(dt.Rows[0]["KotaProv"], "").ToString();
                    lblTglJual.Text  = String.Format("{0:dd-MM-yyyy}", (DateTime)dt.Rows[0]["TglJual"]);
                    _tgjJual         = (DateTime)dt.Rows[0]["TglJual"];
                    lblNoFaktur.Text = Tools.isNull(dt.Rows[0]["NoFaktur"], "").ToString();
                    lblNoTrans.Text  = "K" + Numerator.NextNumber("NKJ");
                    _saldo           = Convert.ToDouble(Tools.isNull(dt.Rows[0]["Saldo"], 0));

                    DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");
                    dt2.DefaultView.Sort      = "MataUangID ASC";
                    cboMataUang.DisplayMember = "MataUangID";
                    cboMataUang.ValueMember   = "MataUangID";
                    cboMataUang.DataSource    = dt2.DefaultView;

                    this.ListPembulatan();
                    this.refresh();
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #6
0
        private void frmKonversiUpdate_Load(object sender, EventArgs e)
        {
            this.ListAngsuran();
            this.ListPembulatan();

            try
            {
                using (Database db = new Database())
                {
                    DataTable dt = new DataTable();
                    db.Commands.Add(db.CreateCommand("usp_Konversi_LIST"));
                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _penjRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _cabangID));
                    dt = db.Commands[0].ExecuteDataTable();

                    lblNama.Text         = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                    lblAlamat.Text       = Tools.isNull(dt.Rows[0]["Alamat"], "").ToString();
                    lblKelkec.Text       = Tools.isNull(dt.Rows[0]["KelKec"], "").ToString();
                    lblKotaProv.Text     = Tools.isNull(dt.Rows[0]["KotaProv"], "").ToString();
                    lblTglJual.Text      = String.Format("{0:dd-MM-yyyy}", (DateTime)dt.Rows[0]["TglJual"]);
                    lblNoFaktur.Text     = Tools.isNull(dt.Rows[0]["NoFaktur"], "").ToString();
                    lblNoTrans.Text      = Tools.isNull(dt.Rows[0]["NoTrans"], "").ToString();
                    lblJnsPenjualan.Text = Tools.isNull(dt.Rows[0]["JnsPenjualan"], "").ToString();
                    lblMerkType.Text     = Tools.isNull(dt.Rows[0]["Merk"], "").ToString() + " / " + Tools.isNull(dt.Rows[0]["Type"], "").ToString();;
                    lblHargaJadi.Text    = Tools.isNull(dt.Rows[0]["HargaJadi"], 0).ToString();
                    lblBBN.Text          = Tools.isNull(dt.Rows[0]["BBN"], "").ToString();
                    lblHargaTotal.Text   = (Convert.ToDouble(lblHargaJadi.Text) + Convert.ToDouble(lblBBN.Text)).ToString();
                    _pembRowID           = (Guid)Tools.isNull(dt.Rows[0]["PembRowID"], "");
                    _salesRowID          = (Guid)Tools.isNull(dt.Rows[0]["SalesRowID"], "");
                    _keterangan          = Tools.isNull(dt.Rows[0]["Keterangan"], "").ToString();

                    DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");
                    dt2.DefaultView.Sort      = "MataUangID ASC";
                    cboMataUang.DisplayMember = "MataUangID";
                    cboMataUang.ValueMember   = "MataUangID";
                    cboMataUang.DataSource    = dt2.DefaultView;

                    DataTable dummyMU = new DataTable();
                    using (Database dbsubMU = new Database())
                    {
                        dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST"));
                        dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG"));
                        dummyMU          = dbsubMU.Commands[0].ExecuteDataTable();
                        cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString();
                    }

                    txtTglLunas.DateValue = GlobalVar.GetServerDate;
                    txtUangMuka.Text      = Tools.isNull(dt.Rows[0]["UangMuka"], 0).ToString();
                    txtPiutangPokok.Text  = (Convert.ToDouble(lblHargaTotal.Text) - Convert.ToDouble(txtUangMuka.Text)).ToString();
                    txtPiutangBunga.Text  = "0";
                    txtJumlahPiutang.Text = (Convert.ToDouble(lblHargaTotal.Text) - Convert.ToDouble(txtUangMuka.Text)).ToString();
                    numKredit.Value       = 0;
                    txtBunga.Text         = "0.00";
                    numTgl.Value          = int.Parse(String.Format("{0:dd}", txtTglLunas.DateValue));
                    txtAwalAngs.DateValue = txtTglLunas.DateValue;
                    _tglJT = (DateTime)txtAwalAngs.DateValue;
                    txtAkhirAngs.DateValue = _tglJT.AddMonths(int.Parse(numKredit.Value.ToString()));
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
예제 #7
0
        private void frmUMBungaUpdate_Load(object sender, EventArgs e)
        {
            // txtnominal.Enabled = false; // bisa isi sendiri sekarang
            // txtUraian.Text = "";
            lookUpRekening1.Enabled        = false;
            cboTipeTransaksi.SelectedIndex = 0; // 0 itu yg Pembayaran + Potongan
            // ambil data dari database dulu
            DataTable dummy = new DataTable();

            using (Database db = new Database())
            {
                db.Commands.Add(db.CreateCommand("usp_PenerimaanUMBunga_DETAIL_LIST"));
                db.Commands[0].Parameters.Add(new Parameter("@PenjRowID", SqlDbType.UniqueIdentifier, _penjRowID));
                db.Commands[0].Parameters.Add(new Parameter("@PenerimaanUMRowID", SqlDbType.UniqueIdentifier, _penerimaanUMRowID));
                dummy = db.Commands[0].ExecuteDataTable();
            }

            if (dummy.Rows.Count > 0)
            {
                lblUMBunga.Text           = Tools.isNull(dummy.Rows[0]["Nominal"], 0).ToString();
                lblSaldoUMBunga.Text      = Convert.ToDouble(Tools.isNull(dummy.Rows[0]["SaldoUMBunga"], 0).ToString()).ToString("N2");
                lblPotonganUMBunga.Text   = Convert.ToDouble(Tools.isNull(dummy.Rows[0]["PotonganUMBunga"], 0).ToString()).ToString("N2");
                lblPembayaranUMBunga.Text = Convert.ToDouble(Tools.isNull(dummy.Rows[0]["BayarUMBunga"], 0).ToString()).ToString("N2");
                lblMataUang.Text          = Tools.isNull(dummy.Rows[0]["MataUangIDSrc"], "").ToString();
                lblNoTrans.Text           = Tools.isNull(dummy.Rows[0]["NoTrans"], "").ToString();
                lblTglTrans.Text          = Tools.isNull(dummy.Rows[0]["TanggalTransaksi"], DateTime.MinValue).ToString();
                _uraian         = Tools.isNull(dummy.Rows[0]["Uraian"], "").ToString();
                _custRowID      = (Guid)Tools.isNull(dummy.Rows[0]["CustRowID"], Guid.Empty);
                _namaCustomer   = Tools.isNull(dummy.Rows[0]["Nama"], "").ToString();
                lblNama.Text    = _namaCustomer;
                _nopol          = Tools.isNull(dummy.Rows[0]["NoPol"], "").ToString();
                lblNopol.Text   = _nopol;
                txtnominal.Text = Tools.isNull(dummy.Rows[0]["SaldoUMBunga"], 0).ToString();
            }
            else
            {
                MessageBox.Show("Data tidak dapat diambil!");
            }

            DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");

            dt2.DefaultView.Sort      = "MataUangID ASC";
            cboMataUang.DisplayMember = "MataUangID";
            cboMataUang.ValueMember   = "MataUangID";
            cboMataUang.DataSource    = dt2.DefaultView;

            DataTable dummyMU = new DataTable();

            using (Database dbsubMU = new Database())
            {
                dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST"));
                dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG"));
                dummyMU          = dbsubMU.Commands[0].ExecuteDataTable();
                cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString();
            }

            txtTanggal.DateValue = GlobalVar.GetServerDate;

            cboPembulatan.SelectedIndex = 0;
            refreshPembulatan();
        }
예제 #8
0
        private void frmPelunasanPembelianUpdate_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                DataTable dt = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_PembayaranPemb_LIST_ALL"));
                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _pembRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _cabangID));
                    dt                     = db.Commands[0].ExecuteDataTable();
                    lblNama.Text           = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                    lblAlamat.Text         = Tools.isNull(dt.Rows[0]["Alamat"], "").ToString();
                    lblKelkec.Text         = Tools.isNull(dt.Rows[0]["KelKec"], "").ToString();
                    lblKotaProv.Text       = Tools.isNull(dt.Rows[0]["KotaProv"], "").ToString();
                    lblNoFaktur.Text       = Tools.isNull(dt.Rows[0]["NoFaktur"], "").ToString();
                    lblSisaPembayaran.Text = String.Format("{0:#,##0.00}", Convert.ToDouble(Tools.isNull(dt.Rows[0]["SisaBayar"], 0)));
                    _hargaOff              = Convert.ToDouble(Tools.isNull(dt.Rows[0]["Harga"], 0));
                    _uangmuka              = Convert.ToDouble(Tools.isNull(dt.Rows[0]["UangMuka"], 0));
                    lblSisaUangMuka.Text   = String.Format("{0:#,##0.00}", Convert.ToDouble(Tools.isNull(dt.Rows[0]["UangMuka"], 0)));

                    if (GlobalVar.GetServerDateTime_RealTime.Hour > 14 && GlobalVar.CabangID.Contains("06"))
                    {
                        txtTanggal.DateValue = GlobalVar.GetServerDateTime_RealTime;
                    }
                    else
                    {
                        txtTanggal.DateValue = GlobalVar.GetServerDateTime_RealTime;
                    }

                    _nopol = Tools.isNull(dt.Rows[0]["Nopol"], "").ToString();

                    _DP       = Convert.ToDecimal(Tools.isNull(dt.Rows[0]["UangMuka"], "").ToString());
                    _Angsuran = (Convert.ToDecimal(Tools.isNull(dt.Rows[0]["SisaBayar"], 0).ToString()) - Convert.ToDecimal(Tools.isNull(dt.Rows[0]["UangMuka"], 0).ToString()));

                    DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");
                    dt2.DefaultView.Sort      = "MataUangID ASC";
                    cboMataUang.DisplayMember = "MataUangID";
                    cboMataUang.ValueMember   = "MataUangID";
                    cboMataUang.DataSource    = dt2.DefaultView;

                    _flagSource = Tools.isNull(dt.Rows[0]["FlagSource"], "ORI").ToString();
                    _potongan   = Convert.ToDouble(Tools.isNull(dt.Rows[0]["Potongan"], 0));

                    DataTable dummyMU = new DataTable();
                    using (Database dbsubMU = new Database())
                    {
                        dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST"));
                        dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG"));
                        dummyMU          = dbsubMU.Commands[0].ExecuteDataTable();
                        cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString();
                    }
                    if (GlobalVar.CabangID == "06B")
                    {
                        cbxJnsTransaksi.SelectedIndex = 1;
                    }
                    else
                    {
                        cbxJnsTransaksi.SelectedIndex = 0;
                    }
                    cbxBentukPembayaran.SelectedIndex = 0;

                    if (_flagSource == "BARU")
                    {
                        // mestinya kalau 'BARU' ini harusnya DP = 0, dan sisa piutangnya itu dikurangin Potongan untuk nentuin sisa bayarnya
                        lblSisaUangMuka.Text   = "0";
                        lblSisaPembayaran.Text = String.Format("{0:#,##0.00}", Convert.ToDouble(Tools.isNull(dt.Rows[0]["SisaBayarBARU"], 0)));
                    }
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #9
0
        private void frmPelunasanTambahUM_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                DataTable dt = new DataTable();
                if (_kodeTrans == "SBD")
                {
                    cboTipe.SelectedIndex = 0;
                }
                else if (_kodeTrans == "UMK")
                {
                    cboTipe.SelectedIndex = 1;
                }

                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_Pelunasan_LIST_TambahUM"));
                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _penjRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, GlobalVar.CabangID));
                    dt = db.Commands[0].ExecuteDataTable();

                    cboBentukPembayaran.SelectedIndex = 0;

                    if (dt.Rows.Count > 0)
                    {
                        txtTanggal.DateValue = GlobalVar.GetServerDate;

                        lblNamaCustomer.Text     = Tools.isNull(dt.Rows[0]["NamaCustomer"], "").ToString();
                        lblAlamatCustomer.Text   = Tools.isNull(dt.Rows[0]["AlamatCustomer"], "").ToString();
                        lblKotaProvCustomer.Text = Tools.isNull(dt.Rows[0]["KotaProvCustomer"], "").ToString();

                        lblNamaLeasing.Text     = Tools.isNull(dt.Rows[0]["NamaLeasing"], "").ToString();
                        lblAlamatLeasing.Text   = Tools.isNull(dt.Rows[0]["AlamatLeasing"], "").ToString();
                        lblKotaProvLeasing.Text = Tools.isNull(dt.Rows[0]["KotaProvLEasing"], "").ToString();

                        DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");
                        dt2.DefaultView.Sort      = "MataUangID ASC";
                        cboMataUang.DisplayMember = "MataUangID";
                        cboMataUang.ValueMember   = "MataUangID";
                        cboMataUang.DataSource    = dt2.DefaultView;

                        DataTable dummyMU = new DataTable();
                        using (Database dbsubMU = new Database())
                        {
                            dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST"));
                            dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG"));
                            dummyMU          = dbsubMU.Commands[0].ExecuteDataTable();
                            cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString();
                        }

                        lblNoKwitansi.Text = "";
                        //cboTipe.Text = "DP Subsidi";
                        txtHarga.Text       = Convert.ToDouble(Tools.isNull(dt.Rows[0]["HargaOff"], 0).ToString()).ToString();
                        txtUangMuka.Text    = Convert.ToDouble(Tools.isNull(dt.Rows[0]["UangMuka"], 0).ToString()).ToString();
                        txtDPSubsidi.Text   = Convert.ToDouble(Tools.isNull(dt.Rows[0]["DPSubsidi"], 0).ToString()).ToString();
                        txtDPPelanggan.Text = Convert.ToDouble(Tools.isNull(dt.Rows[0]["DPPelanggan"], 0).ToString()).ToString();

                        txtDPSubsidiTerbayar.Text   = Convert.ToDouble(Tools.isNull(dt.Rows[0]["TotalSBD"], 0).ToString()).ToString();
                        txtUMPelangganTerbayar.Text = Convert.ToDouble(Tools.isNull(dt.Rows[0]["TotalUM"], 0).ToString()).ToString();

                        txtUraian.Text = "";
                        _nopol         = Tools.isNull(dt.Rows[0]["Nopol"], "").ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #10
0
        private void frmAdministrasiUpdate_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                DataTable dt = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_PenerimaanADM_LIST_ALL"));
                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _penjRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _cabangID));
                    dt               = db.Commands[0].ExecuteDataTable();
                    lblAlamat.Text   = Tools.isNull(dt.Rows[0]["Alamat"], "").ToString();
                    lblKelkec.Text   = Tools.isNull(dt.Rows[0]["KelKec"], "").ToString();
                    lblKotaProv.Text = Tools.isNull(dt.Rows[0]["KotaProv"], "").ToString();
                    lblTglJual.Text  = String.Format("{0:dd-MM-yyyy}", (DateTime)dt.Rows[0]["TglJual"]);
                    tglJual          = (DateTime)dt.Rows[0]["TglJual"];
                    lblNoFaktur.Text = Tools.isNull(dt.Rows[0]["NoFaktur"], "").ToString();
                    lblSisaUM.Text   = String.Format("{0:#,##0.00}", Convert.ToDouble(Tools.isNull(dt.Rows[0]["Saldo"], 0)));
                    tglJTUM          = (DateTime)dt.Rows[0]["TglJTUM"];

                    lblNama.Text = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                    _nopol       = Tools.isNull(dt.Rows[0]["NoPol"], "").ToString();

                    DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, "");
                    dt2.DefaultView.Sort      = "MataUangID ASC";
                    cboMataUang.DisplayMember = "MataUangID";
                    cboMataUang.ValueMember   = "MataUangID";
                    cboMataUang.DataSource    = dt2.DefaultView;

                    DataTable dummyMU = new DataTable();
                    using (Database dbsubMU = new Database())
                    {
                        dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST"));
                        dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG"));
                        dummyMU          = dbsubMU.Commands[0].ExecuteDataTable();
                        cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString();
                    }

                    // buat nomer transaksi ngga bisa disini lagi, mesti dibuat saat udah tahu mau bentuk giro atau selain giro
                    // lblNoTrans.Text = "K" + Numerator.NextNumber("NKJ");

                    lblKodeTrans.Text     = "PENERIMAAN BIAYA ADMINISTRASI";
                    _kodeTrans            = "ADM";
                    txtTglLunas.DateValue = GlobalVar.GetServerDate;

                    txtNoBG.Text = "";

                    txtNominal.Text = Convert.ToDouble(Tools.isNull(dt.Rows[0]["Saldo"], 0)).ToString();
                    txtUraian.Text  = "";
                    txtTglBG.Text   = "";

                    cboPembulatan.SelectedIndex       = 0;
                    cbxBentukPembayaran.SelectedIndex = 0;
                    refreshPembulatan();
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }