Exemplo n.º 1
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (selectMode == enumSelectMode.Header)
            {
                if (gridHeader.SelectedCells.Count > 0)
                {
                    DateTime _Tanggal = (DateTime)gridHeader.SelectedCells[0].OwningRow.Cells["hdrTglVoucher"].Value;
                    if (GlobalVar.Gudang != "2808")
                    {
                        if (PeriodeClosing.IsKasirClosed(_Tanggal))
                        {
                            MessageBox.Show("Sudah Closing!");
                            return;
                        }
                    }

                    Guid      titipID = (Guid)gridHeader.SelectedCells[0].OwningRow.Cells["hdrRowID"].Value;
                    DataTable dtEdit  = new DataTable();
                    dtEdit = dtHeader.Copy();
                    dtEdit.DefaultView.RowFilter = "RowID='" + titipID + "'";
                    DataView dv = dtEdit.DefaultView;
                    dtEdit = new DataTable();
                    dtEdit = dv.ToTable();
                    frmVoucherGiroTitipUpdate frm = new frmVoucherGiroTitipUpdate(this, dtEdit);
                    frm.ShowDialog();
                }
            }
        }
Exemplo n.º 2
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            if (selectMode == enumSelectMode.Header)
            {
                frmVoucherGiroTitipUpdate frm = new frmVoucherGiroTitipUpdate(this);
                frm.ShowDialog();
            }
            else
            {
                if (gridHeader.SelectedCells.Count > 0)
                {
                    DateTime _Tanggal = (DateTime)gridHeader.SelectedCells[0].OwningRow.Cells["hdrTglVoucher"].Value;
                    if (GlobalVar.Gudang != "2808")
                    {
                        if (PeriodeClosing.IsKasirClosed(_Tanggal))
                        {
                            MessageBox.Show("Sudah Closing!");
                            return;
                        }
                    }

                    string bankID, namaBank, titipRecID, noVoucher, mengetahui;
                    Guid   titipID = (Guid)gridHeader.SelectedCells[0].OwningRow.Cells["hdrRowID"].Value;
                    bankID     = gridHeader.SelectedCells[0].OwningRow.Cells["hdrBankID"].Value.ToString();
                    namaBank   = gridHeader.SelectedCells[0].OwningRow.Cells["hdrNamaBank"].Value.ToString();
                    titipRecID = gridHeader.SelectedCells[0].OwningRow.Cells["RecordID"].Value.ToString();
                    noVoucher  = gridHeader.SelectedCells[0].OwningRow.Cells["hdrNoVoucher"].Value.ToString();
                    mengetahui = gridHeader.SelectedCells[0].OwningRow.Cells["hdrMengetahui"].Value.ToString();
                    frmLookupVoucherGiroTitipUpdate frm = new frmLookupVoucherGiroTitipUpdate(this, titipID, titipRecID, bankID, namaBank, noVoucher, mengetahui);
                    frm.ShowDialog();
                    //HeaderRowRefresh(titipID);
                }
            }
        }