예제 #1
0
파일: LineStore.cs 프로젝트: yingfangdu/BNR
 public static void clearShapes()
 {
     completeLines.Clear();
     completeCircles.Clear();
     string dbPath = GetDBPath();
     SQLiteConnection db;
     db = new SQLiteConnection(dbPath);
     db.DeleteAll<Line>();
     db.DeleteAll<Circle>();
     db.Close();
     db = null;
 }
 public void DontRememberMe()
 {
     using (var dbConnection = new SQLiteConnection(_dbUnitAndroidPrinterAppCurrent))
     {
         dbConnection.DeleteAll<AccountDB>();
     }
 }
예제 #3
0
 //Delete Table Transaction
 public static void DeleteTableTransaction()
 {
     using (var conn = new SQLite.SQLiteConnection(my_db_path))
     {
         conn.DeleteAll <Transaction>();
     }
 }
예제 #4
0
 public static void DeleteTableCategory()
 {
     using (var conn = new SQLite.SQLiteConnection(my_db_path))
     {
         conn.DeleteAll <Category>();
     }
 }
예제 #5
0
 private void ClearTableInDB()
 {
     using (var db = new SQLite.SQLiteConnection(localSettings.Values["ActionsDBPath"] as string))
     {
         db.DeleteAll <Actions>();
     }
 }
예제 #6
0
        void ClearPostedInv()
        {
            CompanyInfo para = DataHelper.GetCompany(pathToDatabase);

            if (!para.AllowClrTrxHis)
            {
                Toast.MakeText(this, Resources.GetString(Resource.String.msg_accessdenied), ToastLength.Long).Show();
                return;
            }
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                db.DeleteAll <InvoiceDtls> ();
                db.DeleteAll <Invoice> ();
                db.DeleteAll <CNNoteDtls> ();
                db.DeleteAll <CNNote> ();
                Toast.MakeText(this, Resources.GetString(Resource.String.msg_trxclear), ToastLength.Long).Show();
            }
        }
 public void ClearData()
 {
   
         var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "expenses.sqlite");
         using (var db = new SQLite.SQLiteConnection(dbPath))
         {
             db.DeleteAll<Data>();
         }
    
 }
예제 #8
0
		public DataManager ()
		{

			string folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal);

			sync = new SQLiteConnection (System.IO.Path.Combine (folder, "pengeplan.db"));

			sync.CreateTable<Transaction> ();
			sync.DeleteAll<Transaction> ();

		}
예제 #9
0
 // Deletes user data and returns success bool
 public static bool DeleteUserData()
 {
     using (var SQLiteConnection = new SQLite.SQLiteConnection(dataBasePath))
     {
         if (SQLiteConnection.DeleteAll <UserObject>() != 0)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #10
0
        private async void deleteall(object sender, RoutedEventArgs e)
        {
            var dbpath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "data.db3");

            using (var db = new SQLite.SQLiteConnection(dbpath))
            {
                db.DeleteAll <person>();
            }
            var line = new MessageDialog("All Records Deleted");
            await line.ShowAsync();
        }
예제 #11
0
 public void InitializeData()
 {
     using (var db = new SQLite.SQLiteConnection(App.DBPath))
     {
         //Clear tables (for DEV purpoises only!)
         //TODO: later remove
         db.DeleteAll<User>();
         db.DeleteAll<Pet>();
         db.DeleteAll<PetStage>();
         db.DeleteAll<GameObject>();
         //User
         InserUser(db);
         //Pet
         InserPet(db);
         //Pet stages
         InsertPetStages(db);
         //Game objects
         InsertFood(db);
         InserActivities(db);
     }
 }
 public void RememberMe(AccountDB account)
 {
     using (var dbConnection = new SQLiteConnection(_dbUnitAndroidPrinterAppCurrent))
     {
         dbConnection.DeleteAll<AccountDB>();
         dbConnection.Insert(new AccountDB()
         {
             Sid = account.Sid,
             CurUserAdSid = account.CurUserAdSid,
             Login = account.Login,
             Password = account.Password
         });
     }
 }
예제 #13
0
        private void InsertCustomerIntoDb(List <Customer> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                //var list2 = db.Table<Trader>().ToList<Trader>();
                db.DeleteAll <Trader> ();               // (list2);
                foreach (Customer item in list)
                {
                    Trader itm = new Trader();
                    itm.CustCode  = item.CustomerCode;
                    itm.CustName  = item.CustomerName;
                    itm.Addr1     = item.Addr1;
                    itm.Addr2     = item.Addr2;
                    itm.Addr3     = item.Addr3;
                    itm.Addr4     = item.Addr4;
                    itm.Tel       = item.Tel;
                    itm.Fax       = item.Fax;
                    itm.gst       = item.Gst;
                    itm.PayCode   = item.PayCode;
                    itm.CustType  = item.CustType;
                    itm.AgentCode = item.ExtraInfo;

                    db.Insert(itm);
//					if (list2.Where (x => x.CustCode == itm.CustCode).ToList ().Count () == 0) {
//						db.Insert (itm);
//					} else {
//						db.Update (itm);
//					}
                }
            }

            string dmsg = CallingActivity.Resources.GetString(Resource.String.msg_successdowncusts);

            dmsg = dmsg.Replace("nn", list.Count.ToString());

            if (_downloadAll)
            {
                FireEvent(EventID.LOGIN_DOWNCOMPLETE);
                DownloadAllhandle.Invoke(CallingActivity, list.Count, dmsg);
            }
            else
            {
                Downloadhandle.Invoke(CallingActivity, list.Count, dmsg);
            }
        }
예제 #14
0
        //protected override void OnOrientationChanged(OrientationChangedEventArgs e)
        //{
        //    try
        //    {
        //        if (Orientation == PageOrientation.LandscapeLeft || Orientation == PageOrientation.LandscapeRight)
        //        {

        //            textbox2.Height = 80;
        //            textbox2.Margin = new Thickness(-12, -35, -19, 0);
        //            textbox2.Width = 735;
        //            richtextbox1.Height = 335;
        //            richtextbox1.Margin = new Thickness(-12, 45, -19, 00);
        //            richtextbox1.Width = 735;

        //        }
        //        else if (Orientation == PageOrientation.Portrait)
        //        {



        //            textbox2.Margin = new Thickness(-12, -40, 0, 0);
        //            textbox2.Width = 485;
        //            richtextbox1.Height = 628;
        //            richtextbox1.Margin = new Thickness(-12, 30, -17, 0);
        //            richtextbox1.Width = 485;


        //        }
        //    }
        //    catch
        //    {
        //    }
        //}
        //private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
        //{
        //    // Switch the placement of the buttons based on an orientation change.
        //    if ((e.Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
        //    {
        //        textbox2.Height=80;
        //        textbox2.Margin=new Thickness(-12,-35,-13,0);
        //        textbox2.Width = 481;
        //    }
        //    // If not in portrait, move buttonList content to visible row and column.
        //    else
        //    {
        //        textbox2.Height=80;
        //        textbox2.Margin=new Thickness(-12,-35,-19,0);
        //        textbox2.Width = 735;
        //       richtextbox1.Height=335;
        //       richtextbox1.Margin = new Thickness(-12, 45, -19, 00);
        //        richtextbox1.Width=735;
        //    }
        //}


        #region Database
        public void deleteall(object sender, EventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Clear The Recent List", "Recently Searched Words", MessageBoxButton.OKCancel);

            // textbox2.Text = MessageBoxResult.Cancel.ToString();
            if (result == MessageBoxResult.Cancel)
            {
            }
            else
            {
                var dbpath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "data.db3");
                using (var db = new SQLite.SQLiteConnection(dbpath))
                {
                    db.DeleteAll <person>();
                }
                list1.Items.Clear();
            }
        }
예제 #15
0
        private void InsertItemIntoDb(List <ItemCode> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase)) {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll <Item> ();
                foreach (ItemCode item in list)
                {
                    Item itm = new Item();
                    itm.ICode          = item.ICode;
                    itm.IDesc          = item.IDesc;
                    itm.Price          = item.Price;
                    itm.tax            = item.tax;
                    itm.taxgrp         = item.taxgrp;
                    itm.isincludesive  = item.isincludesive;
                    itm.RetailPrice    = item.RetailPrice;
                    itm.VIPPrice       = item.VIPPrice;
                    itm.WholeSalePrice = item.WholesalePrice;
                    itm.Barcode        = item.Barcode;
                    itm.StdUom         = item.UOM;
                    itm.Class          = item.IClass;
                    itm.ImageFilename  = item.ImageName;
                    db.Insert(itm);
                }
            }

            string dmsg = CallingActivity.Resources.GetString(Resource.String.msg_successdownitems);

            dmsg = dmsg.Replace("nn", list.Count.ToString());

            if (_downloadAll)
            {
                _downloadItem = true;
                DownloadAllhandle.Invoke(CallingActivity, list.Count, dmsg);
                FireEvent(EventID.DOWNLOADED_ITEM);
            }
            else
            {
                Downloadhandle.Invoke(CallingActivity, list.Count, dmsg);
            }
        }
예제 #16
0
        //-----------sets an fake user for recognizing if welcome screen should be ignored or not---------//
        protected void createSystemUser()
        {
            var db = new SQLiteConnection (dbPath);

            var rowCount = db.Table<User> ().Count ();

            if (rowCount > 2) {
                db.DeleteAll<User> ();
            }

            if (!hasInserted) {
                Log.Info (Tag, "libber");
                var result = insertUpdateData(new User{ ID = 2, FirstName = string.Format("SystemUser", System.DateTime.Now.Ticks),
                    LastName = "Mr.Anderson",
                }, db);
                hasInserted = true;
            } else {
                var rowcount = db.Delete(new User(){ID=2});
            }
        }
예제 #17
0
		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello SQLite-net Data!");

			// We're using a file in Assets instead of the one defined above
			//string dbPath = Directory.GetCurrentDirectory ();
			string dbPath = @"../../../DataAccess-Android/Assets/stocks.db3";
			var db = new SQLiteConnection (dbPath);

			// Create a Stocks table
			if (db.CreateTable<Stock>() == 0)
			{
				// A table already exixts, delete any data it contains
				db.DeleteAll<Stock> ();
			}

			AddStocksToDb (db, "GOOG", "Google", "GoogleStocks.csv");
			AddStocksToDb (db, "EA", "Electronic Arts", "EAStocks.csv");
			AddStocksToDb (db, "SNE", "Sony", "SonyStocks.csv");

		}
예제 #18
0
        private void InsertItemPriceIntoDb(List <ItemLastPrice> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase)) {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll <ItemPrices> ();
                int id = 1;
                foreach (ItemLastPrice item in list)
                {
                    ItemPrices itm = new ItemPrices();
                    itm.ID       = id;
                    itm.ICode    = item.ICode;
                    itm.IDesc    = item.IDesc;
                    itm.Price    = item.Price;
                    itm.CustCode = item.CustCode;
                    itm.CustName = item.CustName;
                    itm.InvDate  = item.InvDate;
                    if (string.IsNullOrEmpty(item.IClass))
                    {
                        itm.IClass = "";
                    }
                    else
                    {
                        itm.IClass = item.IClass;
                    }

                    db.Insert(itm);
                    id = id + 1;
                }
            }

            string dmsg = CallingActivity.Resources.GetString(Resource.String.msg_successdownitems);

            dmsg = dmsg.Replace("nn", list.Count.ToString());

            Downloadhandle.Invoke(CallingActivity, list.Count, dmsg);
        }
예제 #19
0
 //------------------------------------------------------------------------//
 //Delete every single thing
 public bool deleteall()
 {
     try
     {
         var db = new SQLiteConnection(m_db_path);
         db.DeleteAll<ShopItem>();
         db.Commit();
         return true;
     }
     catch (SQLiteException ex)
     {
         Console.WriteLine("deleting row has failed, invalid parameters ex.msg :{0}",  ex.Message);
         return false;
     }
 }
예제 #20
0
        private void InsertItemIntoDb(List<ItemCode> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            string comp =((GlobalvarsApp)CallingActivity.Application).COMPANY_CODE;
            string brn =((GlobalvarsApp)CallingActivity.Application).BRANCH_CODE;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {

                db.DeleteAll<Item> ("Delete from Item where CompCode='"+comp+"' and BranchCode='"+brn+"'" );
                foreach (ItemCode item in list) {
                    Item itm = new Item ();
                    itm.ICode = item.ICode;
                    itm.IDesc = item.IDesc;
                    itm.Price = item.Price;
                    itm.tax = item.tax;
                    itm.taxgrp = item.taxgrp;
                    itm.isincludesive = item.isincludesive;
                    itm.BranchCode = brn;
                    itm.CompCode = comp;

                    db.Insert (itm);

                }
            }

            if (_downloadAll) {
                _downloadItem = true;
                DownloadAllhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded"+list.Count.ToString()+"Item(s).");
                FireEvent (EventID.DOWNLOADED_ITEM);
            }
            else Downloadhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded"+list.Count.ToString()+"Item(s).");
        }
예제 #21
0
        //-----------sets the tag in the user.cs for further utilization in the application---------//
        protected void settingTags()
        {
            var db = new SQLiteConnection (dbPath);

            db.DeleteAll<User> ();

            if (!hasInserted) {
                Log.Info (Tag, "libber");
                var result = insertUpdateData(new User{ ID = 1, FirstName = string.Format("xxxxx", System.DateTime.Now.Ticks),
                    LastName = "Smith",
                    Standards = hasStandards,
                    IsActive = isActive,
                    InterestNature = interestNature,
                    InterestCity = interestCity,
                    InterestCulture = interestCulture,
                    InterestSportActivities = interestSportActivities,
                    InterestEvents = interestEvents
                }, db);
                hasInserted = true;
            } else {
                var rowcount = db.Delete(new User(){ID=1});
                settingTags ();
            }
        }
예제 #22
0
파일: DBRepository.cs 프로젝트: Dealtis/DCS
        //DROP ALL TABLE
        public string DropTableStatut()
        {
            try
            {
                string dbPath = System.IO.Path.Combine(Environment.GetFolderPath
                    (Environment.SpecialFolder.Personal),"ormDMS.db3");
                var db = new SQLiteConnection(dbPath);
                db.DeleteAll<TablePosition>();
                db.DeleteAll<TableVoyage>();
                db.DeleteAll<TableUser>();
                db.DeleteAll<TableEvenement>();
                string result = "Table vidée";
                return result;
            }
            catch (Exception ex)
            {
                return "Erreur : " + ex.Message;

            }
        }
예제 #23
0
        private void InsertCustomerIntoDb(List<Customer> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            string comp =((GlobalvarsApp)CallingActivity.Application).COMPANY_CODE;
            string brn =((GlobalvarsApp)CallingActivity.Application).BRANCH_CODE;

            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                db.DeleteAll<Trader> ("Delete from Trader where IsLocal =0 and CompCode='"+comp+"' and BranchCode='"+brn+"'" );
                foreach (Customer item in list) {
                    Trader itm = new Trader ();
                    itm.CustCode = item.CustomerCode;
                    itm.CustName = item.CustomerName;
                    itm.Addr1 = item.Addr1;
                    itm.Addr2 = item.Addr2;
                    itm.Addr3 = item.Addr3;
                    itm.Addr4 = item.Addr4;
                    itm.Tel = item.Tel;
                    itm.Fax = item.Fax;
                    itm.gst = item.Gst;
                    itm.PayCode = item.PayCode;
                    itm.BranchCode = brn;
                    itm.CompCode = comp;
                    itm.IsLocal = false;
                    db.Insert (itm);

                }
            }

            if (_downloadAll) {
                FireEvent (EventID.LOGIN_DOWNCOMPLETE);
                DownloadAllhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded "+list.Count.ToString()+" customer(s).");
            }else Downloadhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded "+list.Count.ToString()+" customer(s).");
        }
예제 #24
0
        void ClearPostedInv()
        {
            CompanyInfo para = DataHelper.GetCompany (pathToDatabase);
            if (!para.AllowClrTrxHis) {
                Toast.MakeText (this, "Access denied...", ToastLength.Long).Show ();
                return;
            }
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                db.DeleteAll<InvoiceDtls> ();
                db.DeleteAll<Invoice> ();
                db.DeleteAll<CNNoteDtls> ();
                db.DeleteAll<CNNote> ();
            //				var list2 = db.Table<Invoice> ().Where (x => x.isUploaded == true).ToList<Invoice> ();
            //				db.RunInTransaction (() => {
            //					foreach (var item in list2) {
            //						var listitm = db.Table<InvoiceDtls> ().Where (x => x.invno == item.invno).ToList<InvoiceDtls> ();
            //						foreach(var iitem in listitm){
            //							db.Delete(iitem);
            //						}
            //						db.Delete(item);
            //					}
            //				});
            //
            //				var list3 = db.Table<CNNote> ().Where (x => x.isUploaded == true).ToList<CNNote> ();
            //				db.RunInTransaction (() => {
            //					foreach (var item in list3) {
            //						var listitm = db.Table<CNNoteDtls> ().Where (x => x.cnno == item.cnno).ToList<CNNoteDtls> ();
            //						foreach(var iitem in listitm){
            //							db.Delete(iitem);
            //						}
            //						db.Delete(item);
            //					}
            //				});

                Toast.MakeText (this, "Transaction clear...", ToastLength.Long).Show ();
            }
        }
예제 #25
0
        //--------------retrieving user data and storing in variables---------------//
        private void UpdateDestinationDB()
        {
            using (var db = new SQLiteConnection (destinationDBPath)) {

                db.DeleteAll<Destination> ();

                var rowZero = insertUpdateDestinationData(new Destination{ ID = 1, Name = string.Format("Kabelpark", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 4,
                    InterestNature = 2,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 2,
                    InterestSportActivities = 4,
                    VacationTarget = 1,
                    Order = 3,
                    Description = "Kabelpark in Hvide Sande - ein beliebte Wakeboardbahn.",
                    ImageResID = Resource.Drawable.kabelpark
                }, db);

                var rowOne = insertUpdateDestinationData(new Destination{ ID = 2, Name = string.Format("Blavandshuk Fyr", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 1,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 4,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 4,
                    Order = 5,
                    Description = "Blåvandshuk Fyr, der westlichste Leuchtturm Dänemarks.",
                    ImageResID = Resource.Drawable.BlavandshukFyr
                }, db);

                var rowTwo = insertUpdateDestinationData(new Destination{ ID = 3, Name = string.Format("Skagen Bunker Museum", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 2,
                    InterestCulture = 3,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 2,
                    Order = 3,
                    Description = "Skagen's Bunker Musem, gut erhaltener Bunker aus dem zweiten Weltkrieg.",
                    ImageResID = Resource.Drawable.bunkermuseum
                }, db);

                var rowThree = insertUpdateDestinationData(new Destination{ ID = 4, Name = string.Format("Skagens Museum", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 2,
                    InterestCulture = 4,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 3,
                    Description = "Skagen's Museum, Kunst aus ganz Dänemark, beschäftigt sich vor allem mit den Skagen-Malern.",
                    ImageResID = Resource.Drawable.skagensmuseum
                }, db);

                var rowFour = insertUpdateDestinationData(new Destination{ ID = 5, Name = string.Format("Nationalpark Thy", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 2,
                    InterestNature = 4,
                    InterestCity = 1,
                    InterestCulture = 2,
                    InterestEvents = 3,
                    InterestSportActivities = 3,
                    VacationTarget = 2,
                    Order = 2,
                    Description = "Nationalpark Thy, an der Küste Dänemarks, bietet viele Aktivitäten und Sehenswürdigkeiten.",
                    ImageResID = Resource.Drawable.nationalparkthy
                }, db);

                var rowFive = insertUpdateDestinationData(new Destination{ ID = 6, Name = string.Format("Strand von Skagen", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 2,
                    InterestNature = 4,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 1,
                    InterestSportActivities = 2,
                    VacationTarget = 4,
                    Order = 3,
                    Description = "Der Strand von Skagen bildet den nördlichsten Punkt Dänemarks, ein Ausflug wert.",
                    ImageResID = Resource.Drawable.skagenstrand
                }, db);

                var rowSix = insertUpdateDestinationData(new Destination{ ID = 7, Name = string.Format("Skagens Fischrestaurant", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 3,
                    Description = "Skagens Fiskrestaurant - bietet eine ausgezeichnete Aussicht und Küche.",
                    ImageResID = Resource.Drawable.fiskrestaurant
                }, db);

                var rowSeven = insertUpdateDestinationData(new Destination{ ID = 8, Name = string.Format("Den Gemle By", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 3,
                    InterestCulture = 4,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 4,
                    Description = "Den Gamle By in Aarhus ist ein Freilichtmuseum über Kultur und Geschichte von Aarhus und Dänemark.",
                    ImageResID = Resource.Drawable.dengemleby
                }, db);

                var rowEight = insertUpdateDestinationData(new Destination{ ID = 9, Name = string.Format("Nationalpark Mols Bjerge", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 3,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 1,
                    InterestSportActivities = 2,
                    VacationTarget = 2,
                    Order = 2,
                    Description = "Moljs Bjerge, ein Nationalpark mit großen Grünflächen und Wäldern, sehr flach, spiegelt gut die Fauna in Dänemark wieder.",
                    ImageResID = Resource.Drawable.molsbjerge
                }, db);

                var rowNine = insertUpdateDestinationData(new Destination{ ID = 10, Name = string.Format("Rosenborg Schloss", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 2,
                    InterestNature = 4,
                    InterestCity = 4,
                    InterestCulture = 3,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 5,
                    Description = "Rosenborg, Schloss von Kopenhagen, hier findet sich der Königsgarten. Hier kann man auch die dänischen Kronjuwelwen bewundern.",
                    ImageResID = Resource.Drawable.schlossrosenborg
                }, db);

                var rowTen = insertUpdateDestinationData(new Destination{ ID = 11, Name = string.Format("Die kleine Meerjungfrau", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 2,
                    InterestCulture = 4,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 6,
                    Description = "Die kleine Meerjungfrau - eine Bronzefigur an der Uferprominade von Kopenhagen. Vorbild des gleichnamigen Märchens.",
                    ImageResID = Resource.Drawable.kleinemeerjungfrau
                }, db);

                var rowEleven = insertUpdateDestinationData(new Destination{ ID = 12, Name = string.Format("Wikingermuseum Foteviken", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 1,
                    InterestNature = 2,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 2,
                    VacationTarget = 3,
                    Order = 6,
                    Description = "Museum Foteviken - ein Museum über die Kultur und Geschichte der Wikinger.",
                    ImageResID = Resource.Drawable.wikingermuseum
                }, db);

                var rowTwelve = insertUpdateDestinationData(new Destination{ ID = 13, Name = string.Format("UFO Monument Ängelholm", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 1,
                    InterestNature = 2,
                    InterestCity = 2,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 2,
                    Order = 5,
                    Description = "UFO-Denkmal Ängelholm ist das erste Denkmal an eine vermeintliche UFO-Landung 1963.",
                    ImageResID = Resource.Drawable.ufomonument
                }, db);

                var rowThirteen = insertUpdateDestinationData(new Destination{ ID = 14, Name = string.Format("Pio Country Club", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 2,
                    InterestCity = 1,
                    InterestCulture = 2,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 2,
                    Order = 7,
                    Description = "Der Pio Country Club ist ein empfehlenswertes Restaurant, dass sich auf amerikanische Speisen spezialisiert hat.",
                    ImageResID = Resource.Drawable.piocountryclub
                }, db);

                var rowFourteen = insertUpdateDestinationData(new Destination{ ID = 15, Name = string.Format("Schloss Kronborg", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 3,
                    InterestCulture = 4,
                    InterestEvents = 3,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 5,
                    Description = "Schloss Kronborg auf einer Insel Dänemarks ist durch seine Verbindung zu William Shakesspeare bekannt.",
                    ImageResID = Resource.Drawable.schlosskronborg
                }, db);

                var rowFiveteen = insertUpdateDestinationData(new Destination{ ID = 16, Name = string.Format("Breezanddijk", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 1,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 2,
                    Order = 4,
                    Description = "Breezanddijk ist eine 12 Kilometer lange Straße die von beiden Seiten direkt von Meer umgeben ist.",
                    ImageResID = Resource.Drawable.Breezanddijk
                }, db);

                var rowSixteen = insertUpdateDestinationData(new Destination{ ID = 17, Name = string.Format("Hamburger Hafen", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 3,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 1,
                    Description = "Der Hamburger Hafen, der größte Hafen Deutschlands, wartet mit vielen Events und Einkehrmöglichkeiten auf. ",
                    ImageResID = Resource.Drawable.hamburghafen
                }, db);

                var rowSeventeen = insertUpdateDestinationData(new Destination{ ID = 18, Name = string.Format("Romo", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 4,
                    InterestNature = 4,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 2,
                    InterestSportActivities = 2,
                    VacationTarget = 1,
                    Order = 5,
                    Description = "Romo, die südlichste Insel Dänemarks bietet wunderschöne Dünen und Sandstrände.",
                    ImageResID = Resource.Drawable.romo
                }, db);

                var rowEightteen = insertUpdateDestinationData(new Destination{ ID = 19, Name = string.Format("Naturgewalten Sylt", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 2,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 2,
                    InterestEvents = 3,
                    InterestSportActivities = 2,
                    VacationTarget = 2,
                    Order = 1,
                    Description = "Naturgewalten Sylt, ist ein Veranstaltungs und Ausstellungszentrum in Sylt, dass sich mit Meer- und Küstendynamik beschäftigt.",
                    ImageResID = Resource.Drawable.naturgewaltensylt
                }, db);

                var rowNineteen = insertUpdateDestinationData(new Destination{ ID = 20, Name = string.Format("Sneglehuset", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 1,
                    InterestNature = 2,
                    InterestCity = 2,
                    InterestCulture = 4,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 2,
                    Description = "Das Sneglehuset in Thyboron ist ein Gebäudekomplex dekoriert mit Millionen Schneckenhäusern.",
                    ImageResID = Resource.Drawable.sneglehuset
                }, db);

                var rowTwenty = insertUpdateDestinationData(new Destination{ ID = 21, Name = string.Format("Aarhus", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 2,
                    InterestNature = 1,
                    InterestCity = 4,
                    InterestCulture = 2,
                    InterestEvents = 4,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 4,
                    Description = "Aarhus ist eine Universitätsstadt mit zahlreichen Möglichkeiten zum Weggehen und Spaß haben.",
                    ImageResID = Resource.Drawable.arhus
                }, db);

                var rowTwentyOne = insertUpdateDestinationData(new Destination{ ID = 22, Name = string.Format("Tivoli", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 3,
                    InterestNature = 1,
                    InterestCity = 1,
                    InterestCulture = 2,
                    InterestEvents = 4,
                    InterestSportActivities = 3,
                    VacationTarget = 3,
                    Order = 5,
                    Description = "Der älteste Vergnügungspark der Welt. Bietet neben einer wunderschönen Kulisse auch zahlreiche Möglichkeiten sein Geld zu verschwenden und dabei Spaß zu haben.",
                    ImageResID = Resource.Drawable.tivoli
                }, db);

                var rowTwentyTwo = insertUpdateDestinationData(new Destination{ ID = 23, Name = string.Format("Rubjerg Knude", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 3,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 1,
                    InterestSportActivities = 3,
                    VacationTarget = 4,
                    Order = 3,
                    Description = "Eine Wanderdüne, die einen Leuchtturm verschlingt. Man fühlt sich hier eher wie in der Sahara, als in Dänemark. Vor allem im Sommer.",
                    ImageResID = Resource.Drawable.knuden
                }, db);

                var rowTwentyThree = insertUpdateDestinationData(new Destination{ ID = 24, Name = string.Format("Labyrinthia", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 4,
                    InterestNature = 1,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 3,
                    InterestSportActivities = 2,
                    VacationTarget = 3,
                    Order = 4,
                    Description = "Sieben verschiedene Labyrinte, die man erkunden und aus denen man wieder entkommen muss. In manchen muss man noch dazu Rätsel lösen um weiter zu kommen.",
                    ImageResID = Resource.Drawable.labyrinthia
                }, db);

                var rowTwentyFour = insertUpdateDestinationData(new Destination{ ID = 25, Name = string.Format("Bremen", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 1,
                    InterestNature = 2,
                    InterestCity = 4,
                    InterestCulture = 3,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 1,
                    Description = "Eine deutsche Küstenstadt mit Fachwerkhäusern, die gut erhalten sind. Schöne Stadt zum entspannen und um norddeutsche Kulur kennenzulernen.",
                    ImageResID = Resource.Drawable.bremen
                }, db);

                var rowTwentyFive = insertUpdateDestinationData(new Destination{ ID = 26, Name = string.Format("La Mer", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 2,
                    InterestCulture = 4,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 1,
                    Description = "Ein mit 3 Michelin Sternen ausgezeichnetes Gourmet-Restaurant, das sich auf Meeres-Spezialitäten fokussiert hat. Sehr schönes Ambiente.",
                    ImageResID = Resource.Drawable.lamer
                }, db);

                var rowTwentySix = insertUpdateDestinationData(new Destination{ ID = 27, Name = string.Format("Surf In", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 4,
                    InterestNature = 1,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 4,
                    InterestSportActivities = 4,
                    VacationTarget = 4,
                    Order = 1,
                    Description = "Eine Surfschule an der Nordsee, die sich darauf spezialisiert hat Anfängern möglichst schnell das Surfen beizubringen. Man kann auch nur Ausrüstung ausleihen.",
                    ImageResID = Resource.Drawable.surfin
                }, db);

                var rowTwentySeven = insertUpdateDestinationData(new Destination{ ID = 28, Name = string.Format("Reiterhof Hennings", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 3,
                    InterestNature = 4,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 2,
                    InterestSportActivities = 3,
                    VacationTarget = 1,
                    Order = 1,
                    Description = "Eine Surfschule an der Nordsee, die sich darauf spezialisiert hat Anfängern möglichst schnell das Surfen beizubringen. Man kann auch nur Ausrüstung ausleihen.",
                    ImageResID = Resource.Drawable.reiterhofhennings
                }, db);

                var rowTwentyEight = insertUpdateDestinationData(new Destination{ ID = 29, Name = string.Format("Groningen", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 2,
                    InterestNature = 1,
                    InterestCity = 4,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 2,
                    Description = "Eine uriger Ort, mit einem wunderschönen Hafen, der vor allem Segelboote beherbergt. Bekannt für gutes Essen.",
                    ImageResID = Resource.Drawable.groningen
                }, db);

                var rowTwentyNine = insertUpdateDestinationData(new Destination{ ID = 30, Name = string.Format("Den Helder - Alkmar", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 4,
                    InterestNature = 2,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 1,
                    Order = 2,
                    Description = "Eine anspruchsvolle Fahrradstrecke an der Küste der Niederlande. Die Anstrengung aber alle mal wert.",
                    ImageResID = Resource.Drawable.biketour
                }, db);

                var rowThirty = insertUpdateDestinationData(new Destination{ ID = 31, Name = string.Format("DeBoer Bakkerij", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 4,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 4,
                    Order = 2,
                    Description = "Eine anspruchsvolle Fahrradstrecke an der Küste der Niederlande. Die Anstrengung aber alle mal wert.",
                    ImageResID = Resource.Drawable.boerbakerij
                }, db);

                var rowThirtyOne = insertUpdateDestinationData(new Destination{ ID = 32, Name = string.Format("Esbjerg", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 2,
                    InterestNature = 1,
                    InterestCity = 4,
                    InterestCulture = 3,
                    InterestEvents = 3,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 3,
                    Description = "Eine große Stadt an der Westküste Dänemarks. Die Skulptur 'Mensch am Meer' kann hier besichtigt werden. Auch sonst bietet die Stadt einige Erlebnisse.",
                    ImageResID = Resource.Drawable.esbjerg
                }, db);

                var rowThirtyTwo = insertUpdateDestinationData(new Destination{ ID = 33, Name = string.Format("Herning", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 2,
                    InterestNature = 1,
                    InterestCity = 3,
                    InterestCulture = 2,
                    InterestEvents = 4,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 3,
                    Description = "Eine kulturreiche Stadt in der Mitte Dänemarks. Bietet einige Museen und ein modernes Ambiente.",
                    ImageResID = Resource.Drawable.Herning
                }, db);

                var rowThirtyThree = insertUpdateDestinationData(new Destination{ ID = 34, Name = string.Format("Moesgard Museum", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 3,
                    InterestNature = 4,
                    InterestCity = 2,
                    InterestCulture = 1,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 4,
                    Description = "Zahllose riesige Allen mit hunderten verschiedener Arten an Bäumen und Pflanzen werden zu einem wunderschönen Gesamt-Bild.",
                    ImageResID = Resource.Drawable.moesgardmuseum
                }, db);

                var rowThirtyFour = insertUpdateDestinationData(new Destination{ ID = 35, Name = string.Format("Tuno Trip", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 3,
                    InterestNature = 2,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 4,
                    VacationTarget = 1,
                    Order = 4,
                    Description = "Eine Fahrradtour rund um die Insel Tuno. Flaches Terrain, aber ein schöner, weitreichender Ausblick.",
                    ImageResID = Resource.Drawable.tunotrip
                }, db);

                var rowThirtyFive = insertUpdateDestinationData(new Destination{ ID = 36, Name = string.Format("Restaurant Miro", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 3,
                    InterestCulture = 2,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 4,
                    Order = 4,
                    Description = "Restaurant in der Mitte Aarhus mit feinen Speißen. Hat sich auf Essen spezialisiert, dass frisch und oft nicht gekocht ist.",
                    ImageResID = Resource.Drawable.miro
                }, db);

                var rowThirtySix = insertUpdateDestinationData(new Destination{ ID = 37, Name = string.Format("SegWorld", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 3,
                    InterestNature = 1,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 2,
                    InterestSportActivities = 3,
                    VacationTarget = 2,
                    Order = 4,
                    Description = "Der erste und einzige SegWay Vergnügungspark. Mit SegWays fahren, hüpfen, essen ...",
                    ImageResID = Resource.Drawable.segworld
                }, db);

                var rowThirtySeven = insertUpdateDestinationData(new Destination{ ID = 38, Name = string.Format("Restaurant Kok & Vin", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 2,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 5,
                    Description = "Ein gehobenes Restaurant, das sich auf mittelalterliche Küche spezialisiert hat.",
                    ImageResID = Resource.Drawable.kokvin
                }, db);

                var rowThirtyEight = insertUpdateDestinationData(new Destination{ ID = 39, Name = string.Format("Insel Fünen", System.DateTime.Now.Ticks),
                    Standards = 2,
                    IsActive = 4,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 3,
                    InterestSportActivities = 4,
                    VacationTarget = 1,
                    Order = 5,
                    Description = "Im dänischen Südmeer gelegen ist diese Insel bekannt für ihre zahlreichen Sport-Events und -Aktivitäten.",
                    ImageResID = Resource.Drawable.funenarchipel
                }, db);

                var rowFourty = insertUpdateDestinationData(new Destination{ ID = 41, Name = string.Format("Amager Strandpark", System.DateTime.Now.Ticks),
                    Standards = 1,
                    IsActive = 3,
                    InterestNature = 4,
                    InterestCity = 1,
                    InterestCulture = 3,
                    InterestEvents = 3,
                    InterestSportActivities = 2,
                    VacationTarget = 4,
                    Order = 6,
                    Description = "Der größte Strand in der Nähe Kopenhagens mit anschliessendem Park. Ist ein Naturschutzgebiet, aber für viele sportliche Aktivitäten freigegeben.",
                    ImageResID = Resource.Drawable.amagerstrandpark
                }, db);

                var rowFourtyOne = insertUpdateDestinationData(new Destination{ ID = 42, Name = string.Format("Dänisches Nationalmuseum", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 2,
                    InterestNature = 1,
                    InterestCity = 3,
                    InterestCulture = 3,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 6,
                    Description = "Ausstellung über die Geschichte und Fortentwicklung der dänischen und nordischen Kultur. In der Stadtmitte von Kopenhagen.",
                    ImageResID = Resource.Drawable.denmarknationalmusem
                }, db);

                var rowFourtyTwo = insertUpdateDestinationData(new Destination{ ID = 43, Name = string.Format("Restaurant Noma", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 1,
                    InterestNature = 1,
                    InterestCity = 2,
                    InterestCulture = 2,
                    InterestEvents = 1,
                    InterestSportActivities = 1,
                    VacationTarget = 3,
                    Order = 6,
                    Description = "Restaurant in Brygge, dass sich auf die moderne Neuinterpretation regionaler Gerichte spezialisiert hat.",
                    ImageResID = Resource.Drawable.nomarestaurant
                }, db);

                var rowFourtyThree = insertUpdateDestinationData(new Destination{ ID = 44, Name = string.Format("Passebækgård Golf", System.DateTime.Now.Ticks),
                    Standards = 4,
                    IsActive = 4,
                    InterestNature = 3,
                    InterestCity = 1,
                    InterestCulture = 1,
                    InterestEvents = 4,
                    InterestSportActivities = 4,
                    VacationTarget = 2,
                    Order = 6,
                    Description = "Ein auf Nord Zeeland gelegener Park inklusive riesigem Golfplatz, der als einer der schönsten ganz Dänemarks gilt.",
                    ImageResID = Resource.Drawable.passebaekgardgolf
                }, db);

                var rowFourtyFour = insertUpdateDestinationData(new Destination{ ID = 45, Name = string.Format("Fisketorvet", System.DateTime.Now.Ticks),
                    Standards = 3,
                    IsActive = 2,
                    InterestNature = 1,
                    InterestCity = 4,
                    InterestCulture = 1,
                    InterestEvents = 3,
                    InterestSportActivities = 1,
                    VacationTarget = 1, // because shopping is so strenous. ;-P
                    Order = 6,
                    Description = "Kopenhagens größte Shopping-Mall. Hier gibt es alles was das Herz begehrt. Und noch mehr. Für einen Preis.",
                    ImageResID = Resource.Drawable.fisketorvet
                }, db);

                Log.Info (Tag, "Destination DB updated");
            }
        }
예제 #26
0
        private static void InsertText(SQLiteConnection db)
        {
            db.DeleteAll<SayText>();
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 1,
                From = 0,
                To = 25,
                Parametter = (int)ParameterEnum.Health,
                Text = "I'm feeling\n very \nvery sick! :("
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 2,
                From = 25,
                To = 50,
                Parametter = (int)ParameterEnum.Health,
                Text = "Please take\n me to doctor!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 3,
                From = 50,
                To = 75,
                Parametter = (int)ParameterEnum.Health,
                Text = "An apple\n or watter\n would be nice!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 4,
                From = 75,
                To = 100,
                Parametter = (int)ParameterEnum.Health,
                Text = "I've feel\n very healthy!\n :) Thank you!"
            });

            db.InsertOrReplace(new SayText()
            {
                SayTextId = 5,
                From = 0,
                To = 25,
                Parametter = (int)ParameterEnum.Hunger,
                Text = "I could\n eat a horse!\n PLEASE FEED ME!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 6,
                From = 25,
                To = 50,
                Parametter = (int)ParameterEnum.Hunger,
                Text = "I want\n a burger!!\n NOW!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 7,
                From = 50,
                To = 75,
                Parametter = (int)ParameterEnum.Hunger,
                Text = "I would\n like\n something\n to eat, Please! ;)"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 8,
                From = 75,
                To = 100,
                Parametter = (int)ParameterEnum.Hunger,
                Text = "Thank you\n for feeding me,\n I Love YOU! :)"
            });

            db.InsertOrReplace(new SayText()
            {
                SayTextId = 9,
                From = 0,
                To = 25,
                Parametter = (int)ParameterEnum.Discipline,
                Text = "A. B..\n bebe\n boom \nbaam!!!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 10,
                From = 25,
                To = 50,
                Parametter = (int)ParameterEnum.Discipline,
                Text = "Read me a\n story, PLEASE!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 11,
                From = 50,
                To = 75,
                Parametter = (int)ParameterEnum.Discipline,
                Text = "I'm smart! :)"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 12,
                From = 75,
                To = 100,
                Parametter = (int)ParameterEnum.Discipline,
                Text = "In future\n I will be\n a rocket scientist!"
            });

            db.InsertOrReplace(new SayText()
            {
                SayTextId = 13,
                From = 0,
                To = 25,
                Parametter = (int)ParameterEnum.Energy,
                Text = "No..\n more..\n energy..\n"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 14,
                From = 25,
                To = 50,
                Parametter = (int)ParameterEnum.Energy,
                Text = "Sleep,\n I feel\n so sleepy!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 15,
                From = 50,
                To = 75,
                Parametter = (int)ParameterEnum.Energy,
                Text = "Let's play,\n let's do\n something!!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 16,
                From = 75,
                To = 100,
                Parametter = (int)ParameterEnum.Energy,
                Text = "WOOHOO!!!\n PARTY!!\n - I'm\n full of energy!"
            });

            db.InsertOrReplace(new SayText()
            {
                SayTextId = 17,
                From = 0,
                To = 25,
                Parametter = (int)ParameterEnum.Hygene,
                Text = "Ogh,\n whats that smell?\n Oh, it's me.\n CLEAN ME!!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 18,
                From = 25,
                To = 50,
                Parametter = (int)ParameterEnum.Hygene,
                Text = "I need a bath..."
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 19,
                From = 50,
                To = 75,
                Parametter = (int)ParameterEnum.Hygene,
                Text = "Hygene\n is very important,\n and I know it!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 20,
                From = 75,
                To = 100,
                Parametter = (int)ParameterEnum.Hygene,
                Text = "I feel\n clean like a unicorn!\n ^^"
            });

            db.InsertOrReplace(new SayText()
            {
                SayTextId = 21,
                From = 0,
                To = 25,
                Parametter = (int)ParameterEnum.Mood,
                Text = "I feel so lonely...\n I have nobody.. ;("
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 22,
                From = 25,
                To = 50,
                Parametter = (int)ParameterEnum.Mood,
                Text = "Wanna be fiends?\n Let's play!"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 23,
                From = 50,
                To = 75,
                Parametter = (int)ParameterEnum.Mood,
                Text = "This is fun!!\n I feel good! :D"
            });
            db.InsertOrReplace(new SayText()
            {
                SayTextId = 24,
                From = 75,
                To = 100,
                Parametter = (int)ParameterEnum.Mood,
                Text = "Today is a\n great day! Sun is shining\n ..and me to!"
            });
        }
        //-----------sets the tag in the user.cs for further utilization in the application---------//
        protected void settingTags()
        {
            var db = new SQLiteConnection (dbPath);
            var rowCount = db.Table<User> ().Count ();

            if (rowCount > 2) {
                db.DeleteAll<User> ();
            }

            if (!hasInserted) {
                Log.Info (Tag, "libber");
                var result = insertUpdateData(new User{ ID = 1, FirstName = string.Format("xxxxx", System.DateTime.Now.Ticks),
                    LastName = "Smith",
                    Standards = hasStandards,
                }, db);
                hasInserted = true;
            } else {
                var rowcount = db.Delete(new User(){ID=1});
                settingTags ();
            }
        }
예제 #28
0
        private void InsertCustomerIntoDb(List<Customer> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                //var list2 = db.Table<Trader>().ToList<Trader>();
                db.DeleteAll<Trader> ();// (list2);
                foreach (Customer item in list) {
                    Trader itm = new Trader ();
                    itm.CustCode = item.CustomerCode;
                    itm.CustName = item.CustomerName;
                    itm.Addr1 = item.Addr1;
                    itm.Addr2 = item.Addr2;
                    itm.Addr3 = item.Addr3;
                    itm.Addr4 = item.Addr4;
                    itm.Tel = item.Tel;
                    itm.Fax = item.Fax;
                    itm.gst = item.Gst;
                    itm.PayCode = item.PayCode;
                    itm.CustType = item.CustType;
                    itm.AgentCode = item.ExtraInfo;

                    db.Insert (itm);
            //					if (list2.Where (x => x.CustCode == itm.CustCode).ToList ().Count () == 0) {
            //						db.Insert (itm);
            //					} else {
            //						db.Update (itm);
            //					}
                }
            }

            string dmsg = CallingActivity.Resources.GetString (Resource.String.msg_successdowncusts);
            dmsg = dmsg.Replace ("nn", list.Count.ToString ());

            if (_downloadAll) {
                FireEvent (EventID.LOGIN_DOWNCOMPLETE);
                DownloadAllhandle.Invoke(CallingActivity,list.Count,dmsg);
            }else Downloadhandle.Invoke(CallingActivity,list.Count,dmsg);
        }
예제 #29
0
        //public bool TransactionGroupDelete(List<T> entities)
        //{
        //    lock (m_lock)
        //    {
        //        bool ok = true;

        //        try
        //        {
        //            _db.BeginTransaction();

        //            foreach (var entity in entities)
        //            {
        //                _db.Delete<T>(entity);
        //            }

        //            _db.Commit();
        //        }
        //        catch (Exception e)
        //        {
        //            _db.Rollback();
        //            ok = false;
        //            throw new Exception(e.Message);
        //        }

        //        return ok;
        //    }
        //}

        //public bool GroupInsert(List<T> entities)
        //{
        //    lock (m_lock)
        //    {
        //        bool ok = true;

        //        try
        //        {
        //            _db.BeginTransaction();

        //            foreach (var item in entities)
        //            {
        //                _db.Insert(item);
        //            }

        //            _db.Commit();
        //        }
        //        catch (Exception)
        //        {
        //            _db.Rollback();
        //            ok = false;
        //        }

        //        return ok;
        //    }
        //}

        public int DeleteAll()
        {
            return(_db.DeleteAll <T>());
        }
예제 #30
0
파일: scheda.cs 프로젝트: frungillo/vegetha
        public static void Trunk()
        {
            string dbPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "cust.db");

            var db = new SQLiteConnection (dbPath);
            db.DeleteAll<schede> ();
        }
예제 #31
0
        private void InsertItemIntoDb(List<ItemCode> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll<Item> ();
                foreach (ItemCode item in list) {
                    Item itm = new Item ();
                    itm.ICode = item.ICode;
                    itm.IDesc = item.IDesc;
                    itm.Price = item.Price;
                    itm.tax = item.tax;
                    itm.taxgrp = item.taxgrp;
                    itm.isincludesive = item.isincludesive;
                    db.Insert (itm);
            //					var itemlist = list2.Where (x => x.ICode == itm.ICode).ToList ();
            //					if (itemlist.Count () == 0) {
            //						db.Insert (itm);
            //					} else {
            //						itm = itemlist [0];
            //						itm.IDesc = item.IDesc;
            //						itm.Price = item.Price;
            //						itm.tax = item.tax;
            //						itm.taxgrp = item.taxgrp;
            //						itm.isincludesive = item.isincludesive;
            //
            //						db.Update (itm);
            //					}
                }
            }

            if (_downloadAll) {
                _downloadItem = true;
                DownloadAllhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded"+list.Count.ToString()+"Item(s).");
                FireEvent (EventID.DOWNLOADED_ITEM);
            }
            else Downloadhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded"+list.Count.ToString()+"Item(s).");
        }
예제 #32
0
        private void InsertCustomerIntoDb(List<Customer> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                //var list2 = db.Table<Trader>().ToList<Trader>();
                db.DeleteAll<Trader> ();// (list2);
                foreach (Customer item in list) {
                    Trader itm = new Trader ();
                    itm.CustCode = item.CustomerCode;
                    itm.CustName = item.CustomerName;
                    itm.Addr1 = item.Addr1;
                    itm.Addr2 = item.Addr2;
                    itm.Addr3 = item.Addr3;
                    itm.Addr4 = item.Addr4;
                    itm.Tel = item.Tel;
                    itm.Fax = item.Fax;
                    itm.gst = item.Gst;
                    itm.PayCode = item.PayCode;

                    db.Insert (itm);
            //					if (list2.Where (x => x.CustCode == itm.CustCode).ToList ().Count () == 0) {
            //						db.Insert (itm);
            //					} else {
            //						db.Update (itm);
            //					}
                }
            }

            if (_downloadAll) {
                FireEvent (EventID.LOGIN_DOWNCOMPLETE);
                DownloadAllhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded "+list.Count.ToString()+" customer(s).");
            }else Downloadhandle.Invoke(CallingActivity,list.Count,"Successfully downloaded "+list.Count.ToString()+" customer(s).");
        }
예제 #33
0
 void ClearPostedInv()
 {
     CompanyInfo para = DataHelper.GetCompany (pathToDatabase);
     if (!para.AllowClrTrxHis) {
         Toast.MakeText (this, Resources.GetString(Resource.String.msg_accessdenied), ToastLength.Long).Show ();
         return;
     }
     using (var db = new SQLite.SQLiteConnection(pathToDatabase))
     {
         db.DeleteAll<InvoiceDtls> ();
         db.DeleteAll<Invoice> ();
         db.DeleteAll<CNNoteDtls> ();
         db.DeleteAll<CNNote> ();
         Toast.MakeText (this,Resources.GetString(Resource.String.msg_trxclear), ToastLength.Long).Show ();
     }
 }
예제 #34
0
        private void InsertItemIntoDb(List<ItemCode> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll<Item> ();
                foreach (ItemCode item in list) {
                    Item itm = new Item ();
                    itm.ICode = item.ICode;
                    itm.IDesc = item.IDesc;
                    itm.Price = item.Price;
                    itm.tax = item.tax;
                    itm.taxgrp = item.taxgrp;
                    itm.isincludesive = item.isincludesive;
                    itm.RetailPrice = item.RetailPrice;
                    itm.VIPPrice = item.VIPPrice;
                    itm.WholeSalePrice = item.WholesalePrice;
                    itm.Barcode = item.Barcode;
                    itm.StdUom = item.UOM;
                    itm.Class = item.IClass;
                    itm.ImageFilename = item.ImageName;
                    db.Insert (itm);
                }
            }

            string dmsg = CallingActivity.Resources.GetString (Resource.String.msg_successdownitems);
            dmsg = dmsg.Replace ("nn", list.Count.ToString ());

            if (_downloadAll) {
                _downloadItem = true;
                DownloadAllhandle.Invoke(CallingActivity,list.Count,dmsg);
                FireEvent (EventID.DOWNLOADED_ITEM);
            }
            else Downloadhandle.Invoke(CallingActivity,list.Count,dmsg);
        }
예제 #35
0
 public void CreateDB()
 {
   
     string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "carrito.db3");
     var db = new SQLiteConnection(dbPath);
     db.CreateTable<SQProduct>();
     db.DeleteAll<SQProduct>();
     
     
 }
예제 #36
0
		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello SQLite-net Data!");

			/*
			//Get the path to the folder where the database is stored.
			// Notes: The Path class performs operations on strings that contain file path info
			//        Path.Combine appends the second path to the first path
			//        Environment.GetSpecialFolderPath gets the path to special pre-defined folders
			//              on Windows, the SpecialFolder enum defines: ProgramFiles, System, AppData, etc.
			//              on Android ...
			string dbPath = Path.Combine (
				Environment.GetFolderPath (Environment.SpecialFolder.Personal), "stocks.db3");
			*/

			/*
			// Check for an existing db file and only create a new one if it doesn't exist
			bool exists = File.Exists (dbPath);
			if (!exists) {
				// Need to create the database and seed it with some data.
				SQLiteConnection.CreateFile (dbPath);
			*/

			// We're using a file in Assets instead of the one defined above
			//string dbPath = Directory.GetCurrentDirectory ();
			string dbPath = @"../../../DataAccess-Android/Assets/stocks.db3";
			var db = new SQLiteConnection (dbPath);

			// Create a Stocks table
			//if (db.CreateTable (Mono.CSharp.TypeOf(Stock)) != 0) 
				db.DropTable<Stock>();
			if (db.CreateTable<Stock>() == 0)
			{
				// A table already exixts, delete any data it contains
				db.DeleteAll<Stock> ();
			}

			// Create a new stock and insert it into the database
			var newStock = new Stock ();
			newStock.Symbol = "APPL";
			newStock.Name = "Apple";
			newStock.ClosingPrice = 93.22m;
			int numRows = db.Insert (newStock);
			Console.WriteLine ("Number of rows inserted = {0}", numRows);

			// Insert some more stocks
				db.Insert(new Stock() {Symbol = "MSFT", Name = "Microsoft", ClosingPrice = 55.25m});
				db.Insert (new Stock() {Symbol = "GOOG", Name = "Google", ClosingPrice = 15.25m});
				db.Insert (new Stock() {Symbol = "SSNLF", Name = "Samsung", ClosingPrice = 25.25m});
				db.Insert (new Stock() {Symbol = "AMZN", Name = "Amazon", ClosingPrice = 35.25m});
				db.Insert (new Stock() {Symbol = "MMI", Name = "Motorola Mobility", ClosingPrice = 45.25m});
				db.Insert (new Stock() {Symbol = "FB", Name = "Facebook", ClosingPrice = 65.25m});

			// Read the stock from the database
			// Use the Get method with a query expression
			Stock singleItem = db.Get<Stock> (x => x.Name == "Google");
			Console.WriteLine ("Stock Symbol for Google: {0}", singleItem.Symbol);

			singleItem = db.Get<Stock> (x => x.ClosingPrice >= 30.0m);
				Console.WriteLine ("First stock priced at or over 30: {0}, price: {1}",
									singleItem.Symbol, singleItem.ClosingPrice);
			

				// Use the Get method with a primary key
			singleItem = db.Get<Stock> ("FB");
			Console.WriteLine ("Stock Name for Symbol FB: {0}", singleItem.Symbol);

			// Query using  SQL
			var stocksStartingWithA = db.Query<Stock> ("SELECT * FROM Stocks WHERE Symbol LIKE ?", "A%"); 
			foreach(Stock stock in stocksStartingWithA)
				Console.WriteLine ("Stock starting with A: {0}", stock.Symbol);

			// Query using Linq
			var stocksStartingWithM = from s in db.Table<Stock> () where s.Symbol.StartsWith ("M") select s;
			foreach(Stock stock in stocksStartingWithM)
				Console.WriteLine ("Stock starting with M: {0}", stock.Symbol);


		}
예제 #37
0
        private void InsertItemPriceIntoDb(List<ItemLastPrice> list)
        {
            string pathToDatabase = ((GlobalvarsApp)CallingActivity.Application).DATABASE_PATH;
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
                //var list2 = db.Table<Item>().ToList<Item>();
                db.DeleteAll<ItemPrices> ();
                int id = 1;
                foreach (ItemLastPrice item in list) {
                    ItemPrices itm = new ItemPrices ();
                    itm.ID = id;
                    itm.ICode = item.ICode;
                    itm.IDesc = item.IDesc;
                    itm.Price = item.Price;
                    itm.CustCode = item.CustCode;
                    itm.CustName = item.CustName;
                    itm.InvDate = item.InvDate;
                    if (string.IsNullOrEmpty (item.IClass))
                        itm.IClass = "";
                    else
                        itm.IClass = item.IClass;

                    db.Insert (itm);
                    id = id + 1;
                }
            }

            string dmsg = CallingActivity.Resources.GetString (Resource.String.msg_successdownitems);
            dmsg = dmsg.Replace ("nn", list.Count.ToString ());

            Downloadhandle.Invoke(CallingActivity,list.Count,dmsg);
        }
예제 #38
0
		public string DropTableMessage()
		{
			try
			{
				string dbPath = System.IO.Path.Combine(Environment.GetFolderPath
					(Environment.SpecialFolder.Personal),"ormDMS.db3");
				var db = new SQLiteConnection(dbPath);
				db.DeleteAll<TableMessages>();
				string result = "delete";
				return result;
			}
			catch (Exception ex)
			{
				return "Erreur : " + ex.Message;

			}
		}