Example #1
0
 private async void btnRefresh_Click(object sender, EventArgs e)
 {
     if (TableControl.SelectedTab == tabEmpl)
     {
         Employee refresh = new Employee();
         await refresh.RefreshEmp(listViewEmp);
     }
     else if (TableControl.SelectedTab == tabCust)
     {
         Customer refresh = new Customer();
         await refresh.RefreshCust(listViewCust);
     }
     else if (TableControl.SelectedTab == tabProv)
     {
         Provider refresh = new Provider();
         await refresh.RefreshProv(listViewProv);
     }
     else if (TableControl.SelectedTab == tabSuppl)
     {
         Supply refresh = new Supply();
         await refresh.RefreshSupp(listViewSuppl);
     }
     else if (TableControl.SelectedTab == tabProd)
     {
         Product refresh = new Product();
         await refresh.RefreshProd(listViewProd);
     }
     else if (TableControl.SelectedTab == tabOrd)
     {
         Order refresh = new Order();
         await refresh.RefreshOrd(listViewOrd);
     }
 }
Example #2
0
        private async void btnInsert_Click(object sender, EventArgs e)
        {
            if (TableControl.SelectedTab == tabEmpl)
            {
                FormInsertEmployee f = new FormInsertEmployee(connectDB.sqlConnection);
                f.ShowDialog();

                Employee refresh = new Employee();
                await refresh.RefreshEmp(listViewEmp);
            }
            else if (TableControl.SelectedTab == tabCust)
            {
                FormInsertCustomer f = new FormInsertCustomer(connectDB.sqlConnection);
                f.ShowDialog();

                Customer refresh = new Customer();
                await refresh.RefreshCust(listViewCust);
            }
            else if (TableControl.SelectedTab == tabProv)
            {
                FormInsertProvider f = new FormInsertProvider(connectDB.sqlConnection);
                f.ShowDialog();

                Provider refresh = new Provider();
                await refresh.RefreshProv(listViewProv);
            }
            else if (TableControl.SelectedTab == tabSuppl)
            {
                FormInsertSupply f = new FormInsertSupply(connectDB.sqlConnection);
                f.ShowDialog();

                Supply refresh = new Supply();
                await refresh.RefreshSupp(listViewSuppl);
            }
            else if (TableControl.SelectedTab == tabProd)
            {
                FormInsertProduct f = new FormInsertProduct(connectDB.sqlConnection);
                f.ShowDialog();

                Product refresh = new Product();
                await refresh.RefreshProd(listViewProd);
            }
            else if (TableControl.SelectedTab == tabOrd)
            {
                FormInsertOrder f = new FormInsertOrder(connectDB.sqlConnection);
                f.ShowDialog();

                Order refresh = new Order();
                await refresh.RefreshOrd(listViewOrd);

                Product refresh2 = new Product();
                await refresh2.RefreshProd(listViewProd);
            }
        }