private void btnSua_Click(object sender, EventArgs e) { try { Int32 selectedRowCount = gridDanhSachPhieuXuatTam.CurrentCell.RowIndex; DataGridViewRow SelectedRow = gridDanhSachPhieuXuatTam.Rows[selectedRowCount]; string Ma_phieu_xuat_tam = SelectedRow.Cells["Ma_phieu_xuat_tam"].Value.ToString(); bool Daduyet = bool.Parse(SelectedRow.Cells["Da_duyet"].Value.ToString()); if (Daduyet == false) { frmChiTietPhieuXuatTam ChiTietPhieuXuatTam = new frmChiTietPhieuXuatTam(Ma_phieu_xuat_tam, enumButton2.Sua,this); ChiTietPhieuXuatTam.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void lapToolStripMenuItem_Click(object sender, EventArgs e) { if (Utilities.clsThamSoUtilities.isSectionLogin == true) { frmChiTietPhieuXuatTam frm = new frmChiTietPhieuXuatTam(); frm.Name = "Xuất vật tư cho nhân viên"; foreach (Form f in this.MdiChildren) { if (f.Name == frm.Name) { f.Activate(); return; } } frm.MdiParent = this; frm.WindowState = FormWindowState.Maximized; frm.Show(); } }
private void btnBaoHoanNhap_Click(object sender, EventArgs e) { if (gridDanhSachPhieuXuatTam.RowCount == 0) { return; } Int32 selectedRowCount = gridDanhSachPhieuXuatTam.CurrentRow.Index; // CurrentCell.RowIndex; string MaPhieuXuat; if (selectedRowCount >= 0) { MaPhieuXuat = gridDanhSachPhieuXuatTam.Rows[selectedRowCount].Cells["Ma_phieu_xuat_tam"].Value.ToString(); frmChiTietPhieuXuatTam frm = new frmChiTietPhieuXuatTam(MaPhieuXuat, enumButton2.BaoHoanNhap); foreach (Form f in this.MdiChildren) { if (f.Name == frm.Name) { f.Activate(); return; } } frm.MdiParent = this.ParentForm; frm.WindowState = FormWindowState.Maximized; frm.Show(); } }
private void btnXuatVTChoNV_Click(object sender, EventArgs e) { if (gridNhanVienNoVatTu.RowCount == 0) { return; } Int32 selectedRowCount = gridNhanVienNoVatTu.CurrentRow.Index; // CurrentCell.RowIndex; int id_nv; if (selectedRowCount >= 0) { id_nv = Int32.Parse(gridNhanVienNoVatTu.Rows[selectedRowCount].Cells["ID_nhan_vien"].Value.ToString()); frmChiTietPhieuXuatTam frm = new frmChiTietPhieuXuatTam(id_nv); //frm.Text = "Xuất tạm vật tư cho nhân viên"; foreach (Form f in this.MdiChildren) { if (f.Name == frm.Name) { f.Activate(); return; } } frm.MdiParent = this.ParentForm; frm.WindowState = FormWindowState.Maximized; frm.Show(); } }