Exemplo n.º 1
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            DateTime _Tanggal = (DateTime)gridBBK.SelectedCells[0].OwningRow.Cells["TglBBK"].Value;

            if (PeriodeClosing.IsKasirClosed(_Tanggal))
            {
                MessageBox.Show("Sudah Closing!");
                return;
            }
            switch (selectedGrid)
            {
            case enumSelectedGrid.HeaderSelected:

                _rowIDBBK = (Guid)gridBBK.SelectedCells[0].OwningRow.Cells["RowIDBBK"].Value;
                _bankID   = gridBBK.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString();
                Kasir.frmBuktiBankKeluar ifrmChild = new Kasir.frmBuktiBankKeluar(this, _rowIDBBK, _bankID);
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.ShowDialog();
                break;

            case enumSelectedGrid.DetailSelected:
                _rowIDBBK    = (Guid)gridBBK.SelectedCells[0].OwningRow.Cells["RowIDBBK"].Value;
                _rowIDGiroIn = (Guid)gridGiroIn.SelectedCells[0].OwningRow.Cells["RowIDGiroIn"].Value;
                _GiroID      = (Guid)gridGiroIn.SelectedCells[0].OwningRow.Cells["GiroID"].Value;
                _Penerima    = gridBBK.SelectedCells[0].OwningRow.Cells["Penerima"].Value.ToString();
                _bankID      = gridBBK.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString();
                DateTime tglBBK = (DateTime)gridBBK.SelectedCells[0].OwningRow.Cells["TglBBK"].Value;
                Kasir.frmBukaGiroDetailUpdate ifrmDetail = new Kasir.frmBukaGiroDetailUpdate(this, _rowIDBBK, _rowIDGiroIn, _GiroID, _Penerima, _bankID, true, tglBBK);
                Program.MainForm.RegisterChild(ifrmDetail);
                ifrmDetail.ShowDialog();


                break;
            }
        }
Exemplo n.º 2
0
        private void cmdPencarian_Click(object sender, EventArgs e)
        {
            DateTime _Tanggal  = (DateTime)gridGiroIn.SelectedCells[0].OwningRow.Cells["TglCair"].Value;
            DateTime tglServer = GlobalVar.DateOfServer.Date;

            try
            {
                if (_Tanggal > tglServer)
                {
                    MessageBox.Show("Tanggal server tidak sama dengan tanggal transaksi. Tidak bisa hapus transaksi");
                    return;
                }
                if (!SecurityManager.IsManager())
                {
                    MessageBox.Show("Hapus hanya boleh dilakukan oleh Manager");
                    return;
                }
            }
            catch
            {
                _rowIDBBK    = (Guid)gridBBK.SelectedCells[0].OwningRow.Cells["RowIDBBK"].Value;
                _rowIDGiroIn = (Guid)gridGiroIn.SelectedCells[0].OwningRow.Cells["RowIDGiroIn"].Value;
                _GiroID      = (Guid)gridGiroIn.SelectedCells[0].OwningRow.Cells["GiroID"].Value;
                _Penerima    = gridBBK.SelectedCells[0].OwningRow.Cells["Penerima"].Value.ToString();
                _bankID      = gridBBK.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString();
                DateTime tglBBK = (DateTime)gridBBK.SelectedCells[0].OwningRow.Cells["TglBBK"].Value;
                Kasir.frmBukaGiroDetailUpdate ifrmDetail = new Kasir.frmBukaGiroDetailUpdate(this, _rowIDBBK, _rowIDGiroIn, _GiroID, _Penerima, _bankID, true, tglBBK, 1);
                Program.MainForm.RegisterChild(ifrmDetail);
                ifrmDetail.ShowDialog();
            }
        }
Exemplo n.º 3
0
        private void frmBuktiBankKeluar_KeyDown(object sender, KeyEventArgs e)
        {
            if (lblPetunjuk.Visible == true)
            {
                switch (e.KeyCode)
                {
                case Keys.Escape:

                    frmBukaGiro frm = new frmBukaGiro();
                    frm = (frmBukaGiro)this.Caller;
                    frm.RefreshBBK(_rowIDBBK);
                    frm.FindRowBBK("RowIDBBK", _rowIDBBK.ToString());


                    break;

                case Keys.Insert:

                    Kasir.frmBukaGiroDetailUpdate ifrmDetail1 = new Kasir.frmBukaGiroDetailUpdate(this, _rowIDBBK, txtKepada.Text, _BankID, false, _TglBBK);
                    Program.MainForm.RegisterChild(ifrmDetail1);
                    ifrmDetail1.ShowDialog();

                    break;

                case Keys.Space:
                    if (gridGiroIn.SelectedCells.Count == 0)
                    {
                        return;
                    }

                    _rowIDGiroIn = (Guid)gridGiroIn.SelectedCells[0].OwningRow.Cells["RowIDGiroIn"].Value;
                    _GiroID      = (Guid)gridGiroIn.SelectedCells[0].OwningRow.Cells["GiroID"].Value;
                    Kasir.frmBukaGiroDetailUpdate ifrmDetail2 = new Kasir.frmBukaGiroDetailUpdate(this, _rowIDBBK, _rowIDGiroIn, _GiroID, txtKepada.Text, _BankID, false, _TglBBK);
                    Program.MainForm.RegisterChild(ifrmDetail2);
                    ifrmDetail2.ShowDialog();

                    break;

                case Keys.Delete:
                    if (MessageBox.Show("Data Ini Akan Dihapus ?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                    {
                        return;
                    }

                    DeleteGiroInternal();

                    #region "Tambahan"
                    int i = 0;
                    int n = 0;
                    i = gridGiroIn.SelectedCells[0].RowIndex;
                    n = gridGiroIn.SelectedCells[0].ColumnIndex;
                    DataRowView dv = (DataRowView)gridGiroIn.SelectedCells[0].OwningRow.DataBoundItem;

                    DataRow dr = dv.Row;

                    dr.Delete();
                    _dtGiroIn.AcceptChanges();
                    gridGiroIn.Focus();
                    gridGiroIn.RefreshEdit();
                    if (gridGiroIn.RowCount > 0)
                    {
                        if (i == 0)
                        {
                            gridGiroIn.CurrentCell = gridGiroIn.Rows[0].Cells[n];
                            gridGiroIn.RefreshEdit();
                        }
                        else
                        {
                            gridGiroIn.CurrentCell = gridGiroIn.Rows[i - 1].Cells[n];
                            gridGiroIn.RefreshEdit();
                        }
                    }
                    #endregion

                    frmBukaGiro frm2 = new frmBukaGiro();
                    frm2 = (frmBukaGiro)this.Caller;
                    frm2.FindRowGiroIn("RowIDGiroIn", _rowIDGiroIn.ToString());
                    frm2.refreshDeleteGiroIn();


                    break;
                }
            }
        }