Пример #1
0
        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();
        }
Пример #2
0
        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();
        }