public ThPhBoiNhieuLopPresenter(IViewThPhBoiNhieuLop view, MucThPhBoiNhieuLop mucThPham) { View = view; View = view; this.MucBoiNhieuLop = 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.ToBoiRong = mucThPham.ToBoiRong; View.ToBoiCao = mucThPham.ToBoiCao; View.SoLuong = mucThPham.SoLuong; View.DonViTinh = mucThPham.DonViTinh; //View.IdGiayBoiGiuaChon = mucThPham.IdGiayBoiGiuaChon; View.GiayDeBoiChon = mucThPham.GiayBoiChon; View.SoLopLotGiua = mucThPham.SoLopLotGiua; View.KieuBoi = mucThPham.KieuBoi; //Nếu mới switch (View.TinhTrangForm) { case FormStateS.New: LamLai(); break; case FormStateS.Edit: break; } }
public ThPhBoiNhieuLopForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhBoiNhieuLop mucThPhBoiBiaCung) { InitializeComponent(); this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet; this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.Text = thongTinBanDau.TieuDeForm; txtSoLuong.Enabled = thongTinBanDau.MoTextSoLuong; thPhBoiNhieuLopPres = new ThPhBoiNhieuLopPresenter(this, mucThPhBoiBiaCung); LoadMayBoi(); //Load Nhu ep //Load //Mục này phải làm ở đây if (this.TinhTrangForm == FormStateS.Edit || this.IdThanhPhamChon > 0) { this.IdThanhPhamChon = mucThPhBoiBiaCung.IdThanhPhamChon; //this.IdGiayBoiGiuaChon = mucThPhBoiBiaCung.IdGiayBoiGiuaChon; } //Tiếp xem nếu có giấy bồi khong if (this.TinhTrangForm == FormStateS.Edit) { //Cập nhật thông tin giấy bồi: if (this.GiayDeBoiChon != null) { txtThongTinGiayLot.Lines = this.GiayDeBoiChon.ThongTinGiayBoi().ToArray(); } //Tính toán CapNhatLabelGia(); } //Envent txtSoLuong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLopLot.TextChanged += new EventHandler(TextBoxes_TextChanged); txtToBoiRong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtToBoiCao.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLuong.Leave += new EventHandler(TextBoxes_Leave); txtSoLopLot.Leave += new EventHandler(TextBoxes_Leave); txtToBoiRong.Leave += new EventHandler(TextBoxes_Leave); txtToBoiCao.Leave += new EventHandler(TextBoxes_Leave); txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator); txtSoLopLot.KeyPress += new KeyPressEventHandler(InputValidator); txtToBoiRong.KeyPress += new KeyPressEventHandler(InputValidator); txtToBoiCao.KeyPress += new KeyPressEventHandler(InputValidator); rdbBoiDap.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(RadioButtons_ToggleStateChanged); rdbBoiLotGiua.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(RadioButtons_ToggleStateChanged); cboMayBoi.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownList_SelectedIndexChanged); }