private void EditValue(int rowhandle) { if (rowhandle < 0) { return; } NhapHangTraMuaInfor item = (NhapHangTraMuaInfor)grvDanhSach.GetRow(rowhandle); if (item != null) { if (item.LoaiChungTu == (int)TransactionType.NHAPTRAHANGMUA) { frmChiTietYeuCauNhapLaiHangMua frm = new frmChiTietYeuCauNhapLaiHangMua(item); if (frm.ShowDialog() == DialogResult.OK) { LoadDataSource(); } } else if (item.LoaiChungTu == (int)TransactionType.DON_HANG_NHAP_LAI && nguoiDung.SupperUser == 1) { frmChiTietYeuCauNhapLaiKhac frm = new frmChiTietYeuCauNhapLaiKhac(item); if (frm.ShowDialog() == DialogResult.OK) { LoadDataSource(); } } } }
private void EditValue(int rowhandle) { if (rowhandle < 0) { return; } NhapHangTraMuaInfor item = (NhapHangTraMuaInfor)grvDanhSach.GetRow(rowhandle); if (item.LoaiChungTu == (int)TransactionType.NHAPTRAHANGMUA) { frmChiTietXacNhapHangTraLai frm = new frmChiTietXacNhapHangTraLai(item); if (frm.ShowDialog() == DialogResult.OK) { LoadDataSource(); } } else { if (nguoiDung.SupperUser == 1 || nguoiDung.SuaChungTu == 1) { frmChiTietXacNhapLaiKhac frm = new frmChiTietXacNhapLaiKhac(item); if (frm.ShowDialog() == DialogResult.OK) { LoadDataSource(); } } else { MessageBox.Show("Bạn không có quyền thực hiện xác nhận đơn hàng này"); } } }
private void Save(int rowhandle) { if (rowhandle < 0) { return; } SelectItem = (NhapHangTraMuaInfor)grvDanhSach.GetRow(rowhandle); this.DialogResult = DialogResult.OK; this.Close(); }
private void EditValue(int rowhandle) { if (rowhandle < 0) { return; } NhapHangTraMuaInfor item = (NhapHangTraMuaInfor)grvDanhSach.GetRow(rowhandle); frmBH_LapPhieuChi frm = new frmBH_LapPhieuChi(item); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { LoadDataSource(); } }
private void btnSearchPhieuNhap_Click(object sender, EventArgs e) { try { if (Updating) { if (MessageBox.Show("Dữ liệu đang cập nhật, bạn có muốn hủy bỏ không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.No) { return; } } NhapHangTraMuaInfor ct = NhapTraHangMuaDataProvider.Instance.SearchChungTuBanHangByPN(txtSoPhieuNhap.Text.Trim().ToUpper(), (int)TransactionType.NHAPTRAHANGMUA); if (ct != null) { Business = new DeNghiNhapLaiHangBussiness(ct); LoadChungTuInstance(); Updating = false; setEDItems(); setEDFunctions(); } else { MessageBox.Show("Không tìm thấy chứng từ thích hợp!"); txtSoPhieuNhap.Text = Business.ChungTu.SoChungTu; } } catch (Exception ex) { EventLogProvider.Instance.WriteLog(ex.ToString() + "\nUser: "******"\nMay: " + Declare.TenMay, this.Name); #if DEBUG MessageBox.Show("Lỗi thao tác\n" + ex.ToString(), Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show("Lỗi thao tác", Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #endif } }
private void Delete(int rowhandle) { if (rowhandle < 0) { return; } NhapHangTraMuaInfor item = (NhapHangTraMuaInfor)grvDanhSach.GetRow(rowhandle); if (item.Draft == 0) { throw new InvalidOperationException("Phiếu này đã được xác nhận , không thể xóa!"); } DNNhapTraHangMuaBussiness banHangKTBusiness = new DNNhapTraHangMuaBussiness(new ChungTuBanHangInfor { IdChungTu = item.IdChungTu, NgayLap = item.NgayLap, SoChungTu = item.SoChungTu, IdKho = item.IdKho }); banHangKTBusiness.DeleteChungTu(); LoadDataSource(); }
private void btnTimOrderKH_Click(object sender, EventArgs e) { try { if (Updating) { if (MessageBox.Show("Dữ liệu đang cập nhật, bạn có muốn hủy bỏ không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.No) { return; } } NhapHangTraMuaInfor ctu = NhapTraHangMuaDataProvider.Instance.SearchChungTuBanHangByPN(txtSoOrderKH.Text.Trim(), (int)TransactionType.NHAPTRAHANGMUA); if (ctu != null) { Business = new NhapTraHangMuaBussiness(ctu); LoadChungTuInstance(); Updating = false; setEDItems(); setEDFunctions(); } else { MessageBox.Show("Không tìm thấy chứng từ thích hợp!"); txtSoOrderKH.Text = Business.ChungTu.SoChungTu; } } catch (Exception ex) { #if DEBUG MessageBox.Show("Lỗi thao tác\n" + ex.ToString(), Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show("Lỗi thao tác", Declare.titleError, MessageBoxButtons.OK, MessageBoxIcon.Error); #endif } }
public frmChiTietYeuCauNhapLaiKhac(NhapHangTraMuaInfor ctu) { InitializeComponent(); Common.LoadStyle(this); this.Business = new DeNghiNhapLaiHangBussiness(ctu); }
public frmChiTietXacNhapLaiKhac(NhapHangTraMuaInfor ctu) { InitializeComponent(); Common.LoadStyle(this); this.Business = new XacNhanNhapLaiKhacBussiness(ctu); }
public frmBH_LapPhieuChi(NhapHangTraMuaInfor ctu) { InitializeComponent(); Common.LoadStyle(this); this.Business = new NhapTraHangMuaBussiness(ctu); }
public frmChiTietXacNhapHangTraLai(NhapHangTraMuaInfor ctu) { InitializeComponent(); Common.LoadStyle(this); this.Business = new NhapTraHangMuaBussiness(ctu); }