当前位置: 首页>>代码示例>>C#>>正文


C# SQLite.SQLiteConnection.Table方法代码示例

本文整理汇总了C#中SQLite.SQLiteConnection.Table方法的典型用法代码示例。如果您正苦于以下问题:C# SQLite.SQLiteConnection.Table方法的具体用法?C# SQLite.SQLiteConnection.Table怎么用?C# SQLite.SQLiteConnection.Table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLite.SQLiteConnection的用法示例。


在下文中一共展示了SQLite.SQLiteConnection.Table方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSingleCollection

        public SingleCollectionViewModel GetSingleCollection(int collectionId)
        {
            SingleCollectionViewModel collection = new SingleCollectionViewModel();

            using (var db = new SQLite.SQLiteConnection(app.DBPath))
            {
                var _collection = (db.Table<Collection>().Where(
                    c => c.Id == collectionId)).FirstOrDefault();
                collection.Id = _collection.Id;
                collection.Title = _collection.Title;
                collection.DateCreated = _collection.DateCreated;
                collection.Void = _collection.Void;

                // GET ALBUMS
                var _albums = (db.Table<Album>().Where(
                    c => c.CollectionId == collectionId)).ToList();

                List<lfm> albumList = new List<lfm>();
                foreach (var _album in _albums)
                {
                    lfm album = LastGetAlbum(_album.MusicBrainzId);
                    albumList.Add(album);
                }
                collection.Albums = albumList;
            }
            return collection;
        }
开发者ID:Narelle,项目名称:MusicCollection,代码行数:27,代码来源:SingleCollectionViewModel.cs

示例2: GetInvoicePrintStatus

 public static bool GetInvoicePrintStatus(string pathToDatabase,string invno)
 {
     bool iSPrinted = false;
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         var info = db.Table<CompanyInfo> ().FirstOrDefault ();
         if (info.NotEditAfterPrint) {
             var list = db.Table<Invoice> ().Where (x => x.invno == invno).ToList ();
             if (list.Count > 0) {
                 iSPrinted = list [0].isPrinted;
             }
         }
     }
     return iSPrinted;
 }
开发者ID:mokth,项目名称:merpV2Production,代码行数:14,代码来源:DataHelper.cs

示例3: GetDelOderPrintStatus

 public static bool GetDelOderPrintStatus(string pathToDatabase,string dono,string comp,string bran )
 {
     bool iSPrinted = false;
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         var info = db.Table<CompanyInfo> ().Where(x=>x.CompCode==comp&&x.BranchCode==bran).FirstOrDefault ();
         if (info.NotEditAfterPrint) {
             var list = db.Table<DelOrder> ().Where (x => x.dono == dono&&x.CompCode==comp&&x.BranchCode==bran).ToList ();
             if (list.Count > 0) {
                 iSPrinted = list [0].isPrinted;
             }
         }
     }
     return iSPrinted;
 }
开发者ID:mokth,项目名称:merpCS,代码行数:14,代码来源:DataHelper.cs

示例4: UpdateInvoiceAmount

 public void UpdateInvoiceAmount(string invno)
 {
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         var itemlist = db.Table<InvoiceDtls> ().Where (x => x.invno == invno);
         double ttlamt= itemlist.Sum (x => x.netamount);
         double ttltax= itemlist.Sum (x => x.tax);
         var invlist =db.Table<Invoice> ().Where (x => x.invno == invno).ToList<Invoice> ();
         if (invlist.Count > 0) {
             invlist [0].amount = ttlamt;
             invlist [0].taxamt = ttltax;
             db.Update (invlist [0]);
         }
     }
 }
开发者ID:mokth,项目名称:merpCS,代码行数:14,代码来源:InvItemActivity.cs

示例5: butSaveClick

 private void butSaveClick(object sender,EventArgs e)
 {
     TextView txtprinter =FindViewById<TextView> (Resource.Id.txtad_printer);
     TextView txtprefix =FindViewById<TextView> (Resource.Id.txtad_prefix);
     TextView txttitle =FindViewById<TextView> (Resource.Id.txtad_title);
     pathToDatabase = ((GlobalvarsApp)this.Application).DATABASE_PATH;
     AdPara apra = new AdPara ();
     apra.Prefix = txtprefix.Text.ToUpper();
     apra.PrinterName = txtprinter.Text.ToUpper();
     using (var db = new SQLite.SQLiteConnection(pathToDatabase))
     {
         var list  = db.Table<AdPara> ().ToList<AdPara> ();
         if (list.Count == 0) {
             db.Insert (apra);
         } else {
             apra = list [0];
             apra.Prefix = txtprefix.Text.ToUpper();
             apra.PrinterName = txtprinter.Text.ToUpper();
             apra.PaperSize = spinner.SelectedItem.ToString ();
             apra.ReceiptTitle =txttitle.Text.ToUpper();
             db.Update (apra);
         }
     }
     base.OnBackPressed();
 }
开发者ID:mokth,项目名称:merpV2Production,代码行数:25,代码来源:SettingActivity.cs

示例6: RemptionLoaded

        private void RemptionLoaded(object sender, RoutedEventArgs e)
        {
            try
            {
                var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, "Shopping.db3");

                using (var db = new SQLite.SQLiteConnection(path))
                {
                    var a = from x in db.Table<ShopLists>() where x.AdminName == AdminName && x.Condition == 1 select x;
                    //MessageBox.Show(a.Count().ToString());

                    foreach (var v in a)
                    {
                        RedemptionShopList.Add(v);
                    }

                }

                RedemptionList.ItemsSource = RedemptionShopList;
            }
            catch
            {

            }
        }
开发者ID:prabaprakash,项目名称:Visual-Studio-2013,代码行数:25,代码来源:Report.xaml.cs

示例7: GetMeals

        public ObservableCollection<MealViewModel> GetMeals()
        {
            meals = new ObservableCollection<MealViewModel>();
            using (var db = new SQLite.SQLiteConnection(App.DBPath))
            {
                var query = db.Table<Meal>().OrderBy(c => c.Name);
                foreach (var _meal in query)
                {
                    var meal = new MealViewModel()
                    {
                        Id = _meal.Id,
                        DeliveryNoteId = _meal.DeliveryNoteId,
                        Name = _meal.Name,
                        DeliveryDate = _meal.DeliveryDate,
                        DeliveryTime = _meal.DeliveryTime,
                        DeliveryLocation = _meal.DeliveryLocation,
                        PickupDate = _meal.PickupDate,
                        Contact = _meal.Contact,
                        ContactId = _meal.ContactId,
                        NumberOfGuests = _meal.NumberOfGuests,
                        SilverWare = _meal.SilverWare,
                        MealItemIDs = (List<int>)_converter.ConvertBack(_meal.MealItemIDs, null, null, ""),
                        MealItemIDsWithWeight = (Dictionary<float,float>)_dictionaryConverterFloat.ConvertBack(_meal.MealItemIDsWithWeight, null, null, "")
                    };

                    meals.Add(meal);
                }
            }

            return meals;
        }
开发者ID:mhebestadt,项目名称:CateringKingCalculator,代码行数:31,代码来源:MealsViewModel.cs

示例8: Connection

        public static SQLite.SQLiteConnection Connection()
        {
            var conn = new SQLite.SQLiteConnection(DBPath);
            if (!Initialized)
            {
                conn.CreateTable<Car.Car>();
                conn.CreateTable<Fillup.Fillup>();
                conn.CreateTable<Maintenance.Maintenance>();
                conn.CreateTable<Reminder.Reminder>();

                var cars = conn.Table<Car.Car>();

                if (cars.Count() == 0)
                {
                    Car.Car car = new Car.Car();
                    conn.Insert(car);
                }

                var firstCar = cars.First();

                if (cars.Where(vehicle => vehicle.ID == Settings.CurrentCarID).Count() == 0)
                    Settings.CurrentCarID = firstCar.ID;




                Initialized = true;
            }
            return conn;
        }
开发者ID:BenjaminChambers,项目名称:Open-Road,代码行数:30,代码来源:Database.cs

示例9: Page

		public IPage<Artist> Page(ICriteria<Artist> criteria) {
			using (var cn = new SQLite.SQLiteConnection(_dbConnectionString)) {
				var query = cn.Table<Artist>().AsQueryable();

				if (criteria.Keywords.Any()) {
					criteria.Keywords.ToList().ForEach(word => query = query.Where(a => a.Name.ToLower().Contains(word.ToLower())));
				}

				var totalRecords = query.Count();

				if (criteria.SortBy.Any()) {
					foreach (var kvp in criteria.SortBy) {
						switch (kvp.Value) {
							case ListSortDirection.Ascending:
								query = query.OrderBy(kvp.Key);
								break;
							case ListSortDirection.Descending:
								query = query.OrderBy(kvp.Key + " descending");
								break;
						}
					}
				}

				if (criteria.Page.HasValue) {
					query = query.Skip((criteria.Page.Value - 1) * criteria.PageSize.GetValueOrDefault());
				}

				if (criteria.PageSize.HasValue) {
					query = query.Take(criteria.PageSize.Value);
				}

				return new Page<Artist>(criteria.Page ?? 0, criteria.PageSize ?? totalRecords, totalRecords, query.ToList());
			}
		}
开发者ID:dealproc,项目名称:HalWithNancy,代码行数:34,代码来源:ArtistRepository.cs

示例10: GetCompany

 public static CompanyInfo GetCompany(string pathToDatabase)
 {
     CompanyInfo info = null;
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         info = db.Table<CompanyInfo> ().FirstOrDefault ();
     }
     return info;
 }
开发者ID:mokth,项目名称:merpV2Production,代码行数:8,代码来源:DataHelper.cs

示例11: GetCompany

 //        public static CompanyInfo GetCompany(string pathToDatabase)
 //        {
 //            CompanyInfo info = null;
 //            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
 //                info = db.Table<CompanyInfo> ().FirstOrDefault ();
 //            }
 //            return info;
 //        }
 public static CompanyInfo GetCompany(string pathToDatabase,string compCode, string branCode)
 {
     CompanyInfo info = null;
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         info = db.Table<CompanyInfo> ().Where(x=>x.CompCode==compCode&&x.BranchCode==branCode).FirstOrDefault ();
     }
     return info;
 }
开发者ID:mokth,项目名称:merpCS,代码行数:16,代码来源:DataHelper.cs

示例12: LoadLocalDataAsync

        public static async Task LoadLocalDataAsync()
        {
            try
            {
                using (var db = new SQLite.SQLiteConnection(app.DBPath))
                {
                    var wordGroupQuery = db.Table<WordGroup>().OrderBy(groupItem => groupItem.GroupName);
                    var wordItemQuery = db.Table<WordDetails>().OrderBy(wordItem => wordItem.WordKey);

                    foreach (var group in wordGroupQuery)
                    {
                        if (!_wordDataSource._allGroups.Any(item => item.GroupName.Equals(group.GroupName)))
                        {
                            _wordDataSource.AllGroups.Add(new WordDataGroup() { GroupName = group.GroupName });
                        }
                    }

                    string lastGroupName = string.Empty;
                    WordDataDetail wordDataDetail;
                    int index = 0;
                    foreach (var item in wordItemQuery)
                    {
                        if (!lastGroupName.Equals(item.GroupName))
                        {
                            index = (int)item.GroupName[0] - Constants.AsciiValueOfA;
                        }
                        wordDataDetail = new WordDataDetail();

                        wordDataDetail.AntonymId = item.AntonymId;
                        wordDataDetail.DateModified = item.DateModified;
                        wordDataDetail.Definition = new Definitions() { DefinitionAdverb = item.DefinitionAdverb, DefinitoinAdjective = item.DefinitionAdjective, DefinitionNoun = item.DefinitionNoun, DefinitionVerb = item.DefinitionVerb };
                        wordDataDetail.Group = _wordDataSource._allGroups[index];
                        wordDataDetail.Mnemonics = item.Mnemonics;
                        wordDataDetail.Root = item.Root;
                        wordDataDetail.Sentence = item.Sentence;
                        wordDataDetail.WordKey = item.WordKey;
                        wordDataDetail.WordName = item.WordName;
                        wordDataDetail.BaseName = item.BaseName;

                        _wordDataSource._allGroups[index].Items.Add(wordDataDetail);
                    }
                }
            }
            catch (Exception ex) { }
        }
开发者ID:prateek-pradeep,项目名称:VCBBuilder,代码行数:45,代码来源:WordDataSource.cs

示例13: RangingVC

		public RangingVC (IntPtr handle) : base (handle)
		{
			SetUpHue ();



			//set up sqlite db
			var documents = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
			_pathToDatabase = Path.Combine (documents, "db_sqlite-net.db");

			region = new CLBeaconRegion (AppDelegate.BeaconUUID, "BeaconSample");//ushort.Parse ("26547"), ushort.Parse ("56644"),
			region.NotifyOnEntry = true;
			region.NotifyOnExit = true;

			locationManager = new CLLocationManager ();
			locationManager.RequestWhenInUseAuthorization ();

			locationManager.DidRangeBeacons += (object sender, CLRegionBeaconsRangedEventArgs e) => {
				if (e.Beacons.Length > 0) {

					CLBeacon beacon = e.Beacons [0];

					switch (beacon.Proximity) {
					case CLProximity.Immediate:
						SetImmediateColor();
						message = "Immediate";
						break;
					case CLProximity.Near:
						message = "Near";
						SetNearColor();
						break;
					case CLProximity.Far:
						message = "Far";
						SetFarColor();
						break;
					case CLProximity.Unknown:
						message = "Unknown";
						SetUnknownColor();
						break;
					}

					if (previousProximity != beacon.Proximity) {
						Console.WriteLine (message);
					}
					previousProximity = beacon.Proximity;
				}

			};

			locationManager.StartRangingBeacons (region);

			var db = new SQLite.SQLiteConnection (_pathToDatabase);
			var bridgeIp = db.Table<HueBridge> ().ToArray ();
			client = new LocalHueClient (bridgeIp [0].HueBridgeIpAddress);
			client.Initialize ("pooberry");
		}
开发者ID:IanLeatherbury,项目名称:MonkeyBeacon,代码行数:56,代码来源:RangingViewController.cs

示例14: populate

        void populate(List<SaleOrderDtls> list)
        {
            comp = DataHelper.GetCompany (pathToDatabase);
            //SqliteConnection.CreateFile(pathToDatabase);
            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                var list1 = db.Table<SaleOrder>().Where(x=>x.sono==invno).ToList<SaleOrder>();
                var list2 = db.Table<SaleOrderDtls>().Where(x=>x.sono==invno).ToList<SaleOrderDtls>();
                var list3 = db.Table<Trader>().Where(x=>x.CustCode==CUSTCODE).ToList<Trader>();

                double ttlamt = 0;
                double ttltax = 0;
                if (list3.Count > 0) {
                    CUSTNAME = list3 [0].CustName;
                }
                foreach(var item in list2)
                {
                    ttlamt = ttlamt + item.netamount;
                    ttltax = ttltax + item.tax;
                    list.Add(item);
                }
                if (list1.Count > 0) {
                    list1 [0].amount = ttlamt;
                    db.Update (list1 [0]);
                }
                SaleOrderDtls inv1 = new SaleOrderDtls ();
                inv1.icode = "TAX";
                inv1.netamount = ttlamt;
                inv1.description = "TOTAL EXCL GST";
                SaleOrderDtls inv2 = new SaleOrderDtls ();
                inv2.icode = "AMOUNT";
                inv2.netamount = ttltax;
                inv2.description = "TOTAL 6% GST" ;
                SaleOrderDtls inv3 = new SaleOrderDtls ();
                inv3.icode = "TAX";
                inv3.netamount = ttlamt + ttltax;
                inv3.description = "TOTAL INCL GST" ;

                list.Add (inv1);
                list.Add (inv2);
                list.Add (inv3);
            }
        }
开发者ID:mokth,项目名称:merpV3,代码行数:43,代码来源:SOItemHisActivity.cs

示例15: GetInvoice

 public static Invoice GetInvoice(string pathToDatabase,string invno)
 {
     Invoice inv=null;
     using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
         var list2 = db.Table<Invoice> ().ToList<Invoice>().Where(x=>x.invno==invno).ToList();
         if (list2.Count > 0) {
             inv = list2 [0];
         }
     }
     return inv;
 }
开发者ID:mokth,项目名称:merpV2Production,代码行数:11,代码来源:DataHelper.cs


注:本文中的SQLite.SQLiteConnection.Table方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。