private void cmdEdit_Click(object sender, EventArgs e) { if (customGridView2.SelectedCells.Count <= 0) { MessageBox.Show("Tidak Ada Data Yang dipilih"); return; } if ((DateTime)customGridView2.SelectedCells[0].OwningRow.Cells["TglOpname"].Value < GlobalVar.DateOfServer) { MessageBox.Show("Tanggal Opname Kurang dari Date time Server : " + GlobalVar.DateOfServer.ToString()); return; } if (customGridView2.SelectedCells.Count > 0) { string kodeBarang = customGridView1.SelectedCells[0].OwningRow.Cells["BarangID"].Value.ToString(); string sat = customGridView1.SelectedCells[0].OwningRow.Cells["SatJual"].Value.ToString(); Guid rowID = (Guid)customGridView2.SelectedCells[0].OwningRow.Cells["RowID"].Value; DateTime tglOpname = (DateTime)customGridView2.SelectedCells[0].OwningRow.Cells["TglOpname"].Value; int qtyOpname = Convert.ToInt32(customGridView2.SelectedCells[0].OwningRow.Cells["QtyOpname"].Value); string keterangan = customGridView2.SelectedCells[0].OwningRow.Cells["Keterangan"].Value.ToString(); string Penghitung = customGridView2.SelectedCells[0].OwningRow.Cells["StaffPenghitungID"].Value.ToString(); Master.frmStokOpnameHarian ifrmChild = new Master.frmStokOpnameHarian(this, rowID, kodeBarang, sat, tglOpname, qtyOpname, keterangan, Penghitung); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); } }
private void cmdAdd_Click(object sender, EventArgs e) { if (customGridView1.SelectedCells.Count > 0) { string kodeBarang = customGridView1.SelectedCells[0].OwningRow.Cells["BarangID"].Value.ToString(); string NamaBarang = customGridView1.SelectedCells[0].OwningRow.Cells["NamaStok"].Value.ToString(); string sat = customGridView1.SelectedCells[0].OwningRow.Cells["SatJual"].Value.ToString(); Master.frmStokOpnameHarian ifrmChild = new Master.frmStokOpnameHarian(this, kodeBarang, sat, NamaBarang); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); } }
private void cmdEdit_Click(object sender, EventArgs e) { if (GlobalVar.Gudang.Substring(0, 2) == "28") { if (!lUserAccess()) { MessageBox.Show("Belum ada wewenang."); return; } } if (customGridView2.SelectedCells.Count > 0) { bool isAllowIED; if (GlobalVar.Gudang.Substring(0, 2) == "28") { isAllowIED = CekFlagOpnameMutasi(); } else { isAllowIED = true; } if (isAllowIED) { string kodeBarang = customGridView1.SelectedCells[0].OwningRow.Cells["BarangID"].Value.ToString(); string sat = customGridView1.SelectedCells[0].OwningRow.Cells["SatJual"].Value.ToString(); Guid rowID = (Guid)customGridView2.SelectedCells[0].OwningRow.Cells["RowID"].Value; DateTime tglOpname = (DateTime)customGridView2.SelectedCells[0].OwningRow.Cells["TglOpname"].Value; int qtyOpname = Convert.ToInt32(customGridView2.SelectedCells[0].OwningRow.Cells["QtyOpname"].Value); string keterangan = customGridView2.SelectedCells[0].OwningRow.Cells["Keterangan"].Value.ToString();; Master.frmStokOpnameHarian ifrmChild = new Master.frmStokOpnameHarian(this, rowID, kodeBarang, sat, tglOpname, qtyOpname, keterangan); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); } else { MessageBox.Show("Silahkan Ijin ke HO untuk melakukan Sampling Opname"); } } }
private void cmdAdd_Click(object sender, EventArgs e) { if (GlobalVar.Gudang.Substring(0, 2) == "28") { if (!lUserAccess()) { MessageBox.Show("Belum ada wewenang."); return; } } if (customGridView1.SelectedCells.Count > 0) { bool isAllowIED; if (GlobalVar.Gudang.Substring(0, 2) == "28") { isAllowIED = CekFlagOpnameMutasi(); } else { isAllowIED = true; } if (isAllowIED) { string kodeBarang = customGridView1.SelectedCells[0].OwningRow.Cells["BarangID"].Value.ToString(); string sat = customGridView1.SelectedCells[0].OwningRow.Cells["SatJual"].Value.ToString(); Master.frmStokOpnameHarian ifrmChild = new Master.frmStokOpnameHarian(this, kodeBarang, sat); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); } else { MessageBox.Show("Silahkan Ijin ke HO untuk melakukan Sampling Opname"); } } }