Beispiel #1
0
 partial void Insertsteps_of_discount_upgrading(steps_of_discount_upgrading instance);
Beispiel #2
0
 partial void Deletesteps_of_discount_upgrading(steps_of_discount_upgrading instance);
Beispiel #3
0
 public void AddNewDiscountStep(string name, double requrements, double discount)
 {
     var db = new dbDataContext();
     lock (db)
     {
         for (int i = 0; i < 5; i++)
         {
             try
             {
                 var match = (from m in db.GetTable<steps_of_discount_upgrading>()
                     where m.name == name
                     select m).SingleOrDefault();
                 if (match == null)
                 {
                     Table<steps_of_discount_upgrading> stepsOfDiscountUpgradingsTable =
                         db.GetTable<steps_of_discount_upgrading>();
                     var steps = new steps_of_discount_upgrading
                     {
                         name = name,
                         discount = discount,
                         required_played_sum = requrements
                     };
                     stepsOfDiscountUpgradingsTable.InsertOnSubmit(steps);
                     db.SubmitChanges();
                     break;
                 }
                 MessageBox.Show(ErrorsAndWarningsMessages.ErrorsAndWarningsInstance().GetError(27));
             }
             catch (Exception)
             {
                 if (i <= 0)
                 {
                     MessageBox.Show(ErrorsAndWarningsMessages.ErrorsAndWarningsInstance()
                         .GetErrorWithLine(1, 88));
                 }
                 else
                 {
                     MessageBox.Show(ErrorsAndWarningsMessages.ErrorsAndWarningsInstance().GetError(39));
                 }
             }
         }
     }
 }