예제 #1
0
        public void HeaderRowRefresh(Guid RowID)
        {
            DataTable dtResult = new DataTable();

            dtResult = BKM.ListHeaderperRow(RowID);
            dgHeaderBKM.RefreshDataRow(dtResult.Rows[0], "RowID", RowID.ToString());
        }
예제 #2
0
        private void tbTglCair_Leave(object sender, EventArgs e)
        {
            //cair slip
            try
            {
                string _noGiro = gridDetail.SelectedCells[0].OwningRow.Cells["Nomor"].Value.ToString();
                if (MessageBox.Show("Proses Cair Slip " + _noGiro + " ??", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    DataTable dtCekBukti = new DataTable();
                    dtCekBukti = Inden.CekRelasiInden("Bukti", "RowID", _titipID.ToString(), "", "");
                    string RecordIDBKM = _titipRecID.Substring(0, 22) + "S";
                    Guid   _GiroID     = (Guid)gridDetail.SelectedCells[0].OwningRow.Cells["GiroID"].Value;
                    string _GiroRecID  = gridDetail.SelectedCells[0].OwningRow.Cells["GiroRecID"].Value.ToString();
                    string noPerk      = Perkiraan.GetPerkiraanKoneksiDetail("BGTRM").Rows[0]["NoPerkiraan"].ToString();
                    string uraian      = "SLIP #" + _noGiro + " (" + _noVoucher + ")";
                    string jumlah      = gridDetail.SelectedCells[0].OwningRow.Cells["Nominal"].Value.ToString();
                    tglCair = (DateTime)tbTglCair.DateValue;
                    using (Database db = new Database(GlobalVar.DBName))
                    {
                        db.BeginTransaction();
                        if (dtCekBukti.Rows.Count == 0)
                        {
                            noBKM    = Numerator.BookNumerator("BKM");
                            asalGiro = gridDetail.SelectedCells[0].OwningRow.Cells["_asalgiro"].Value.ToString();
                            BKM.AddHeader(db, _titipID, _titipID, RecordIDBKM, noBKM, "K", "SLP", tglCair, asalGiro, "", "", SecurityManager.UserName, "");
                        }
                        else
                        {
                            dtBKMHeader = new DataTable();
                            dtBKMHeader = BKM.ListHeaderperRow(_titipID);
                            asalGiro    = dtBKMHeader.Rows[0]["Kepada"].ToString();
                            noBKM       = dtBKMHeader.Rows[0]["NoBukti"].ToString();
                            tglCair     = (DateTime)dtBKMHeader.Rows[0]["TglBukti"];
                        }
                        BKM.AddDetail(db, _GiroID, _titipID, _GiroRecID, RecordIDBKM, "", "", "", "", noPerk, uraian, jumlah);
                        db.CommitTransaction();
                        dtBKMDetail = new DataTable();
                        dtBKMDetail = BKM.ListDetail(db, _titipID);
                    }

                    titipGiro();
                }
                else
                {
                    jnsSlip           = "";
                    cmdTitip.Enabled  = true;
                    gbTglCair.Enabled = false;
                    gbSlip.Visible    = false;
                    gbLookup.Enabled  = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }