示例#1
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0)
            {
                if (dataGridViewHPP.SelectedCells.Count <= 0)
                {
                    MessageBox.Show(Messages.Error.RowNotSelected);
                    return;
                }

                DateTime TmtCek = (DateTime)dataGridViewHPP.SelectedCells[0].OwningRow.Cells[TMT.Name].Value;
                if (TmtCek != GlobalVar.DateOfServer)
                {
                    MessageBox.Show("tidak bisa edit data. Tanggal transaksi tidak sesuai dengan tanggal Server."); return;
                }
                String KodeBarang             = dataGridView1.SelectedCells[0].OwningRow.Cells[BarangID.Name].Value.ToString();
                Guid   RowID                  = new Guid(dataGridViewHPP.SelectedCells[0].OwningRow.Cells["HPPRowID"].Value.ToString());
                Master.frmHPPUpdate ifrmChild = new Master.frmHPPUpdate(this, RowID, KodeBarang);
                ifrmChild.MdiParent = Program.MainForm;
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.Show();
            }
            else
            {
                MessageBox.Show(Messages.Error.RowNotSelected);
            }
        }
示例#2
0
        private void cmdAddHPP_Click(object sender, EventArgs e)
        {
            if (dataGridDetail.Rows.Count > 0)
            {
                if (dataGridHeader.SelectedCells[0].OwningRow.Cells["TglTerima"].Value.ToString().Trim() == "")
                {
                    MessageBox.Show("Barang belum diterima");
                    return;
                }

                Double _qtyTerima = Double.Parse(dataGridDetail.SelectedCells[0].OwningRow.Cells["QtySuratJalan"].Value.ToString());

                if (_qtyTerima <= 0)
                {
                    MessageBox.Show("Qty terima harus lebih besar dari 0");
                    return;
                }
                String _barangID = dataGridDetail.SelectedCells[0].OwningRow.Cells["BarangID"].Value.ToString();
                String _harga    = dataGridDetail.SelectedCells[0].OwningRow.Cells["HrgBeli"].Value.ToString();

                Master.frmHPPUpdate ifrmChild2 = new Master.frmHPPUpdate(this, _barangID, _harga);
                //ifrmChild2.txtHargaHpp
                ifrmChild2.MdiParent = Program.MainForm;
                Program.MainForm.RegisterChild(ifrmChild2);
                ifrmChild2.Show();
            }
        }
示例#3
0
 private void cmdadd_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedCells.Count > 0)
     {
         String KodeBarang             = dataGridView1.SelectedCells[0].OwningRow.Cells[BarangID.Name].Value.ToString();
         Master.frmHPPUpdate ifrmChild = new Master.frmHPPUpdate(this, KodeBarang);
         ifrmChild.MdiParent = Program.MainForm;
         Program.MainForm.RegisterChild(ifrmChild);
         ifrmChild.Show();
     }
 }