예제 #1
0
 partial void DeleteExpense(Expense instance);
예제 #2
0
 partial void InsertExpense(Expense instance);
예제 #3
0
 partial void UpdateExpense(Expense instance);
예제 #4
0
		private void detach_Expenses(Expense entity)
		{
			this.SendPropertyChanging();
			entity.Client = null;
		}
예제 #5
0
		private void attach_Expenses(Expense entity)
		{
			this.SendPropertyChanging();
			entity.Client = this;
		}
예제 #6
0
		private void detach_Expenses(Expense entity)
		{
			this.SendPropertyChanging();
			entity.Frequency = null;
		}
예제 #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();
        }
예제 #8
0
 public void DeleteExpense(Expense expense)
 {
     _db.Expenses.DeleteOnSubmit(expense);
     _db.Expenses.Context.SubmitChanges();
 }