コード例 #1
0
        private void lookupBank1_SelectData(object sender, EventArgs e)
        {
            try
            {
                if (lookupBank1.BankID == "" || lookupBank1.BankID == "[CODE]")
                {
                    MessageBox.Show("Bank Harus Diisi");
                    lookupBank1.Focus();
                    return;
                }

                if (txtKepada.Text == "")
                {
                    MessageBox.Show("Kepada Harus Diisi");
                    txtKepada.Focus();
                    return;
                }

                DateTime _Tanggal = DateTime.Now.Date;
                if (PeriodeClosing.IsKasirClosed(_Tanggal))
                {
                    MessageBox.Show("Sudah Closing!");
                    return;
                }
                if (MessageBox.Show("Data Sudah Benar ?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                {
                    return;
                }

                frmBukaGiro frm = new frmBukaGiro();
                frm = (frmBukaGiro)this.Caller;
                if (formMode == enumFormMode.New)
                {
                    AddBuktiBankKeluar();
                    frm.RefreshBBK(_rowIDBBK);
                    frm.FindRowBBK("RowIDBBK", _rowIDBBK.ToString());
                    RefreshGiroInternalOnDetail();
                }
                else
                {
                    UpdateBuktiBankKeluar();
                    frm.RefreshBBK(_rowIDBBK);
                }

                lblPetunjuk.Visible = true;
                gridGiroIn.Focus();
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
コード例 #2
0
        public void RefreshGiroInternalOnDetail(Guid RowID)
        {
            DataTable dtRefresh = new DataTable();

            using (Database db = new Database(GlobalVar.DBName))
            {
                db.Commands.Add(db.CreateCommand("usp_GiroInternal_LIST_ByRowID"));
                db.Commands[0].Parameters.Add(new Parameter("@RowIDGiroIn", SqlDbType.UniqueIdentifier, RowID));
                dtRefresh = db.Commands[0].ExecuteDataTable();
            }
            gridGiroIn.RefreshDataRow(dtRefresh.Rows[0], "RowIDGiroIn", RowID.ToString());

            frmBukaGiro frm = new frmBukaGiro();

            frm = (frmBukaGiro)this.Caller;
            frm.RefreshBBK(_rowIDBBK);
            frm.RefreshGiroInternal(RowID);
            frm.FindRowGiroIn("RowIDGiroIn", RowID.ToString());
        }
コード例 #3
0
 private void frmBukaGiroDetailUpdate_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (_rowIDGiroIn != Guid.Empty)
     {
         if (_isFromBrowse == true)
         {
             frmBukaGiro frm = new frmBukaGiro();
             frm = (frmBukaGiro)this.Caller;
             frm.RefreshBBK(_rowIDBBK);
             frm.RefreshGiroInternal(_rowIDGiroIn);
             frm.FindRowGiroIn("RowIDGiroIn", _rowIDGiroIn.ToString());
         }
         else if (_isFromBrowse == false)
         {
             frmBuktiBankKeluar frm = new frmBuktiBankKeluar();
             frm = (frmBuktiBankKeluar)this.Caller;
             frm.RefreshGiroInternalOnDetail(_rowIDGiroIn);
             frm.FindRowGiroInternalOnDetail("RowIDGiroIn", _rowIDGiroIn.ToString());
         }
     }
 }
コード例 #4
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;
                }
            }
        }