Esempio n. 1
0
        private void cmdKoreksi_Click(object sender, EventArgs e)
        {
            if (GVHeader.Rows.Count > 0)
            {
                DateTime _tglPengeluaran = ((DateTime)GVHeader.SelectedCells[0].OwningRow.Cells["Tanggal"].Value).AddDays(1).Date;

                if (_tglPengeluaran < DateTime.Now.Date)
                {
                    MessageBox.Show("Anda hanya diperbolehkan Koreksi Nominal data hari ini dan/atau kemarin");
                    return;
                }

                if (Double.Parse(GVHeader.SelectedCells[0].OwningRow.Cells["NominalSisa"].Value.ToString()) == 0)
                {
                    MessageBox.Show("Sisa Saldo 0");
                    return;
                }

                Guid   RowID   = (Guid)GVHeader.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                double nominal = Double.Parse(GVHeader.SelectedCells[0].OwningRow.Cells["NominalSisa"].Value.ToString());

                Keuangan.frmPenerimaanUangUpdate ifrmChild = new Keuangan.frmPenerimaanUangUpdate(this, RowID, nominal);
                ifrmChild.MdiParent = Program.MainForm;
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.Show();
            }
        }
Esempio n. 2
0
 private void cmdADD_Click(object sender, EventArgs e)
 {
     Keuangan.frmPenerimaanUangUpdate ifrmChild = new Keuangan.frmPenerimaanUangUpdate(this);
     ifrmChild.MdiParent = Program.MainForm;
     Program.MainForm.RegisterChild(ifrmChild);
     ifrmChild.Show();
 }
Esempio n. 3
0
        private void cmdEDIT_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0)
            {
                if (dataGridView1.SelectedCells[0].OwningRow.Cells["JnsTransaksi"].Value.ToString().Equals("PIUTANG LAIN LAIN"))
                {
                    return;
                }
                String KodeJnsTransaksi = dataGridView1.SelectedCells[0].OwningRow.Cells["KodeJnsTransaksi"].Value.ToString().Trim();
                if (Tools.checkLockEditDelete(KodeJnsTransaksi)) // kalau dibalikin true, berarti iya dikunci
                {
                    MessageBox.Show("Data Penerimaan ini tidak dapat diedit maupun didelete!");
                    return;
                }
                Guid JournalRowID = new Guid(Tools.isNull(dataGridView1.SelectedCells[0].OwningRow.Cells["JournalRowID"].Value, Guid.Empty).ToString());
                if (JournalRowID == null || JournalRowID == Guid.Empty)
                {
                }
                else
                {
                    MessageBox.Show("Data Penerimaan ini sudah masuk ke Jurnal!");
                    return;
                }
                try
                {
                    Guid rowID = (Guid)dataGridView1.SelectedCells[0].OwningRow.Cells["RowID"].Value;

                    using (Database db = new Database())
                    {
                        db.Commands.Add(db.CreateCommand("[usp_PenerimaanUang_ChekGiro]"));
                        db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, rowID));
                        db.Commands[0].ExecuteNonQuery();
                    }
                    Keuangan.frmPenerimaanUangUpdate ifrmChild = new Keuangan.frmPenerimaanUangUpdate(this, rowID);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                }
                catch (System.Exception ex)
                {
                    Error.LogError(ex);
                }
            }
            else
            {
                MessageBox.Show(Messages.Error.RowNotSelected);
            }
        }
Esempio n. 4
0
        private void cmdADD_Click(object sender, EventArgs e)
        {
            if (tabControl1.SelectedIndex == 2)
            {
                if (dgvHAdj.Rows.Count > 0)
                {
                    if (Double.Parse(dgvHAdj.SelectedCells[0].OwningRow.Cells["Sisa"].Value.ToString()) == 0)
                    {
                        MessageBox.Show("Sisa Iden 0");
                        return;
                    }
                    Guid     _rowIDP   = (Guid)dgvHAdj.SelectedCells[0].OwningRow.Cells["RowIDHAdj"].Value;
                    string   _notrans  = dgvHAdj.SelectedCells[0].OwningRow.Cells["NoTransHAdj"].Value.ToString();
                    string   _customer = dgvHAdj.SelectedCells[0].OwningRow.Cells["CustomerHAdj"].Value.ToString();
                    string   _sales    = dgvHAdj.SelectedCells[0].OwningRow.Cells["Sales"].Value.ToString();
                    double   _saldo    = Double.Parse(dgvHAdj.SelectedCells[0].OwningRow.Cells["NominalPiutang"].Value.ToString());
                    double   _sisa     = Double.Parse(dgvHAdj.SelectedCells[0].OwningRow.Cells["Sisa"].Value.ToString());
                    DateTime _tgltr    = (DateTime)dgvHAdj.SelectedCells[0].OwningRow.Cells["TglJual"].Value;

                    Kasir.frmAdjPiutang ifrmChild = new Kasir.frmAdjPiutang(this, _rowIDP, _notrans, _customer, _sales, _saldo, _sisa, _tgltr, 0);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                }
            }
            else
            {
                switch (dgS)
                {
                case enumSelectedGrid.Header:
                    Keuangan.frmPenerimaanUangUpdate ifrmChild = new Keuangan.frmPenerimaanUangUpdate(this, "PiutangLsgBelumIden");
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                    break;

                case enumSelectedGrid.Detail:
                    Guid RowIDHeader = (Guid)GVHeader.SelectedCells[0].OwningRow.Cells["RowID"].Value;

                    Kasir.frmPenerimaanLeasingIdentifikasiPiutang ifrmChild2 = new Kasir.frmPenerimaanLeasingIdentifikasiPiutang(this, RowIDHeader);
                    ifrmChild2.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild2);
                    ifrmChild2.Show();
                    break;
                }
            }
        }