Example #1
0
 partial void Updatepromos_t(promos_t instance);
Example #2
0
 partial void Insertpromos_t(promos_t instance);
Example #3
0
		private void detach_promos_ts(promos_t entity)
		{
			this.SendPropertyChanging();
			entity.promo_requirement = null;
		}
Example #4
0
		private void detach_promos_ts(promos_t entity)
		{
			this.SendPropertyChanging();
			entity.promo_bonus = null;
		}
Example #5
0
 partial void Deletepromos_t(promos_t instance);
Example #6
0
 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));
                 }
             }
         }
     }
 }