Пример #1
0
        public ThPhGiaCongNgoaiForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhGiaCongNgoai mucThPhGiaCongNgoai = null)
        {
            InitializeComponent();
            this.TinhTrangForm = thongTinBanDau.TinhTrangForm;
            this.Text          = thongTinBanDau.TieuDeForm;
            this.LoaiThPh      = thongTinBanDau.LoaiThanhPham;

            this.DonViTinh     = thongTinBanDau.DonViTinh;
            this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet;
            //Tiếp theo
            thPhamGCongNgoaiPres = new ThPhGiaCongNgoaiPresenter(this, mucThPhGiaCongNgoai);
            if (this.TinhTrangForm == FormStateS.New)
            {
                thPhamGCongNgoaiPres.KhoiTaoBanDau();
            }

            //Event
            txtTen.TextChanged           += new EventHandler(TextBoxes_TextChanged);
            txtSoLuong.TextChanged       += new EventHandler(TextBoxes_TextChanged);
            txtDonViTinh.TextChanged     += new EventHandler(TextBoxes_TextChanged);
            txtTenNhaCungCap.TextChanged += new EventHandler(TextBoxes_TextChanged);
            txtPhiGiaCong.TextChanged    += new EventHandler(TextBoxes_TextChanged);
            txtPhiVanChuyen.TextChanged  += new EventHandler(TextBoxes_TextChanged);
            txtTenNhaCungCap.TextChanged += new EventHandler(TextBoxes_TextChanged);
            spnTyLeLoiNhuan.ValueChanged += new EventHandler(TextBoxes_TextChanged);

            txtSoLuong.KeyPress      += new KeyPressEventHandler(InputValidator);
            txtPhiGiaCong.KeyPress   += new KeyPressEventHandler(InputValidator);
            txtPhiVanChuyen.KeyPress += new KeyPressEventHandler(InputValidator);
        }
Пример #2
0
 public ThPhGiaCongNgoaiPresenter(IViewThPhGiaCongNgoai view, MucThPhGiaCongNgoai mucThPham)
 {
     View       = view;
     MucGiaCong = mucThPham;
     //Cập nhật dữ liệu
     View.ID               = MucGiaCong.ID;
     View.IdBaiIn          = MucGiaCong.IdBaiIn;
     View.TenThanhPhamChon = MucGiaCong.TenThanhPham;
     View.LoaiThPh         = MucGiaCong.LoaiThanhPham;
     View.SoLuong          = MucGiaCong.SoLuong;
     View.DonViTinh        = MucGiaCong.DonViTinh;
     View.PhiGiaCong       = MucGiaCong.PhiGiaCong;
     View.PhiVanChuyen     = MucGiaCong.PhiVanChuyen;
     View.TenNhaCungCap    = MucGiaCong.TenNhaCungCap;
     View.TyLeMarkUp       = MucGiaCong.TyLeMarkUp;
     View.ThanhTien        = MucGiaCong.ThanhTien;
 }