private void forwardBtn_Click(object sender, EventArgs e) { CategoriesDAL c = new CategoriesDAL(); start = start + size; backEditBtn.Enabled = true; if (start >(c.CountCateg()/size)*size ) { start = 0; } if (sortById == 1) { dataGridViewEdit.DataSource = c.GetCategoriesSortedById(start, size); } if (sortByName == 1) { dataGridViewEdit.DataSource = c.GetCategoriesSortedByName(start, size); } }
private void endPageBtn_Click(object sender, EventArgs e) { CategoriesDAL c = new CategoriesDAL(); start = (c.CountCateg()/size)*size; loadData(); backEditBtn.Enabled = true; }
private void addBtn_Click(object sender, EventArgs e) { CategoryDTO dto=new CategoryDTO(); CategoriesDAL c = new CategoriesDAL(); dto.categ_name = nameTxt.Text; c.insertCategory(dto); start = (c.CountCateg() / size) * size; loadData(); clearText(); MessageBox.Show("Added!"); }