コード例 #1
0
ファイル: MedicineDA.cs プロジェクト: manums/YoPillz
        public async static Task <MedicineDA> Create()
        {
            MedicineDA medDA = new MedicineDA();
            Sync       sync  = await Sync.Create();

            medDA.medicineSyncTable = new MedicineSyncTable(sync);
            return(medDA);
        }
コード例 #2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            medicineDA = await MedicineDA.Create();

            Sync sync = await Sync.Create();

            OrderHeaderSyncTable ohstable = new OrderHeaderSyncTable(sync);
            await ohstable.PullWithStoreIdAsync("1");
        }
コード例 #3
0
ファイル: OrderDA.cs プロジェクト: manums/YoPillz
        public async static Task <OrderDA> Create()
        {
            OrderDA orderheaderDA = new OrderDA();
            Sync    sync          = await Sync.Create();

            orderheaderDA.orderHeaderSyncTable        = new OrderHeaderSyncTable(sync);
            orderheaderDA.transactionDetailsSyncTable = new TransactionDetailsSyncTable(sync);
            return(orderheaderDA);
        }
コード例 #4
0
ファイル: MainPage.xaml.cs プロジェクト: manums/YoPillz
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            Sync sync = await Sync.Create();

            MedicineSyncTable ailmentTable = new MedicineSyncTable(sync);
            await ailmentTable.PullWithStoreIdAsync("1");

            //await ailmentTable.PullAsync();
            List <Medicine> list = await ailmentTable.ReadAsync();
        }
コード例 #5
0
ファイル: UnitTest.cs プロジェクト: manums/YoPillz
        public async Task PullTest()
        {
            Sync sync = await Sync.Create();

            SyncTable <AilmentCategory> syncTable = new SyncTable <AilmentCategory>(sync);
            //await syncTable.InsertAsync(new AilmentCategory { AilmentCategoryId = 1, AilmentCategoryName = "abc", StoreId = "1" });
            await syncTable.PullAsync(syncTable.ToString(), syncTable.GetQuery());

            List <AilmentCategory> readList = await syncTable.ReadAsync();

            Assert.AreNotEqual(0, readList.Count);
            foreach (AilmentCategory ac in readList)
            {
                Assert.AreEqual("1", ac.StoreId);
            }
        }
コード例 #6
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestSyncCreate <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(args[0]);

            FilePermissions perms = FilePermissions.UserRead |
                                    FilePermissions.UserWrite |
                                    FilePermissions.GroupRead |
                                    FilePermissions.OtherRead;

            Console.WriteLine(perms);
            Handle handle = Sync.Create(uri, OpenMode.Write, false, perms);

            UTF8Encoding utf8   = new UTF8Encoding();
            Result       result = Result.Ok;

            Console.WriteLine("Enter text and end with Ctrl-D");
            while (result == Result.Ok)
            {
                string line = Console.ReadLine();
                if (line == null)
                {
                    break;
                }
                byte[] buffer = utf8.GetBytes(line);

                ulong bytesWritten;
                result = Sync.Write(handle, out buffer[0],
                                    (ulong)buffer.Length, out bytesWritten);
                Console.WriteLine("result write '{0}' = {1}", uri, result);
                Console.WriteLine("{0} bytes written", bytesWritten);
            }

            result = Sync.Close(handle);
            Console.WriteLine("result close '{0}' = {1}", uri, result);

            Gnome.Vfs.Vfs.Shutdown();
        }