private void ThemDanhThiep() { var thongTinBanDau = new ThongTinBanDauChoDanhThiep { IdHangKhachHang = this.IdHangKhachHang(), TinhTrangForm = FormStateS.New }; BaiInDanhThiep baiInDThiep = new BaiInDanhThiep(0, "", "9 x 5.5cm", 5, 2); baiInDThiep.TieuDe = "Danh thiếp"; var frm = new GiaInDanhThiepForm(thongTinBanDau, baiInDThiep); frm.Text = "Tính giá danh thiếp"; frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); if (frm.DialogResult == System.Windows.Forms.DialogResult.OK) { XuLyNutOKTrenFormDanhThiep(frm); //MessageBox.Show(this.BaiInS.Count().ToString()); LoadDanhThiepListView(); } }
public GiaInDanhThiepForm(ThongTinBanDauChoDanhThiep thongTinBanDau, BaiInDanhThiep baiInDThiep, int idBaiInDanhthiep = 0) { InitializeComponent(); this.IdHangKH = thongTinBanDau.IdHangKhachHang; this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.ID = idBaiInDanhthiep; giaDanhThiepPres = new GiaDanhThiepPresenter(this, baiInDThiep); txtHangKhachHang.Text = thongTinBanDau.TenHangKhachHang; LoadDanhSachBangGia(); cboBangGia.SelectedIndex = -1; cboBangGia.SelectedIndex = 0; //envents txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator); txtSoLuong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtTieuDe.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLuong.Leave += new EventHandler(TextBoxes_Leave); txtTieuDe.Leave += new EventHandler(TextBoxes_Leave); lblTienIn.TextChanged += new EventHandler(TextBoxes_TextChanged); lblTienGiay.TextChanged += new EventHandler(TextBoxes_TextChanged); lblThanhTien.TextChanged += new EventHandler(TextBoxes_TextChanged); }
public GiaDanhThiepPresenter(IViewGiaDanhThiep view, BaiInDanhThiep baiInDThiep) { View = view; this.MucBaiInDThiep = baiInDThiep; View.ID = this.MucBaiInDThiep.ID; View.TieuDe = this.MucBaiInDThiep.TieuDe; View.IdBangGiaChon = this.MucBaiInDThiep.IdBangGia; View.SoLuong = this.MucBaiInDThiep.SoLuongHop; View.GiayDeInChon = this.MucBaiInDThiep.ChonGiayIn; //Gắn tùy chọ if (this.MucBaiInDThiep.TuyChonSChon.TuyChonS.Count > 0) { foreach (GiaTuyChonDanhThiep tChon in this.MucBaiInDThiep.TuyChonSChon.TuyChonS) { View.IdGiaTuyChonChonS.Add(tChon.IdTuyChonDanhThiep); } } }
/* public void Sua_DanhThiep(KetQuaBaiIn baiIn) * { * var baiInSua = this.DanhSachBaiIn.Find(x => x.ID == baiIn.ID); * baiInSua.TieuDe = baiIn.TieuDe; * baiInSua.DienGiai = baiIn.DienGiai; * baiInSua.SoLuong = baiIn.SoLuong; * baiInSua.DonVi = baiIn.DonVi; * baiInSua.IdHangKH = baiIn.IdHangKH; * baiInSua.TenHangKH = baiIn.TenHangKH; * baiInSua.GiayDeInIn = baiIn.GiayDeInIn; * baiInSua.CauHinhSP = baiIn.CauHinhSP; * baiInSua.GiaInS = baiIn.GiaInS; * baiInSua.ThanhPhamS = baiIn.ThanhPhamS; * }*/ public void Xoa_DanhThiep(BaiInDanhThiep baiIn) { TinhGia.XoaDanhThiep(baiIn); }
public void Them_DanhThiep(BaiInDanhThiep baiIn) { TinhGia.ThemDanhThiep(baiIn); }