public ExpensesMyClass ConvertDbTableToMyClass(expenses_t expense) { var e = new ExpensesMyClass { ID_затрат = expense.expense_id, Время = expense.expenses_time, Денег_потрачено = expense.cash_amount, Описание = expense.comments }; return e; }
partial void Deleteexpenses_t(expenses_t instance);
partial void Updateexpenses_t(expenses_t instance);
partial void Insertexpenses_t(expenses_t instance);
private void detach_expenses_ts(expenses_t entity) { this.SendPropertyChanging(); entity.global_session_t = null; }
public void InsertExpensesRecord(double money, string comments, DateTime expensesTime) { var db = new dbDataContext(); lock (db) { Table<expenses_t> expensesTable = db.GetTable<expenses_t>(); var expenses = new expenses_t { daily_id = GetLastOpenedGlobalSessionDailyId(), comments = comments, cash_amount = money, expenses_time = expensesTime }; expensesTable.InsertOnSubmit(expenses); db.SubmitChanges(); } }