コード例 #1
0
        public GiayDeInForm(int formState)
        {
            InitializeComponent();
            giayDeInPres   = new GiayDeInPresenter(this);
            _giayChon      = new Giay();
            this.FormState = formState;
            //Việc đặt dữ liệu ban đầu
            giayDeInPres.KhoiTaoGiaTriBanDau();


            //event
            txtSoToChayBuHao.KeyPress       += new KeyPressEventHandler(InputValidator);
            txtSoToGiayLon.KeyPress         += new KeyPressEventHandler(InputValidator);
            txtSoToChayLyThuyet.KeyPress    += new KeyPressEventHandler(InputValidator);
            txtSoConTrenToIn.KeyPress       += new KeyPressEventHandler(InputValidator);
            txtSoToChayBuHao.TextChanged    += new EventHandler(TextBoxes_TextChanged);
            txtSoToGiayLon.TextChanged      += new EventHandler(TextBoxes_TextChanged);
            txtSoToChayLyThuyet.TextChanged += new EventHandler(TextBoxes_TextChanged);
            txtSoConTrenToIn.TextChanged    += new EventHandler(TextBoxes_TextChanged);
            chkGiayKhach.CheckedChanged     += new EventHandler(TextBoxes_TextChanged);
            lblGiaMua.TextChanged           += new EventHandler(TextBoxes_TextChanged);
        }
コード例 #2
0
ファイル: GiayDeInForm.cs プロジェクト: DzungHg/TinhGiaDigi2
        public GiayDeInForm(ThongTinBanDauChoGiayIn thongTinBanDau, GiayDeIn giayDeIn)
        {
            InitializeComponent();
            this.TinhTrangForm         = thongTinBanDau.TinhTrangForm;
            this.ThongTinBaiIn_CauHinh = thongTinBanDau.ThongTinCanThiet;
            this.SoLuongSanPham        = thongTinBanDau.SoLuongSanPham;
            this.IdHangKH     = thongTinBanDau.IdHangKhachHang;
            this.PhuongPhapIn = thongTinBanDau.PhuongPhapIn;
            this.SanPhamRong  = thongTinBanDau.KichThuocSanPham.Rong;
            this.SanPhamCao   = thongTinBanDau.KichThuocSanPham.Dai;
            lblDonViTinh.Text = thongTinBanDau.DonViTinhSanPham;

            if (thongTinBanDau.LaInDanhThiep) //bắt nút tính số con
            {
                btnTinhSoConTrenToChay.Enabled = false;
            }
            else
            {
                btnTinhSoConTrenToChay.Enabled = true;
            }

            giayDeInPres = new GiayDeInPresenter(this, giayDeIn);

            //cập nhật khổ in đỡ


            //event
            txtSoToChayBuHao.KeyPress     += new KeyPressEventHandler(InputValidator);
            txtSoToChayTrenToLon.KeyPress += new KeyPressEventHandler(InputValidator);
            txtSoToChayLyThuyet.KeyPress  += new KeyPressEventHandler(InputValidator);
            txtSoConTrenToIn.KeyPress     += new KeyPressEventHandler(InputValidator);
            txtToChayRong.KeyPress        += new KeyPressEventHandler(InputValidator);
            txtToChayDai.KeyPress         += new KeyPressEventHandler(InputValidator);
            txtSoLuongSP.KeyPress         += new KeyPressEventHandler(InputValidator);
            txtSPRong.KeyPress            += new KeyPressEventHandler(InputValidator);
            txtSPCao.KeyPress             += new KeyPressEventHandler(InputValidator);

            txtSoToChayBuHao.TextChanged     += new EventHandler(TextBoxes_TextChanged);
            txtSoToChayTrenToLon.TextChanged += new EventHandler(TextBoxes_TextChanged);
            txtSoToChayLyThuyet.TextChanged  += new EventHandler(TextBoxes_TextChanged);
            txtSoConTrenToIn.TextChanged     += new EventHandler(TextBoxes_TextChanged);
            txtSoToGiayLon.TextChanged       += new EventHandler(TextBoxes_TextChanged);
            txtTenGiayIn.TextChanged         += new EventHandler(TextBoxes_TextChanged);
            txtSoLuongSP.TextChanged         += new EventHandler(TextBoxes_TextChanged);
            txtSPRong.TextChanged            += new EventHandler(TextBoxes_TextChanged);
            txtSPCao.TextChanged             += new EventHandler(TextBoxes_TextChanged);

            chkGiayKhach.CheckedChanged += new EventHandler(CheckBoxes_CheckChanged);

            lblSoToInTong.TextChanged += new EventHandler(TextBoxes_TextChanged);
            txtToChayRong.TextChanged += new EventHandler(TextBoxes_TextChanged);
            txtToChayDai.TextChanged  += new EventHandler(TextBoxes_TextChanged);



            txtSoConTrenToIn.Leave     += new EventHandler(TextBoxes_Leave);
            txtSoToChayBuHao.Leave     += new EventHandler(TextBoxes_Leave);
            txtSoToChayTrenToLon.Leave += new EventHandler(TextBoxes_Leave);
            txtSoLuongSP.Leave         += new EventHandler(TextBoxes_Leave);
            txtSPRong.Leave            += new EventHandler(TextBoxes_Leave);
            txtSPCao.Leave             += new EventHandler(TextBoxes_Leave);
        }