Exemplo n.º 1
0
        public long AddDivision(Objects.Division addDivision)
        {
            using (var db = new SQLiteConnection(_dataMan.WritableDatabase.Path))
            {
                try
                {
                    return(db.Insert(addDivision));
                }
                catch (Exception)
                {
                    //exception handling code to go here
                    Thread.Sleep(500);

                    try
                    {
                        return(db.Insert(addDivision));
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("Trying to add a non-unique name: '{0}'.", addDivision);
                        return(0);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public long UpdateDivision(Objects.Division updDivision)
 {
     using (var db = new SQLiteConnection(_dataMan.WritableDatabase.Path))
     {
         try
         {
             return(db.Update(updDivision));
         }
         catch (Exception)
         {
             //exception handling code to go here
             Thread.Sleep(500);
             return(UpdateDivision(updDivision));
         }
     }
 }