Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                if (dataGridView1.SelectedRows.Count > 0)
                {
                    for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
                    {
                        long          selectedIDs   = Convert.ToInt64(dataGridView1.SelectedRows[i].Cells[0].Value);
                        ExpenseDetail deleteRecords = expenseTracker.ExpenseDetails.First(d => d.ExpID == selectedIDs);
                        expenseTracker.ExpenseDetails.DeleteOnSubmit(deleteRecords);

                        expenseTracker.SubmitChanges();
                    }

                    MessageBox.Show("Expense Category Deleted");
                    LoadGridView();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
 partial void UpdateExpenseDetail(ExpenseDetail instance);
Ejemplo n.º 3
0
 partial void DeleteExpenseDetail(ExpenseDetail instance);
Ejemplo n.º 4
0
 partial void InsertExpenseDetail(ExpenseDetail instance);