private void grvDanhSach_DoubleClick(object sender, EventArgs e) { try { if (grvDanhSach.FocusedRowHandle < 0) { return; } ChungTuXuatTieuHaoInfornew item = (ChungTuXuatTieuHaoInfornew)grvDanhSach.GetFocusedRow(); if (item == null) { return; } frm_PhieuNhapTieuHao frm = new frm_PhieuNhapTieuHao(item.IdChungTu, item.SoChungTu, item.NgayXuatHang.ToString(), item.SoChungTuGoc, item.IdChungTuGoc, item.TrangThai, item.HoTen, item.TenTrungTam, item.TenKho, item.NguoiXuat, item.GhiChu, item.IdNhanVienGiao, item.NgayLap.ToString(), item.IdKho); if (frm.ShowDialog() == DialogResult.OK) { liDM = NhapTieuHaoProvider.GetListXuatTieuHao(); grcDanhSach.DataSource = liDM; } } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.ToString(), Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show(ex.Message, Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #endif EventLogProvider.Instance.WriteLog(ex.ToString() + "\nUser: "******"\nKho: " + Declare.IdKho, this.Name); } }
private void frm_DanhSachPhieuNhapTieuHao_Load(object sender, EventArgs e) { liDM = NhapTieuHaoProvider.GetListXuatTieuHao(); grcDanhSach.DataSource = liDM; btnMoPhieu.Enabled = true; btnMoPhieu.Text = Resources.btnInfor; btnDong.Text = Resources.btnClose; LoadTrangThai(); }
private void btnMoPhieu_Click(object sender, EventArgs e) { if (grvDanhSach.FocusedRowHandle < 0) { return; } ChungTuXuatTieuHaoInfornew item = (ChungTuXuatTieuHaoInfornew)grvDanhSach.GetFocusedRow(); frm_PhieuNhapTieuHao frm = new frm_PhieuNhapTieuHao(item.IdChungTu, item.SoChungTu, item.NgayXuatHang.ToString(), item.SoChungTuGoc, item.IdChungTuGoc, item.TrangThai, item.HoTen, item.TenTrungTam, item.TenKho, item.NguoiXuat, item.GhiChu, item.IdNhanVienGiao, item.NgayLap.ToString(), item.IdKho); if (frm.ShowDialog() == DialogResult.OK) { liDM = NhapTieuHaoProvider.GetListXuatTieuHao(); grcDanhSach.DataSource = liDM; } }