public void Update(SanXuatNhapTachInfo SanXuatNhapTachInfo) { ExecuteCommand(Declare.StoreProcedureNamespace.spSanXuatNhapTachUpdate, SanXuatNhapTachInfo.MaLenh, SanXuatNhapTachInfo.OrgCode, SanXuatNhapTachInfo.LoaiGiaoDich, SanXuatNhapTachInfo.MaThanhPham, SanXuatNhapTachInfo.SoLuongYC, SanXuatNhapTachInfo.NguoiLap, SanXuatNhapTachInfo.NgayGiaoDich, SanXuatNhapTachInfo.TransactionID); }
private void btnListNTP_Click(object sender, EventArgs e) { if (grvChiTiet.FocusedRowHandle < 0) { return; } SanXuatNhapTachInfo sx = (SanXuatNhapTachInfo)grvChiTiet.GetRow(grvChiTiet.FocusedRowHandle); frmDanhSachNhapThanhPham frm = new frmDanhSachNhapThanhPham(2, sx.MaLenh); frm.ShowDialog(); }
private void btnListNTP_Click(object sender, EventArgs e) { if (grvChiTiet.FocusedRowHandle == null) { throw new ManagedException("Xin hãy chọn dữ liệu !"); } SanXuatNhapTachInfo sx = (SanXuatNhapTachInfo)grvChiTiet.GetRow(grvChiTiet.FocusedRowHandle); frmDanhSachNhapThanhPham frm = new frmDanhSachNhapThanhPham(1, sx.MaLenh); frm.ShowDialog(); }
private void GetValue() { SanXuatNhapTachInfo sx = (SanXuatNhapTachInfo)grvChiTiet.GetRow(grvChiTiet.FocusedRowHandle); MaLenh = liChiTiet[liChiTiet.IndexOf(sx)].MaLenh; MaThanhPham = liChiTiet[liChiTiet.IndexOf(sx)].MaThanhPham; TenThanhPham = liChiTiet[liChiTiet.IndexOf(sx)].TenThanhPham; SoLuongYC = liChiTiet[liChiTiet.IndexOf(sx)].SoLuongYC; IdSanPham = liChiTiet[liChiTiet.IndexOf(sx)].idthanhpham; TrangThai = liChiTiet[liChiTiet.IndexOf(sx)].TrangThai; TransactionID = liChiTiet[liChiTiet.IndexOf(sx)].TransactionID.ToString(); NgayLap = liChiTiet[liChiTiet.IndexOf(sx)].NgayLap; SoLuongCT = SanXuatLenhProvier.GetSoLuongChungTu( Convert.ToInt32(TransactionType.XUAT_THANH_PHAM), liChiTiet[liChiTiet.IndexOf(sx)].MaLenh, 1, liChiTiet[liChiTiet.IndexOf(sx)].TransactionID.ToString()); }
private void txtMaThanhPham_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { try { ChungTuXuatNhapNccChiTietInfo li = SanXuatNhapTachDataProvider.Instance.SanXuatNhapTachCheckMaVach( Convert.ToInt32(TransactionType.XUAT_THANH_PHAM), txtMaThanhPham.Text.Trim()); if (li != null) { throw new InvalidOperationException("Bạn đã tách thành phẩm có mã vạch: " + txtMaThanhPham.Text.Trim() + " ! Xin hãy kiểm tra lại"); } if (txtMaThanhPham.Text != "") { sanXuatNhapTachInfo = SanXuatNhapTachDataProvider.Instance.SanXuatNhapTachGetByMaVach(txtMaThanhPham.Text.Trim(), txtMaLenh.Text.Trim()); if (sanXuatNhapTachInfo != null) { DMChungTuNhapInfo ct = SanXuatNhapTachDataProvider.Instance.GetChungTuNhapThanhPhamBySoChungTuGoc(sanXuatNhapTachInfo.SoChungTu); liChiTiet = SanXuatNhapTachDataProvider.Instance.SanXuatNhapTachCTGetBySoChungTu(ct.SoChungTu, Convert.ToInt32(TransactionType.XUAT_LINK_KIEN_SX)); dgvChiTiet.AutoGenerateColumns = false; dgvChiTiet.DataSource = null; dgvChiTiet.DataSource = liChiTiet; txtMaVachLK.Focus(); } else { throw new InvalidOperationException("Không tìm thấy dữ liệu phù hợp trong hệ thống"); } } } 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 GetValue() { if (grvChiTiet.FocusedRowHandle == null) { throw new ManagedException("Xin hãy chọn dữ liệu !"); } SanXuatNhapTachInfo sx = (SanXuatNhapTachInfo)grvChiTiet.GetRow(grvChiTiet.FocusedRowHandle); MaLenh = liChiTiet[liChiTiet.IndexOf(sx)].MaLenh; MaThanhPham = liChiTiet[liChiTiet.IndexOf(sx)].MaThanhPham; TenThanhPham = liChiTiet[liChiTiet.IndexOf(sx)].TenThanhPham; SoLuongYC = liChiTiet[liChiTiet.IndexOf(sx)].SoLuongYC; idThanhPham = liChiTiet[liChiTiet.IndexOf(sx)].idthanhpham; TrangThai = liChiTiet[liChiTiet.IndexOf(sx)].TrangThai; TransactionID = liChiTiet[liChiTiet.IndexOf(sx)].TransactionID.ToString(); NgayLap = liChiTiet[liChiTiet.IndexOf(sx)].NgayLap; SoLuongCT = SanXuatLenhProvier.GetSoLuongXacNhanNhap( Convert.ToInt32(TransactionType.NHAP_THANH_PHAM_SX), liChiTiet[liChiTiet.IndexOf(sx)].MaLenh, 1, liChiTiet[liChiTiet.IndexOf(sx)].TransactionID.ToString()) + SanXuatLenhProvier.GetSoLuongXacNhanNhap( Convert.ToInt32(TransactionType.NHAP_THANH_PHAM_SX), liChiTiet[liChiTiet.IndexOf(sx)].MaLenh, 2, liChiTiet[liChiTiet.IndexOf(sx)].TransactionID.ToString()); }
private void txtMaThanhPham_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { try { if (txtMaThanhPham.Text != "") { lst = SanXuatNhapTachDataProvider.Instance.SanXuatNhapTachGetByMaVach(txtMaThanhPham.Text.Trim(), txtMaLenh.Text.Trim()); if (lst != null) { if (lst.TrangThai != 2) { DMChungTuNhapInfo ct = SanXuatNhapTachDataProvider.Instance.GetChungTuNhapThanhPhamBySoChungTuGoc(lst.SoChungTu); if (ct != null) { liChiTiet = SanXuatNhapTachDataProvider.Instance.SanXuatNhapTachCTGetBySoChungTu(ct.SoChungTu, Convert.ToInt32(TransactionType.XUAT_LINK_KIEN_SX)); dgvChiTiet.AutoGenerateColumns = false; dgvChiTiet.DataSource = null; dgvChiTiet.DataSource = liChiTiet; } else { txtMaThanhPham.Text = ""; txtMaThanhPham.Focus(); throw new ManagedException("Không tìm thấy dữ liệu phù hợp trong hệ thống"); } } else { txtMaThanhPham.Text = ""; txtMaThanhPham.Focus(); throw new ManagedException("Bạn đã xác nhận nhập cho mã vạch này rồi ! Xin hãy kiểm tra lại"); } } else { txtMaThanhPham.Text = ""; txtMaThanhPham.Focus(); throw new ManagedException("Không tìm thấy dữ liệu phù hợp trong hệ thống"); } } } catch (ManagedException 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 } 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); } } }
public void Update(SanXuatNhapTachInfo chungTu) { XacNhanNhapThanhPhanDAO.Instance.Update(chungTu); }
public void Insert(SanXuatNhapTachInfo chungTu) { XacNhanNhapThanhPhanDAO.Instance.Insert(chungTu); }