public ThPhKhoanBoGocPresenter(IViewThPhKhoanBoGoc view, MucThPhKhoanBoGoc mucThPham)
        {
            View = view;
            this.MucKhoanBoGoc = 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.KichThuocBlock  = mucThPham.KichThuocBlock;
            View.SoLuong         = mucThPham.SoLuong;

            View.DonViTinh = mucThPham.DonViTinh;


            View.SoLanKhoanBoTrenMoiBlock = mucThPham.SoLanKhoanBoTrenMoiBlock;
            ;

            //Nếu mới
            switch (View.TinhTrangForm)
            {
            case FormStateS.New:
                LamLai();
                break;

            case FormStateS.Edit:

                break;
            }
        }
Exemplo n.º 2
0
        public ThPhKhoanBoGocForm(ThongTinBanDauThanhPham thongTinBanDau, MucThPhKhoanBoGoc mucThPhKHoanBoGoc)
        {
            InitializeComponent();

            this.ThongTinHoTro = thongTinBanDau.ThongDiepCanThiet;

            this.TinhTrangForm = thongTinBanDau.TinhTrangForm;
            this.Text          = thongTinBanDau.TieuDeForm;
            //txtSoLuongBlock.Enabled = thongTinBanDau.MoTextSoLuong;


            thPhKhoanBoGocPres = new ThPhKhoanBoGocPresenter(this, mucThPhKHoanBoGoc);
            LoadMayMoc();



            //Load

            //Mục này phải làm ở đây
            if (this.TinhTrangForm == FormStateS.Edit ||
                this.IdThanhPhamChon > 0)
            {
                this.IdThanhPhamChon = mucThPhKHoanBoGoc.IdThanhPhamChon;

                //this.IdGiayBoiGiuaChon = mucThPhBoiBiaCung.IdGiayBoiGiuaChon;
            }
            //Tiếp xem nếu có giấy bồi khong
            if (this.TinhTrangForm == FormStateS.Edit)
            {
                //Tính toán
                CapNhatLabelGia(true);
            }
            //Events

            txtSoLuongBlock.TextChanged          += new EventHandler(TextBoxes_TextChanged);
            txtSoLanKhoanBoTrenBlock.TextChanged += new EventHandler(TextBoxes_TextChanged);


            txtSoLuongBlock.Leave          += new EventHandler(TextBoxes_Leave);
            txtSoLanKhoanBoTrenBlock.Leave += new EventHandler(TextBoxes_Leave);
            txtKichThuocBlock.Leave        += new EventHandler(TextBoxes_Leave);
            txtSoLuongBlock.Leave          += new EventHandler(TextBoxes_Leave);

            txtSoLuongBlock.KeyPress          += new KeyPressEventHandler(InputValidator);
            txtSoLanKhoanBoTrenBlock.KeyPress += new KeyPressEventHandler(InputValidator);
            txtKichThuocBlock.KeyPress        += new KeyPressEventHandler(InputValidator);
            txtSoLuongBlock.KeyPress          += new KeyPressEventHandler(InputValidator);

            cboMayMoc.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownList_SelectedIndexChanged);
        }