Beispiel #1
0
 public bool HasSameNameCatalogChild(string parentId, string name)
 {
     return(DbHelper.FirstOrDefault(this._catalogType, this._dbAccount, x =>
     {
         TreeCatalog TreeCatalog = (TreeCatalog)x;
         return TreeCatalog.ParentId == parentId && TreeCatalog.Name == name && TreeCatalog.PrevId != TreeCatalog.ParentId;
     }) != null);
 }
Beispiel #2
0
        public TreeCatalog CreateRootAndSaveToDb(string entityId)
        {
            TreeCatalog TreeCatalog = EntityHelper.Create(this._catalogType, this._dbAccount) as TreeCatalog;

            TreeCatalog.Name     = "Root!@#$Catalog$%&Header*&()";
            TreeCatalog.EntityId = entityId;
            this.SaveNodeToDb(TreeCatalog);
            return(TreeCatalog);
        }
        public IActionResult RenderTrees(TreeCatalog model)
        {
            ITreeCatalogResponsitory tree = new TreeCatalogResponsitory(_context);

            var Trees = tree.GetTreeCatalogs().Select(x => new
            {
                name           = x.Name,
                scientificName = x.ScientificName,
                description    = x.Description,
                id             = x.Id,
                url            = x.Url
            });

            return(Ok(Trees));
        }
Beispiel #4
0
        public async Task AddAsync(TreeBindingModel newTreeCatalog)
        {
            var item = _ProjectContext.TreeCatalog.FirstOrDefault(x => x.ScientificName == newTreeCatalog.ScientificName);

            if (item == null)
            {
                TreeCatalog tree = new TreeCatalog
                {
                    Name           = newTreeCatalog.TreeName,
                    ScientificName = newTreeCatalog.ScientificName,
                    Url            = newTreeCatalog.Url
                };
                _ProjectContext.TreeCatalog.Add(tree);
                await _ProjectContext.SaveChangesAsync();
            }
        }
Beispiel #5
0
        private async void LoadOffersView()
        {
            var OfferList = Joyces.Platform.AppContext.Instance.Platform.OfferList;

            if (OfferList != null)
            {
                ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);

                TreeCatalog treeCatalog = new TreeCatalog();
                viewPager.Adapter = new TreePagerAdapter(this, treeCatalog, OfferList, this);
            }
            else
            {
                progress.Show();
                //Alert(Lang.MESSAGE_HEADLINE, Lang.SERVICE_NOT_AVAILABLE, Lang.BUTTON_OK);
            }
        }
Beispiel #6
0
        private TreeNode ReadRootFromDb()
        {
            var nds = DbHelper.Fetch <TreeNode>(this._catalogType, this._dbAccount, (TreeNode x) =>
            {
                TreeCatalog TreeCatalog = (TreeCatalog)x;
                return(TreeCatalog.Name == "Root!@#$Catalog$%&Header*&()");
            });
            TreeNode result = null;
            int      cnt    = nds.xCount();

            if (cnt == 1)
            {
                result = nds[0];
            }
            else if (cnt > 1)
            {
                result = this.FixExtraRoot(nds);
            }
            return(result);
        }
Beispiel #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            // Locate the ViewPager:
            ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);


            LayoutInflater inflater = (LayoutInflater)GetSystemService(LayoutInflaterService);

            // Instantiate the tree catalog:
            treeCatalog = new TreeCatalog();

            string dbPath_Photo = System.IO.Path.Combine(Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).ToString(), "App4_Photo.db");

            //var db_Photo = new SQLiteConnection(dbPath_Photo);



            using (var db_Photo = new SQLiteConnection(dbPath_Photo))
            {
                db_Photo.CreateTable <Photo>();
                var table_Photo = db_Photo.Table <Photo>();

                foreach (var s in table_Photo)
                {
                    ListItems.PhotoPathList.Add(s.Path_Photo);
                }
            } // ここでFileStreamオブジェクトのDisposeメソッドが呼び出される


            // Set up the adapter for the ViewPager\
            viewPager.Adapter = new TreePagerAdapter(this, treeCatalog);
        }
Beispiel #8
0
 public HolePagerAdapter(Context context, TreeCatalog treeCatalog)
 {
     this.context     = context;
     this.treeCatalog = treeCatalog;
 }