Esempio n. 1
0
        public bool SubmitChanges()
        {
            bool result = true;

            try
            {
                dataContext.SubmitChanges();
            }
            catch (ChangeConflictException e)
            {
                Logger.LogWarning(e.Message);
                foreach (ObjectChangeConflict occ in dataContext.ChangeConflicts)
                {
                    try
                    {
                        occ.Resolve(RefreshMode.KeepCurrentValues);
                    }
                    catch
                    {
                        result = false;
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
 //SubmitChanges
 public void SubmitChanges()
 {
     try
     {
         dataContext.SubmitChanges();
     }
     catch (ChangeConflictException e)
     {
         Logger.LogWarning(e.Message);
         foreach (ObjectChangeConflict occ in dataContext.ChangeConflicts)
         {
             occ.Resolve(RefreshMode.KeepCurrentValues);
         }
     }
 }
        // NOT DONE



        //SubmitChanges
        private bool SubmitChanges()
        {
            bool res = true;

            try
            {
                dataContext.SubmitChanges();
            }
            catch (ChangeConflictException e)
            {
                Vauction.Utils.Lib.Logger.LogWarning(e.Message);
                try
                {
                    foreach (ObjectChangeConflict occ in dataContext.ChangeConflicts)
                    {
                        occ.Resolve(RefreshMode.KeepCurrentValues);
                    }
                    res = true;
                }
                catch
                {
                    res = false;
                }
            }
            return(res);
        }
Esempio n. 4
0
        //NOT DONE



        private void SubmitChanges()
        {
            try
            {
                dataContext.SubmitChanges();
            }
            catch (ChangeConflictException e)
            {
                Vauction.Utils.Lib.Logger.LogWarning(e.Message);
                foreach (ObjectChangeConflict occ in dataContext.ChangeConflicts)
                {
                    occ.Resolve(RefreshMode.KeepCurrentValues);
                }
            }
            catch (ForeignKeyReferenceAlreadyHasValueException f)
            {
                Vauction.Utils.Lib.Logger.LogWarning(f.Message);
                foreach (ObjectChangeConflict occ in dataContext.ChangeConflicts)
                {
                    occ.Resolve(RefreshMode.KeepCurrentValues);
                }
            }
            catch (DuplicateKeyException d)
            {
                Vauction.Utils.Lib.Logger.LogWarning(d.Message);
                foreach (ObjectChangeConflict occ in dataContext.ChangeConflicts)
                {
                    occ.Resolve(RefreshMode.KeepCurrentValues);
                }
            }
        }