private void User_Admin_Load(object sender, EventArgs e)
        {
            viewState = new BoolBinding(false);
            mode      = CRUD_State.View;

            this.dgvNV.AutoGenerateColumns = false;
            cbxChucvu.DisplayMember        = "Ten";
            cbxChucvu.ValueMember          = "Id";

            //data
            nhanvien         = new BindingSource(NhanVienBUL.Instance.Retrieve(), null);
            dgvNV.DataSource = nhanvien;

            //combobox
            var temp1 = ChucVuBUL.Instance.Retrieve();

            temp1.Add(new ChucVu_DTO()
            {
                Id = null, Ten = "Thôi việc"
            });
            cbxChucvu.DataSource = temp1;

            //
            BindingUI();
            BindingData();
        }
Ejemplo n.º 2
0
        private void Provider_Admin_Load(object sender, EventArgs e)
        {
            //default set
            viewState = new BoolBinding(false);
            mode      = CRUD_State.View;

            //
            this.dgvCC.AutoGenerateColumns = false;
            cungcap          = new BindingSource();
            dgvCC.DataSource = cungcap;

            default_Load();

            BindingUI();
            BindingData();
        }
        private void Product_Admin_Load(object sender, EventArgs e)
        {
            //default set
            viewState = new BoolBinding(false);
            mode      = CRUD_State.View;

            this.dgvSP.AutoGenerateColumns = false;
            cbxMenuConUpdate.DisplayMember = cbxMenuCon.DisplayMember = "Ten";
            cbxMenuConUpdate.ValueMember   = cbxMenuCon.ValueMember = "Id";

            //data
            sanpham          = new BindingSource(SanPhamBUL.Instance.Retrieve(), null);
            dgvSP.DataSource = sanpham;

            //combobox
            var temp1 = MenuConBUL.Instance.Retrieve();

            temp1.Add(new MenuCon_DTO()
            {
                Id = null, Ten = "Ngừng bán"
            });
            cbxMenuConUpdate.DataSource = temp1;

            var temp2 = MenuConBUL.Instance.Retrieve();

            temp2.Add(new MenuCon_DTO()
            {
                Id = -1, Ten = "Tất cả"
            });
            temp2.Add(new MenuCon_DTO()
            {
                Id = null, Ten = "Ngừng bán"
            });
            cbxMenuCon.DataSource = temp2;

            //bind
            BindingUI();
            BindingData();
        }