private void btnluu_Click(object sender, EventArgs e) { if (KtraTextbox()) { try { ePhieuXuatKho ePXK = new ePhieuXuatKho(); ePXK.SoPXK = txtsophieu.Text; ePXK.MaNV = txtManv.Text; ePXK.NgayLap = DateTime.Now; ePXK.MaKho = txtmakho.Text; ePXK.GhiChu = txtghichu.Text; pxBUS.taophieuxuatkho(ePXK); MessageBox.Show("Đã chuyển thành phiếu xuất Kho"); btnthem_Click(btnthem, new EventArgs()); LoadTv(); dGVchitiet.DataSource = null; btnthem_Click(btnthem, new EventArgs()); } catch (Exception ex) { MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
public int taophieuxuatkho(ePhieuXuatKho e) { if (ktranv(e.MaNV, e.MaKho)) { throw new Exception("Bạn không phải nhân viên kho này"); } PhieuXuatKho px = new PhieuXuatKho(); px.soPXK = e.SoPXK; px.manhanvien = e.MaNV; px.ngaylap = e.NgayLap; px.makho = e.MaKho; UpdateSoLuong(e.SoPXK); tinhtrang(e.SoPXK); db.PhieuXuatKhos.InsertOnSubmit(px); db.SubmitChanges(); return(1); }
public int taophieuxuatkho(ePhieuXuatKho e) { return(pxBUS.taophieuxuatkho(e)); }