private void TinhThu_CatDecal() { var idHangKH = int.Parse(cboHangKH.SelectedValue.ToString()); var thongTinBanDau = new ThongTinBanDauThanhPham(); thongTinBanDau.DonViTinh = "Con"; thongTinBanDau.TinhTrangForm = FormStateS.View; thongTinBanDau.TieuDeForm = "Cắt decal [Tính thử]"; //Tạo mục đóng cuốn var mucThPhCatDecal = new MucThPhCatDecal(); mucThPhCatDecal.IdBaiIn = 1; mucThPhCatDecal.IdHangKhachHang = this.IdHangKhachHang; mucThPhCatDecal.SoLuong = 100; //Vì số lượng có thể không trùng mucThPhCatDecal.DonViTinh = "con"; mucThPhCatDecal.ConRong = 5; mucThPhCatDecal.ConCao = 5; mucThPhCatDecal.LoaiThanhPham = LoaiThanhPhamS.CatDecal; var frm = new ThPhCatDecalForm(thongTinBanDau, mucThPhCatDecal); frm.MinimizeBox = false; frm.MaximizeBox = false; frm.StartPosition = FormStartPosition.CenterParent; //Data gởi qua form frm.ShowDialog(); }
public ThPhCatDecalPresenter(IViewThPhCatDecal view, MucThPhCatDecal mucThPham) { View = view; View = view; this.MucCatDecal = 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.SoLuong = mucThPham.SoLuong; View.DonViTinh = mucThPham.DonViTinh; View.ConRong = mucThPham.ConRong; View.ConCao = mucThPham.ConCao; }
public ThPhCatDecalForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhCatDecal mucThPhCatDecal) { InitializeComponent(); this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet; this.TinhTrangForm = thongTinBanDau.TinhTrangForm; this.Text = thongTinBanDau.TieuDeForm; //txtSoLuong.Enabled = thPhMoPhangPres = new ThPhCatDecalPresenter(this, mucThPhCatDecal); LoadMayThanhPham(); cboMayThPh.SelectedIndex = -1; cboMayThPh.SelectedIndex = 0; //Load Nhu ep //Load //Mục này phải làm ở đây if (this.TinhTrangForm == FormStateS.Edit || this.IdThanhPhamChon > 0) { this.IdThanhPhamChon = mucThPhCatDecal.IdThanhPhamChon; } //Envent txtSoLuong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtConRong.TextChanged += new EventHandler(TextBoxes_TextChanged); txtConCao.TextChanged += new EventHandler(TextBoxes_TextChanged); txtSoLuong.KeyPress += new KeyPressEventHandler(InputValidator); txtConRong.KeyPress += new KeyPressEventHandler(InputValidator); txtConCao.KeyPress += new KeyPressEventHandler(InputValidator); txtSoLuong.Leave += new EventHandler(TextBoxes_Leave); txtConRong.Leave += new EventHandler(TextBoxes_Leave); txtConCao.Leave += new EventHandler(TextBoxes_Leave); cboMayThPh.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownList_SelectedIndexChanged); }