public ThPhBePresenter(IViewThPhBe view, MucThPhBe mucThPham) { View = view; this.MucBe = mucThPham; View.ID = this.MucBe.ID; View.IdBaiIn = this.MucBe.IdBaiIn; View.IdHangKhachHang = this.MucBe.IdHangKhachHang; View.IdThanhPhamChon = this.MucBe.IdThanhPhamChon; View.LoaiThPh = this.MucBe.LoaiThanhPham; View.SoLuong = this.MucBe.SoLuong; View.DonViTinh = this.MucBe.DonViTinh; View.IdKhuonBeChon = this.MucBe.IdKhuonBeChon; View.KhoToChayRong = this.MucBe.KhoToChayRong; View.KhoToChayDai = this.MucBe.KhoToChayDai; View.KhoBeCao = this.MucBe.KhoBeCao; View.KhoBeRong = this.MucBe.KhoBeRong; View.SoLuongToChay = this.MucBe.SoLuongToChay; View.SoLuong = this.MucBe.SoLuong; //Nếu mới if (View.TinhTrangForm == FormStateS.New) { LamLai(); } }
public ThPhBeForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhBe mucThPhamDongCuon) { InitializeComponent(); this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet; this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.Text = thongTinBanDau.TieuDeForm; thPhamBePres = new ThPhBePresenter(this, mucThPhamDongCuon); LoadMayBe(); cboMayBe.SelectedIndex = -1; cboMayBe.SelectedIndex = 0; //Load Nhu ep LoadKhuonBe(); //Load //Mục này phải làm ở đây if (this.TinhTrangForm == FormStateS.Edit || this.IdThanhPhamChon > 0) { this.IdThanhPhamChon = mucThPhamDongCuon.IdThanhPhamChon; this.IdKhuonBeChon = mucThPhamDongCuon.IdKhuonBeChon; } //Envent txtSoLuong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtKhoBeCao.TextChanged += new EventHandler(TextBoxes_TextChanged); txtKhoBeRong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLuong.Leave += new EventHandler(TextBoxes_Leave); txtKhoBeCao.TextChanged += new EventHandler(TextBoxes_Leave); txtKhoBeRong.TextChanged += new EventHandler(TextBoxes_Leave); lstKhuonBe.SelectedItemChanged += new EventHandler(ListView_SelectedItemChanged); cboMayBe.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownList_SelectedIndexChanged); txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator); txtKhoBeCao.KeyPress += new KeyPressEventHandler(InputValidator); txtKhoBeRong.KeyPress += new KeyPressEventHandler(InputValidator); }