private void detach_promo_usage_histories(promo_usage_history entity) { this.SendPropertyChanging(); entity.global_session_t = null; }
private void attach_promo_usage_histories(promo_usage_history entity) { this.SendPropertyChanging(); entity.days_sessions_t = this; }
partial void Deletepromo_usage_history(promo_usage_history instance);
partial void Updatepromo_usage_history(promo_usage_history instance);
partial void Insertpromo_usage_history(promo_usage_history instance);
public void AddNewPromoUsage(int sessionid, string comment, double sum) { var db = new dbDataContext(); lock (db) { Table<promo_usage_history> usageHistoryTable = db.GetTable<promo_usage_history>(); var usageHistory = new promo_usage_history { daily_id = GetLastOpenedGlobalSessionDailyId(), promo_bonus_comment = comment, promo_discount_sum = sum, session_id = sessionid }; usageHistoryTable.InsertOnSubmit(usageHistory); db.SubmitChanges(); } }