Ejemplo n.º 1
0
        private void cmdYes_Click(object sender, EventArgs e)
        {
            string nip   = gridKaryawan.SelectedCells[0].OwningRow.Cells["NIP"].Value.ToString();
            string JU    = string.Empty;
            string reff  = cbRef.Text;
            string cmbJU = cbJenisUtang.Text;

            switch (cmbJU)
            {
            case "PKM":
                JU = "1";
                break;

            case "PKN":
                JU = "2";
                break;

            case "PKI":
                JU = "3";
                break;

            case "PKB":
                JU = "4";
                break;
            }



            if (formMode == enumFormMode.New)
            {
                switch (reff)
                {
                case "BKK":

                    Kasir.frmBKKUpdate ifrmChild1 = new Kasir.frmBKKUpdate(this, true, _nama, nip, JU);
                    Program.MainForm.RegisterChild(ifrmChild1);
                    ifrmChild1.ShowDialog();

                    break;

                case "BKM":
                    Kasir.frmBKMUpdate ifrmChild2 = new Kasir.frmBKMUpdate(this, true, _nama, nip, JU);
                    Program.MainForm.RegisterChild(ifrmChild2);
                    ifrmChild2.ShowDialog();
                    break;

                case "TRK":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild3 = new Kasir.frmBuktiTransferKeluarUpdate(this, _nama, true, nip, JU, reff);
                    Program.MainForm.RegisterChild(ifrmChild3);
                    ifrmChild3.ShowDialog();
                    break;

                case "TRM":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild4 = new Kasir.frmBuktiTransferKeluarUpdate(this, _nama, true, nip, JU, reff);
                    Program.MainForm.RegisterChild(ifrmChild4);
                    ifrmChild4.ShowDialog();
                    break;
                }
            }
            else if (formMode == enumFormMode.Update)
            {
                string   recordID = gridPiutang.SelectedCells[0].OwningRow.Cells["recordID"].Value.ToString();
                Guid     rowID    = (Guid)gridPiutang.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                DateTime tanggal  = (DateTime)gridPiutang.SelectedCells[0].OwningRow.Cells["tanggal"].Value;

                switch (reff)
                {
                case "BKK":

                    Kasir.frmBKKUpdate ifrmChild1 = new Kasir.frmBKKUpdate(this, rowID, recordID, _nama, txtNomor.Text, tanggal, string.Empty, JU, true, nip);
                    Program.MainForm.RegisterChild(ifrmChild1);
                    ifrmChild1.ShowDialog();
                    break;

                case "BKM":
                    Kasir.frmBKMUpdate ifrmChild2 = new Kasir.frmBKMUpdate(this, rowID, recordID, _nama, txtNomor.Text, tanggal, string.Empty, JU, true, nip);
                    Program.MainForm.RegisterChild(ifrmChild2);
                    ifrmChild2.ShowDialog();
                    break;

                case "TRK":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild3 = new Kasir.frmBuktiTransferKeluarUpdate(this, rowID, true, JU, reff, txtNomor.Text, nip);
                    Program.MainForm.RegisterChild(ifrmChild3);
                    ifrmChild3.ShowDialog();
                    break;

                case "TRM":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild4 = new Kasir.frmBuktiTransferKeluarUpdate(this, rowID, true, JU, reff, txtNomor.Text, nip);
                    Program.MainForm.RegisterChild(ifrmChild4);
                    ifrmChild4.ShowDialog();
                    break;
                }
            }



            groupTambahTransaksi.Visible = false;
        }
Ejemplo n.º 2
0
        private void cmdYes_Click(object sender, EventArgs e)
        {
            string nip    = gridKaryawan.SelectedCells[0].OwningRow.Cells["NIP"].Value.ToString();
            string JU     = string.Empty;
            string reff   = cbRef.Text;
            string cmbJU  = cbJenisUtang.Text;
            string uraian = Tools.isNull(txtUraian.Text, "").ToString();

            switch (cmbJU)
            {
            case "PKM":
                JU = "1";
                break;

            case "PKN":
                JU = "2";
                break;

            case "PKI":
                JU = "3";
                break;

            case "PKB":
                JU = "4";
                break;

            case "PKD":
                JU = "5";
                break;
            }

            if (reff == "BKK" || reff == "TRK")
            {
                if (txt_jaminan.Text.Replace(" ", "") == "")
                {
                    MessageBox.Show("Kolom jaminan belum diisi. Mohon diisi terlebih dahulu.");
                    return;
                }
            }

            //validasi jika TLS
            if (cbRef.Text == "BKK" && (cbJenisUtang.Text == "PKN" || cbJenisUtang.Text == "PKD"))
            {
                if (lookupToko1.KodeToko == "")
                {
                    MessageBox.Show("Pilih Toko!", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    lookupToko1.Focus();
                    return;
                }

                if (lookupNotaPiutang1.KPID == Guid.Empty && cbJenisUtang.Text == "PKN")
                {
                    MessageBox.Show("Pilih Nota Piutang!", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    lookupNotaPiutang1.Focus();
                    return;
                }

                if (txtKeterangan.Text == "")
                {
                    MessageBox.Show("Isi Keterangan!", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtKeterangan.Focus();
                    return;
                }

                if (txtTglJthTempo.Text == "")
                {
                    MessageBox.Show("Isi Tanggal Jatuh Tempo!", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtTglJthTempo.Focus();
                    return;
                }
                Double Debet  = Convert.ToDouble(txtDebet.Text);
                Double RpSisa = Convert.ToDouble(lookupNotaPiutang1.RpTagih);

                if (Debet > RpSisa)
                {
                    MessageBox.Show("Nominal tidak bisa diisi lebih besar dari sisa Saldo Nota");
                    txtDebet.Focus();
                    return;
                }

                RpSisa = Debet;

                Kasir.frmBKKUpdate ifrmChild1 = new Kasir.frmBKKUpdate(this, true, _nama, nip, JU, RpSisa, Convert.ToDateTime(txtTglJthTempo.DateValue), lookupNotaPiutang1.KPID, txtKeterangan.Text, txt_jaminan.Text);
                Program.MainForm.RegisterChild(ifrmChild1);
                ifrmChild1.ShowDialog();

                groupTambahTransaksi.Visible = false;
                return;
            }


            if (formMode == enumFormMode.New)
            {
                string UraianPK = Tools.isNull(txtUraian.Text, "").ToString();
                Double Kredit   = Convert.ToDouble(txtKredit.Text);
                switch (reff)
                {
                case "BKK":
                    Kasir.frmBKKUpdate ifrmChild1 = new Kasir.frmBKKUpdate(this, true, _nama, nip, JU, txt_jaminan.Text);
                    Program.MainForm.RegisterChild(ifrmChild1);
                    ifrmChild1.ShowDialog();
                    break;

                case "BKM":
                    Kasir.frmBKMUpdate ifrmChild2 = new Kasir.frmBKMUpdate(this, true, _nama, nip, JU, Kredit, UraianPK);
                    Program.MainForm.RegisterChild(ifrmChild2);
                    ifrmChild2.ShowDialog();
                    break;

                case "TRK":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild3 = new Kasir.frmBuktiTransferKeluarUpdate(this, _nama, true, nip, JU, reff);
                    Program.MainForm.RegisterChild(ifrmChild3);
                    ifrmChild3.ShowDialog();
                    break;

                case "TRM":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild4 = new Kasir.frmBuktiTransferKeluarUpdate(this, _nama, true, nip, JU, reff, Kredit, UraianPK);
                    Program.MainForm.RegisterChild(ifrmChild4);
                    ifrmChild4.ShowDialog();
                    break;
                }
            }
            else if (formMode == enumFormMode.Update)
            {
                string   recordID = gridPiutang.SelectedCells[0].OwningRow.Cells["recordID"].Value.ToString();
                Guid     rowID    = (Guid)gridPiutang.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                DateTime tanggal  = (DateTime)gridPiutang.SelectedCells[0].OwningRow.Cells["tanggal"].Value;

                switch (reff)
                {
                case "BKK":

                    Kasir.frmBKKUpdate ifrmChild1 = new Kasir.frmBKKUpdate(this, rowID, recordID, _nama, txtNomor.Text, tanggal, string.Empty, JU, true, nip);
                    Program.MainForm.RegisterChild(ifrmChild1);
                    ifrmChild1.ShowDialog();
                    break;

                case "BKM":
                    Kasir.frmBKMUpdate ifrmChild2 = new Kasir.frmBKMUpdate(this, rowID, recordID, _nama, txtNomor.Text, tanggal, string.Empty, JU, true, nip);
                    Program.MainForm.RegisterChild(ifrmChild2);
                    ifrmChild2.ShowDialog();
                    break;

                case "TRK":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild3 = new Kasir.frmBuktiTransferKeluarUpdate(this, rowID, true, JU, reff, txtNomor.Text, nip);
                    Program.MainForm.RegisterChild(ifrmChild3);
                    ifrmChild3.ShowDialog();
                    break;

                case "TRM":
                    Kasir.frmBuktiTransferKeluarUpdate ifrmChild4 = new Kasir.frmBuktiTransferKeluarUpdate(this, rowID, true, JU, reff, txtNomor.Text, nip);
                    Program.MainForm.RegisterChild(ifrmChild4);
                    ifrmChild4.ShowDialog();
                    break;
                }
            }



            groupTambahTransaksi.Visible = false;
        }