Exemple #1
0
        public GiayForm(int tinhTrangForm, string tenNhaCC,
                        int idDanhMucGiay, int idGiay = 0)
        {
            InitializeComponent();

            giayPres           = new GiayPresenter(this);
            this.IdGiay        = idGiay;
            this.TinhTrangForm = tinhTrangForm;
            this.TenNhaCungCap = tenNhaCC;
            this.IdDanhMucGiay = idDanhMucGiay;
            LoadDanhMucGiay();
            //Chọn dm giấy theo IdDanhMucGiay đc cung cấp
            cboDanhMucGiay.Text = giayPres.TenDanhMucGiay(this.IdDanhMucGiay);
            //-
            giayPres.TrinhBayGiay();


            cboDanhMucGiay.TextChanged   += new EventHandler(textBox_TextChanged);
            txtTenGiay.TextChanged       += new EventHandler(textBox_TextChanged);
            txtDienGiai.TextChanged      += new EventHandler(textBox_TextChanged);
            txtKhoGiay.TextChanged       += new EventHandler(textBox_TextChanged);
            txtChieuDai.TextChanged      += new EventHandler(textBox_TextChanged);
            txtChieuNgan.TextChanged     += new EventHandler(textBox_TextChanged);
            txtChieuDai.TextChanged      += new EventHandler(textBox_TextChanged);
            txtDinhLuong.TextChanged     += new EventHandler(textBox_TextChanged);
            txtMaGiayNCC.TextChanged     += new EventHandler(textBox_TextChanged);
            txtGiaMua.TextChanged        += new EventHandler(textBox_TextChanged);
            txtThuTu.TextChanged         += new EventHandler(textBox_TextChanged);
            chkTonKho.CheckedChanged     += new EventHandler(textBox_TextChanged);
            chkKhongCon.CheckedChanged   += new EventHandler(textBox_TextChanged);
            txtTenGiayMoRong.TextChanged += new EventHandler(textBox_TextChanged);

            txtChieuNgan.Leave    += new EventHandler(textBox_Leave);
            txtDinhLuong.KeyPress += new KeyPressEventHandler(InputValidator);
            txtGiaMua.KeyPress    += new KeyPressEventHandler(InputValidator); //chỉ được nhập số chẵn
            txtThuTu.KeyPress     += new KeyPressEventHandler(InputValidator); //chỉ được nhập số chẵn
            txtChieuNgan.KeyPress += new KeyPressEventHandler(InputValidator);
            txtChieuDai.KeyPress  += new KeyPressEventHandler(InputValidator);

            IsDataChanged = false;
        }