partial void Updatepromos_t(promos_t instance);
partial void Insertpromos_t(promos_t instance);
private void detach_promos_ts(promos_t entity) { this.SendPropertyChanging(); entity.promo_requirement = null; }
private void detach_promos_ts(promos_t entity) { this.SendPropertyChanging(); entity.promo_bonus = null; }
partial void Deletepromos_t(promos_t instance);
public void InsertNewDiscount(string description, DateTime? start, DateTime? end, string state, string timezones, string playstations, string auditory) { var db = new dbDataContext(); lock (db) { Table<promos_t> discountTable = db.GetTable<promos_t>(); if (start != null) { if (end != null) { var discount = new promos_t { promo_description = description, promo_auditory = auditory, promo_start = (DateTime) start, promo_end = (DateTime) end, promo_playstations = playstations, promo_state = state, promo_timezones = timezones, discount_bonus_id = GetLastInsertedRecordIntodiscountBonus().promo_bonus_id, promo_requirements_id = GetLastInsertedRecordIntoDiscountRequirement().promo_requirement_id }; try { discountTable.InsertOnSubmit(discount); db.SubmitChanges(); } catch (Exception) { MessageBox.Show(ErrorsAndWarningsMessages.ErrorsAndWarningsInstance().GetError(54)); } } } } }