private void TinhThuBoiBiaCung() { var idHangKH = int.Parse(cboHangKH.SelectedValue.ToString()); var thongTinBanDauMP = new ThongTinBanDauThanhPham(); thongTinBanDauMP.MoTextSoLuong = true; thongTinBanDauMP.TinhTrangForm = FormStateS.View; thongTinBanDauMP.TieuDeForm = "Bồi bìa cứng [Tính thử]"; //Tạo mục đóng cuốn var mucThPhBoiBC = new MucThPhBoiBiaCung(); mucThPhBoiBC.IdBaiIn = 1; mucThPhBoiBC.IdHangKhachHang = this.IdHangKhachHang; mucThPhBoiBC.SoLuong = 1; //Vì số lượng có thể không trùng mucThPhBoiBC.DonViTinh = "Tấm"; mucThPhBoiBC.TamRong = 10; mucThPhBoiBC.TamCao = 10; mucThPhBoiBC.SoToBoiTrenTamBia = 1; mucThPhBoiBC.LoaiThanhPham = LoaiThanhPhamS.BoiBiaCung; var frm = new ThPhBoiBiaCungForm(thongTinBanDauMP, mucThPhBoiBC); frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; //Data gởi qua form frm.ShowDialog(); }
public ThPhBoiBiaCungForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhBoiBiaCung mucThBoiBiaCung) { InitializeComponent(); this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet; this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.Text = thongTinBanDau.TieuDeForm; txtSoLuong.Enabled = thongTinBanDau.MoTextSoLuong; thPhMoPhangPres = new ThPhBoiBiaCungPresenter(this, mucThBoiBiaCung); LoadDongCuon(); cboMayBoi.SelectedIndex = -1; cboMayBoi.SelectedIndex = 0; //Load Nhu ep LoadToBoi(); //Load //Mục này phải làm ở đây if (this.TinhTrangForm == FormStateS.Edit || this.IdThanhPhamChon > 0) { this.IdThanhPhamChon = mucThBoiBiaCung.IdThanhPhamChon; this.IdToBoiChon = mucThBoiBiaCung.IdToBoiChon; } //Envent txtSoLuong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoToBoiTrenTamBia.TextChanged += new EventHandler(TextBoxes_TextChanged); txtTamRong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtTamCao.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLuong.Leave += new EventHandler(TextBoxes_Leave); txtSoToBoiTrenTamBia.Leave += new EventHandler(TextBoxes_Leave); txtTamRong.Leave += new EventHandler(TextBoxes_Leave); txtTamCao.Leave += new EventHandler(TextBoxes_Leave); txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator); txtSoToBoiTrenTamBia.KeyPress += new KeyPressEventHandler(InputValidator); txtTamRong.KeyPress += new KeyPressEventHandler(InputValidator); txtTamCao.KeyPress += new KeyPressEventHandler(InputValidator); lstToBoi.SelectedItemChanged += new EventHandler(ListView_SelectedItemChanged); cboMayBoi.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownList_SelectedIndexChanged); }
public ThPhBoiBiaCungPresenter(IViewThPhBoiBiaCung view, MucThPhBoiBiaCung mucThPham) { View = view; View = view; this.MucBoiBiaCung = mucThPham; //Cập nhật form View.ID = mucThPham.ID; View.IdBaiIn = mucThPham.IdBaiIn; View.IdHangKhachHang = mucThPham.IdHangKhachHang; View.IdThanhPhamChon = mucThPham.IdThanhPhamChon; View.LoaiThPh = mucThPham.LoaiThanhPham; View.TamRong = mucThPham.TamRong; View.TamCao = mucThPham.TamCao; View.SoLuong = mucThPham.SoLuong; View.DonViTinh = mucThPham.DonViTinh; View.IdToBoiChon = mucThPham.IdToBoiChon; View.SoToBoiTrenTamBia = mucThPham.SoToBoiTrenTamBia; }