Exemplo n.º 1
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            label2.Text = "EDIT DATA TRANSAKSI";

            switch (selectedGrid)
            {
            case enumSelectedGrid.HeaderSelected:

                _nip = gridKaryawan.SelectedCells[0].OwningRow.Cells["NIP"].Value.ToString();
                Kasir.frmPiutangKaryawanHeader_Update ifrmChild1 = new Kasir.frmPiutangKaryawanHeader_Update(this, _nip);
                Program.MainForm.RegisterChild(ifrmChild1);
                ifrmChild1.ShowDialog();

                break;

            case enumSelectedGrid.DetailSelected:

                if (gridPiutang.SelectedCells.Count > 0 && gridKaryawan.SelectedCells.Count > 0)
                {
                    DateTime _Tanggal = (DateTime)gridPiutang.SelectedCells[0].OwningRow.Cells["tanggal"].Value;
                    if (GlobalVar.Gudang != "2808")
                    {
                        if (PeriodeClosing.IsKasirClosed(_Tanggal))
                        {
                            MessageBox.Show("Sudah Closing!");
                            return;
                        }
                    }

                    _nama       = gridKaryawan.SelectedCells[0].OwningRow.Cells["namapegawai"].Value.ToString();
                    _tanggal    = ((DateTime)gridPiutang.SelectedCells[0].OwningRow.Cells["tanggal"].Value).ToString("dd-MM-yyyy");
                    _reff       = gridPiutang.SelectedCells[0].OwningRow.Cells["reff"].Value.ToString();
                    _jenisUtang = gridPiutang.SelectedCells[0].OwningRow.Cells["jenis"].Value.ToString();
                    _nomor      = gridPiutang.SelectedCells[0].OwningRow.Cells["noref"].Value.ToString();
                    _uraian     = gridPiutang.SelectedCells[0].OwningRow.Cells["uraian"].Value.ToString();
                    //_jaminan = gridPiutang.SelectedCells[0].OwningRow.Cells["KeteranganJaminan"].Value.ToString();
                    _debet  = gridPiutang.SelectedCells[0].OwningRow.Cells["debet"].Value.ToString();
                    _kredit = gridPiutang.SelectedCells[0].OwningRow.Cells["kredit"].Value.ToString();

                    txtTanggal.Text              = _tanggal;
                    cbRef.Text                   = _reff;
                    cbRef.Enabled                = false;
                    cbJenisUtang.Text            = _jenisUtang;
                    txtNomor.Text                = _nomor;
                    txtUraian.Text               = _uraian;
                    txtDebet.Text                = _debet;
                    txtKredit.Text               = _kredit;
                    txt_jaminan.Text             = _jaminan;
                    formMode                     = enumFormMode.Update;
                    groupTambahTransaksi.Visible = true;
                }
                else
                {
                    MessageBox.Show("Belum Ada Data");
                }

                break;
            }
        }
Exemplo n.º 2
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            label2.Text = "TAMBAH DATA TRANSAKSI";



            switch (selectedGrid)
            {
            case enumSelectedGrid.HeaderSelected:
                Kasir.frmPiutangKaryawanHeader_Update ifrmChild1 = new Kasir.frmPiutangKaryawanHeader_Update(this);
                Program.MainForm.RegisterChild(ifrmChild1);
                ifrmChild1.ShowDialog();
                break;

            case enumSelectedGrid.DetailSelected:

                if (gridKaryawan.SelectedCells.Count > 0)
                {
                    _nama           = gridKaryawan.SelectedCells[0].OwningRow.Cells["namapegawai"].Value.ToString();
                    txtTanggal.Text = DateTime.Now.Day.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Year.ToString();

                    formMode          = enumFormMode.New;
                    cbJenisUtang.Text = string.Empty;
                    cbRef.Text        = string.Empty;
                    txtDebet.Text     = "0";
                    txtKredit.Text    = "0";
                    txt_jaminan.Text  = "";
                    txtNomor.Text     = string.Empty;
                    txtUraian.Text    = string.Empty;
                    cbRef.Enabled     = true;
                    DisabledBehind();
                    groupTambahTransaksi.Top     = 100;
                    groupTambahTransaksi.Left    = 200;
                    groupTambahTransaksi.Visible = true;

                    lookupToko1.KodeToko      = "";
                    lookupToko1.NamaToko      = "";
                    lookupNotaPiutang1.NoNota = "";
                    lookupNotaPiutang1.KPID   = Guid.Empty;
                    txtKeterangan.Text        = "";
                    txtTglJthTempo.Text       = "";
                    txtTglNota.Text           = "";
                }
                else
                {
                    MessageBox.Show("BELUM ADA DATA");
                }


                break;
            }
        }