Esempio n. 1
0
 partial void DeleteExpense(Expense instance);
Esempio n. 2
0
 partial void InsertExpense(Expense instance);
Esempio n. 3
0
 partial void UpdateExpense(Expense instance);
Esempio n. 4
0
		private void detach_Expenses(Expense entity)
		{
			this.SendPropertyChanging();
			entity.Client = null;
		}
Esempio n. 5
0
		private void attach_Expenses(Expense entity)
		{
			this.SendPropertyChanging();
			entity.Client = this;
		}
Esempio n. 6
0
		private void detach_Expenses(Expense entity)
		{
			this.SendPropertyChanging();
			entity.Frequency = null;
		}
Esempio n. 7
0
        public void SaveExpense(Expense expense)
        {
            // if its a new client, insert it
            if (expense.ExpenseID == 0)
            {
                _db.Expenses.InsertOnSubmit(expense);
            }
            else if (_db.Expenses.GetOriginalEntityState(expense) == null)
            {
                // we are updating an existing expense, but it's not attached
                // to the data context, so attach it and detect changes

                _db.Expenses.Attach(expense);
                _db.Expenses.Context.Refresh(RefreshMode.KeepCurrentValues, expense);
            }

            _db.SubmitChanges();
        }
Esempio n. 8
0
 public void DeleteExpense(Expense expense)
 {
     _db.Expenses.DeleteOnSubmit(expense);
     _db.Expenses.Context.SubmitChanges();
 }