private void Refresh() { cmbAdresses.DataSource = null; cmbAdresses.ValueMember = nameof(Adress.idAdress); cmbAdresses.DisplayMember = nameof(Adress.adress); cmbAdresses.DataSource = AddressDAO.getAdresses(); cmbBusiness.DataSource = null; cmbBusiness.ValueMember = "idBusiness"; cmbBusiness.DisplayMember = "name"; cmbBusiness.DataSource = BusinessDAO.getBusinesses(); cmbAdress.DataSource = null; cmbAdress.ValueMember = nameof(Adress.idAdress); cmbAdress.DisplayMember = nameof(Adress.adress); cmbAdress.DataSource = AddressDAO.getAdresses(); dgvAdresses.DataSource = AddressDAO.AddressesFromUser(user); dgvOrders.DataSource = AppOrderDAO.ViewUserOrders(user); CmbProductUpdate(); }
private void NormalUser_Load(object sender, EventArgs e) { dgvAdresses.DataSource = AddressDAO.AddressesFromUser(user); dgvOrders.DataSource = AppOrderDAO.ViewUserOrders(user); cmbAdresses.DataSource = null; cmbAdresses.ValueMember = nameof(Adress.idAdress); cmbAdresses.DisplayMember = nameof(Adress.adress); cmbAdresses.DataSource = AddressDAO.getAdresses(); cmbBusiness.DataSource = null; cmbBusiness.ValueMember = "idBusiness"; cmbBusiness.DisplayMember = "name"; cmbBusiness.DataSource = BusinessDAO.getBusinesses(); cmbAdress.DataSource = null; cmbAdress.ValueMember = nameof(Adress.idAdress); cmbAdress.DisplayMember = nameof(Adress.adress); cmbAdress.DataSource = AddressDAO.getAdresses(); CmbProductUpdate(); }