private void cmdAdd_Click(object sender, EventArgs e) { switch (selectedGrid) { case enumSelectedGrid.HeaderSelected: Kasir.frmBuktiTransferKeluarUpdate ifrmChild = new Kasir.frmBuktiTransferKeluarUpdate(this, string.Empty, false, string.Empty, string.Empty, string.Empty); Program.MainForm.RegisterChild(ifrmChild); ifrmChild.ShowDialog(); break; case enumSelectedGrid.DetailSelected: DateTime _Tanggal = (DateTime)gridUtm.SelectedCells[0].OwningRow.Cells["TglBBM"].Value; if (GlobalVar.Gudang != "2808") { if (PeriodeClosing.IsKasirClosed(_Tanggal)) { MessageBox.Show("Sudah Closing!"); return; } } Guid rowID = (Guid)gridUtm.SelectedCells[0].OwningRow.Cells["RowID"].Value; string bankID = gridUtm.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString(); Kasir.frmBuktiTransferKeluarDetailUpdate ifrmDetail = new Kasir.frmBuktiTransferKeluarDetailUpdate(this, string.Empty, rowID, 0, false, string.Empty, string.Empty, string.Empty, string.Empty, bankID); Program.MainForm.RegisterChild(ifrmDetail); ifrmDetail.ShowDialog(); break; } }
private void cmdEdit_Click(object sender, EventArgs e) { Guid rowID = (Guid)gridUtm.SelectedCells[0].OwningRow.Cells["RowID"].Value; DateTime _Tanggal = (DateTime)gridUtm.SelectedCells[0].OwningRow.Cells["TglBBM"].Value; if (GlobalVar.Gudang != "2808") { if (PeriodeClosing.IsKasirClosed(_Tanggal)) { MessageBox.Show("Sudah Closing!"); return; } } switch (selectedGrid) { case enumSelectedGrid.HeaderSelected: if (gridUtm.RowCount > 0) { Kasir.frmBuktiTransferKeluarUpdate ifrmChild = new Kasir.frmBuktiTransferKeluarUpdate(this, rowID, false, string.Empty, string.Empty, string.Empty, string.Empty); Program.MainForm.RegisterChild(ifrmChild); ifrmChild.ShowDialog(); } else { MessageBox.Show("Belum Ada Data", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Warning); } break; case enumSelectedGrid.DetailSelected: Guid rowIDDetail = (Guid)gridDetail.SelectedCells[0].OwningRow.Cells["RowIDDetail"].Value; if (gridDetail.RowCount > 0) { Kasir.frmBuktiTransferKeluarDetailUpdate ifrmDetail = new Kasir.frmBuktiTransferKeluarDetailUpdate(this, rowIDDetail, rowID, string.Empty, false, string.Empty, string.Empty, string.Empty); Program.MainForm.RegisterChild(ifrmDetail); ifrmDetail.ShowDialog(); } else { MessageBox.Show("Belum Ada Data", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Warning); } break; } }
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; }
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; }