public frmDMDonViTinh() { InitializeComponent(); DM_DonViTinh = new clsDM_DonViTinh(); //Init cls Button PanelButton = new clsPanelButton(); frmAction = new FormActionDelegate(FormAction); PanelButton.setDelegateFormAction(frmAction); //enumButton dùng định danh button PanelButton.AddButton(enumButton.Them, ref btnThem); PanelButton.AddButton(enumButton.Xoa, ref btnXoa); PanelButton.AddButton(enumButton.Sua, ref btnSua); PanelButton.AddButton(enumButton.LamMoi, ref btnLamMoi); PanelButton.AddButton(enumButton.Luu, ref btnLuu); PanelButton.AddButton(enumButton.Huy, ref btnHuy); PanelButton.AddButton(enumButton.Dong, ref btnDong); PanelButton.ResetButton(); LoadData(); }
/// <summary> /// [Bug] Lỗi khi GetDonViTinh == Rỗng /// </summary> public frmDMVatTu() { InitializeComponent(); //Init cls Button PanelButton = new clsPanelButton(); frmAction = new FormActionDelegate(FormAction); PanelButton.setDelegateFormAction(frmAction); //enumButton dùng định danh button PanelButton.AddButton(enumButton.Them, ref btnThem); PanelButton.AddButton(enumButton.Xoa, ref btnXoa); PanelButton.AddButton(enumButton.Sua, ref btnSua); PanelButton.AddButton(enumButton.LamMoi, ref btnLamMoi); PanelButton.AddButton(enumButton.Luu, ref btnLuu); PanelButton.AddButton(enumButton.Huy, ref btnHuy); PanelButton.AddButton(enumButton.Dong, ref btnDong); PanelButton.ResetButton(); /*DM_VatTu.GetDonViTinh(); if (DM_VatTu.dicDonViTinh.Count > 0) { cboDonViTinh.DataSource = new BindingSource(DM_VatTu.dicDonViTinh, null); cboDonViTinh.DisplayMember = "Key"; cboDonViTinh.ValueMember = "Value"; DM_VatTu.Selected_DonViTinh = (int)cboDonViTinh.SelectedValue; }*/ initDonViTinh(); LoadData(); }