Ejemplo n.º 1
0
        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);
            }

        }
Ejemplo n.º 2
0
        private void endPageBtn_Click(object sender, EventArgs e)
        {
            CategoriesDAL c = new CategoriesDAL();
            start = (c.CountCateg()/size)*size;
            loadData();
            backEditBtn.Enabled = true;

        }
Ejemplo n.º 3
0
        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!");

           
        }