Beispiel #1
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            int id1 = 110;

            foreach (DataGridViewRow row in dataGridView1.SelectedRows)
            {
                int id = Convert.ToInt32(row.Cells[0].Value.ToString());
                id1 = id;

                DaoCategory.DeleteCategory(id);
            }
            fillGrip();
            MessageBox.Show("done!" + id1);
        }
        public async Task <ReturnObject> UpdateCategory(string CategoryId)
        {
            ReturnObject obj = new ReturnObject();

            obj.status = -1;
            try
            {
                DaoCategory daoCategory = new DaoCategory(tWG_ACHECKContext);
                int         result      = await daoCategory.DeleteCategory(CategoryId);

                if (result > 0)
                {
                    obj.status = 1;
                }
                obj.value = result;
            }
            catch (Exception ex)
            {
                obj.status  = -1;
                obj.message = ex.StackTrace;
            }
            return(obj);
        }