public GiayInDanhThiepForm(ThongTinBanDauChoGiayInDanhThiep thongTinBanDau, GiayDeIn giayDeIn) { InitializeComponent(); this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.ThongTinBaiIn_CauHinh = thongTinBanDau.ThongTinCanThiet; this.SoLuongHop = thongTinBanDau.SoLuongSanPham; this.SoDanhThiepTrenHop = thongTinBanDau.SoDanhThiepTrenHop; this.IdHangKH = thongTinBanDau.IdHangKhachHang; this.PhuongPhapIn = thongTinBanDau.PhuongPhapIn; this.KichThuocDanhThiep = thongTinBanDau.KichThuocSanPham; /*if (thongTinBanDau.LaInDanhThiep) //bắt nút tính số con * btnTinhSoConTrenToChay.Enabled = false; * else * btnTinhSoConTrenToChay.Enabled = true; */ giayDeInPres = new GiayInDanhThiepPresenter(this, giayDeIn); //cập nhật khổ in đỡ //event txtSoToChayBuHao.KeyPress += new KeyPressEventHandler(InputValidator); txtSoToChayTrenToLon.KeyPress += new KeyPressEventHandler(InputValidator); txtSoToChayLyThuyet.KeyPress += new KeyPressEventHandler(InputValidator); txtSoConTrenToIn.KeyPress += new KeyPressEventHandler(InputValidator); txtToChayRong.KeyPress += new KeyPressEventHandler(InputValidator); txtToChayDai.KeyPress += new KeyPressEventHandler(InputValidator); txtDThiepRongGomLe.KeyPress += new KeyPressEventHandler(InputValidator); txtDThiepCaoGomLe.KeyPress += new KeyPressEventHandler(InputValidator); txtSoDThiepTrenHop.KeyPress += new KeyPressEventHandler(InputValidator); txtSoToChayBuHao.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoToChayTrenToLon.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoToChayLyThuyet.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoConTrenToIn.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoToGiayLon.TextChanged += new EventHandler(TextBoxes_TextChanged); txtTenGiayIn.TextChanged += new EventHandler(TextBoxes_TextChanged); chkGiayKhach.CheckedChanged += new EventHandler(TextBoxes_TextChanged); lblSoToInTong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtToChayRong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtToChayDai.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoConTrenToIn.Leave += new EventHandler(TextBoxes_Leave); txtSoToChayBuHao.Leave += new EventHandler(TextBoxes_Leave); txtSoToChayTrenToLon.Leave += new EventHandler(TextBoxes_Leave); }
private ThongTinBanDauChoGiayInDanhThiep thongTinBanDauChoGiayIn(FormStateS tinhTrangForm) { var thongTinBanDau = new ThongTinBanDauChoGiayInDanhThiep(); thongTinBanDau.TinhTrangForm = tinhTrangForm; thongTinBanDau.KichThuocSanPham = new KichThuocPhang { Rong = 9 + 0.4f, Dai = 5.5f + 0.4f }; thongTinBanDau.SoLuongSanPham = this.SoLuong; //Số hộp thongTinBanDau.SoDanhThiepTrenHop = giaDanhThiepPres.SoDanhThiepTrenMoiHop(); //lấy từ đatabase thongTinBanDau.IdHangKhachHang = this.IdHangKH; thongTinBanDau.IdToIn_MayInChon = 1; //Đưa tượng trưng thongTinBanDau.PhuongPhapIn = PhuongPhapInS.Toner; thongTinBanDau.ThongTinCanThiet = string.Format("Danh thiếp {0} " + '\r' + '\n', this.KichThuoc) + string.Format("Số hộp: {0})" + '\r' + '\n', this.SoLuong) + "Cần cẩn thận chọn khổ giấy"; return(thongTinBanDau); }