public static bool InsertInitalApproveForCurrentUser(int FileId)
        {
            try
            {
                string      Status        = "D";
                int         CurrentUserId = USerConfig.GetUserID();
                List <User> listUser      = new List <User>();
                listUser = UserControl.GetAllusers();

                foreach (User User in listUser)
                {
                    if (CurrentUserId == User.UserID)
                    {
                        Status = "A";
                    }

                    FileAccessHelper.SaveFileAccess(FileId, User.UserID, Status);
                }

                return(true);
            }
            catch
            {
                throw;
            }
        }
Пример #2
0
        /// <summary>
        /// 错误写入日志
        /// </summary>
        public void WriteErrorLog()
        {
            StringBuilder sbLog = new StringBuilder();

            sbLog.Append("\r\n");
            sbLog.Append("===========================【" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "】===========================");
            sbLog.Append("\r\n\r\n");
            sbLog.Append("===============================错误信息===========================");
            sbLog.Append("\r\n\r\n");
            sbLog.Append(modCustomErr.Message);
            sbLog.Append("\r\n\r\n");
            sbLog.Append("================================错误原===========================");
            sbLog.Append("\r\n\r\n");
            sbLog.Append(modCustomErr.Source);
            sbLog.Append("\r\n\r\n");
            sbLog.Append("================================错误方法===========================");
            sbLog.Append("\r\n\r\n");
            sbLog.Append(modCustomErr.TargetSite);
            sbLog.Append("\r\n\r\n");
            sbLog.Append("================================错误堆栈信息===========================");
            sbLog.Append("\r\n\r\n");
            sbLog.Append(modCustomErr.StackTrace);
            sbLog.Append("\r\n\r\n\r\n\r\n\r\n");
            string logPath = ServerInfo.GetRootPath() + "admin\\Log\\" + DateTime.Now.ToShortDateString() + ".txt";

            FileAccessHelper.WriteTextAppendFile(logPath, sbLog.ToString());
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Sqlite
            string dbPath = FileAccessHelper.GetLocalFilePath("listacompras.db3");

            ShopRepository = new ShopRepository(dbPath);
            //Akavache Init Persintent Data
            Akavache.Registrations.Start("Pedidos");
            SetContentView(Resource.Layout.Main);
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            base.SetSupportActionBar(toolbar);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerLayout);
            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close);

            drawerLayout.AddDrawerListener(drawerToggle);
            drawerToggle.SyncState();
            var menu = FindViewById <Android.Support.Design.Widget.NavigationView>(Resource.Id.navigationView);

            menu.NavigationItemSelected += OnMenuItemSelected;
            Navigate(new HomeFragment());
            //Navigate(new HomeFragmentRecicler());
        }
Пример #4
0
        public App()
        {
            string dbPath = FileAccessHelper.GetLocalFilePath("dog3.db3");

            DogRep = new DogRepository(dbPath);

            var applicationStartPage = new FirstPage();

            //// The root page of your application
            //var content = new ContentPage {
            //	Title = "ASampleApp",
            //	Content = new StackLayout {
            //		VerticalOptions = LayoutOptions.Center,
            //		Children = {
            //			new Label {
            //				HorizontalTextAlignment = TextAlignment.Center,
            //				Text = "Welcome to Xamarin Forms!"
            //			}
            //		}
            //	}
            //};
            var myNavigationPage = new NavigationPage(applicationStartPage);

            MainPage = myNavigationPage;
        }
Пример #5
0
        private void SetData(out ExpandableListViewAdapter mAdapter)
        {
            List <string> groupA = new List <string>();
            List <string> groupB = new List <string>();
            string        dbPath = FileAccessHelper.GetLocalFilePath("munchkin.db");
            var           db     = new SQLiteConnection(dbPath);

            var cardInfos = db.Table <CardInfo>().Where(x => x.Id > 0);
            var i         = 0;

            foreach (var listing in cardInfos)
            {
                group.Add(listing.Name);
                var newList = new List <string>();

                var rarity  = db.Table <Rarity>().FirstOrDefault(x => x.Id == listing.Rarity) ?? new Rarity();
                var faction = db.Table <Faction>().FirstOrDefault(x => x.Id == listing.Faction) ?? new Faction();
                var type    = db.Table <Type>().FirstOrDefault(x => x.Id == listing.Type) ?? new Type();
                var subType = db.Table <SubType>().FirstOrDefault(x => x.Id == listing.SubType) ?? new SubType();
                newList.Add("R:" + rarity.Name + "F:" + faction.Name);
                dicMyMap.Add(@group[i], newList);
                i++;
            }



            mAdapter = new ExpandableListViewAdapter(this, @group, dicMyMap);
        }
Пример #6
0
        public App()
        {
            string dbPath = FileAccessHelper.GetLocalFilePath("dog16.db3");

            DogRep = new DogRepository(dbPath);

            var applicationStartPage = new FirstPage();

            //// The root page of your application
            //var content = new ContentPage {
            //	Title = "ASampleApp",
            //	Content = new StackLayout {
            //		VerticalOptions = LayoutOptions.Center,
            //		Children = {
            //			new Label {
            //				HorizontalTextAlignment = TextAlignment.Center,
            //				Text = "Welcome to Xamarin Forms!"
            //			}
            //		}
            //	}
            //};
            var myNavigationPage = new NavigationPage(applicationStartPage);

            MainPage = myNavigationPage;

            //Initialize Dog Photo View Page
            MyDogListPhotoPage = new DogListPhotoPage();

            //THIS WILL RUN EACH TIME YOU CHANGE THE DATABASE (ie. changing dbPath)
            IfDogSQLListEmptyThenFill();
        }
Пример #7
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method
            string dbpath = FileAccessHelper.GetLocalFilePath("ethanslist.db3");

            databaseConnection = new DatabaseConnection(dbpath);

            // Code to start the Xamarin Test Cloud Agent
            #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            #endif

            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);

            UINavigationBar.Appearance.BarTintColor        = ColorScheme.WetAsphalt;
            UINavigationBar.Appearance.TintColor           = ColorScheme.Clouds;
            UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes()
            {
                Font            = UIFont.FromName(Constants.NormalFont, 16f),
                ForegroundColor = ColorScheme.Clouds,
            };

            #if RELEASE
            Insights.Initialize("ec87be89090cdee48f57cce9ee5ca4d230b1f314");
            #endif


            return(true);
        }
Пример #8
0
        protected override void OnCreate(Bundle bundle)
        {
            //TODO: Create appropriately sized placeholder image
            base.OnCreate(bundle);
            Instance = this;

            string dbpath = FileAccessHelper.GetLocalFilePath("ethanslist.db3");

            databaseConnection = new DatabaseConnection(dbpath);

            // Create UI
            SetContentView(Resource.Layout.Main);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            // Init toolbar
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            // Attach item selected handler to navigation view
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            // Create ActionBarDrawerToggle button and add it to the toolbar
            var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();

            base.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.frameLayout, fragments[0]).Commit();
        }
        public ActionResult FileAccess(int FileID, FormCollection frm)
        {
            List <User> listUser = new List <User>();

            try
            {
                string        USerNameStatus = "";
                List <string> name           = new List <string>();
                listUser = UserControl.UserAllUser(FileID);
                foreach (string Name in frm)
                {
                    foreach (User User in listUser)
                    {
                        if (User.Username == Name)
                        {
                            USerNameStatus = frm[Name].ToString();
                            FileAccessHelper.SaveFileAccess(FileID, User.UserID, USerNameStatus);
                            User.Rowstatus = Convert.ToChar(USerNameStatus);
                        }
                    }
                }
                TempData["AlertMessage"] = "Sucess";
                return(View(listUser));
            }
            catch
            {
                TempData["AlertMessage"] = "Error";
                return(View(listUser));
            }
        }
Пример #10
0
 public MockSQLiteService()
 {
     conn = new SQLiteAsyncConnection(FileAccessHelper.GetLocalFilePath("ESDonationsTestDb.db"));
     conn.CreateTablesAsync <Donor, Session>().Wait();
     conn.DeleteAllAsync <Donor>().Wait();
     conn.DeleteAllAsync <Session>().Wait();
 }
Пример #11
0
        public App()
        {
            //MAKE THIS ASYNC AND PULL THIS OUT OF THE CONSTRUCTOR
            MyAzureBlobStorage   = new AzureBlobStorage();
            MyCloudBlobClient    = MyAzureBlobStorage.CreateCloudBlobClient();
            MyCloudBlobContainer = MyAzureBlobStorage.CreateCloudBlobClientAndContainer(ContainerName);

            string dbPath = FileAccessHelper.GetLocalFilePath("asa16dog6.db3");

            //USE THIS FOR LIST PAGE
            DogRep = new DogRepository(dbPath);

            //USE THIS FOR LIST PHOTO PAGE
            DogPhotoRep = new DogPhotoRepository(dbPath);

            //USE THIS FOR LIST PHOTO BASE SIXTY FOUR PAGE
            DogRepBaseSixtyFour = new DogRepositoryBaseSixtyFour(dbPath);

            DogRepBlob = new DogRepositoryBlob(dbPath);

            var applicationStartPage = new FirstPage();

            var myNavigationPage = new NavigationPage(applicationStartPage);

            MainPage = myNavigationPage;

            //Initialize Dog Photo View Page
            MyDogListMVVMPage        = new DogListMVVMPage();
            MyDogListPhotoPage       = new DogListPhotoPage();
            MyDogListPhotoBase64Page = new DogListPhotoBase64Page();
            MyDogListPhotoBlobPage   = new DogListPhotoBlobPage();
        }
Пример #12
0
        public ServiceDbContext()
        {
            var path = FileAccessHelper.GetLocalFilePath("database.sqlite");

            ConnectionString = path;
            CreateModel();
        }
Пример #13
0
        public MainPage()
        {
            this.InitializeComponent();
            string dbPath = FileAccessHelper.GetLocalFilePath("WageAnalyzer.db3");

            LoadApplication(new WageAnalyzer.App(dbPath));
        }
Пример #14
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your fragment here

            service = new TranslationService(FileAccessHelper.GetLocalFilePath("TravelersGuide.db"));
        }
Пример #15
0
        public MainPage()
        {
            string dbPath = FileAccessHelper.GetLocalFilePath("MHWDB.db3");

            this.InitializeComponent();

            LoadApplication(new MHW.App(dbPath));
        }
Пример #16
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            string dbPath = FileAccessHelper.GetLocalFilePath("Songs.db");

            LoadApplication(new App(dbPath, new SQLitePlatformIOS()));

            return(base.FinishedLaunching(app, options));
        }
Пример #17
0
        private List <Note> GetAllNotes()
        {
            var database = new NoteDatabase
                               (FileAccessHelper.GetLocalFilePath("Notes.db3"));

            var NotesFromDB = database.ReadNotes();

            return(new List <Note>(NotesFromDB));
        }
Пример #18
0
        public App()
        {
            string dbPath = FileAccessHelper.GetLocalFilePath("people5.db3");

            DogRepo = new DogRepository(dbPath);
            // DogRepo.AddNewDog("Olive", "Black");
            // The root page of your application
            MainPage = new NavigationPage(new FirstPage());
        }
Пример #19
0
        public App()
        {
            //MAKE THIS ASYNC AND PULL THIS OUT OF THE CONSTRUCTOR



            MyAzureBlobStorage   = new AzureBlobStorage();
            MyCloudBlobClient    = MyAzureBlobStorage.CreateCloudBlobClient();
            MyCloudBlobContainer = MyAzureBlobStorage.CreateCloudBlobClientAndContainer(ContainerName);



            string dbPath = FileAccessHelper.GetLocalFilePath("adog1.db3");

            //USE THIS FOR LIST AND LIST PHOTO PAGE
            DogRep = new DogRepository(dbPath);

            //USE THIS FOR LIST PHOTO PAGE

            DogPhotoRep = new DogPhotoRepository(dbPath);
            //USE THIS FOR LIST PHOTO BASE SIXTY FOUR PAGE
            DogRepBaseSixtyFour = new DogRepositoryBaseSixtyFour(dbPath);

            DogRepBlob = new DogRepositoryBlob(dbPath);

            var applicationStartPage = new FirstPage();

            //// The root page of your application
            //var content = new ContentPage {
            //	Title = "ASampleApp",
            //	Content = new StackLayout {
            //		VerticalOptions = LayoutOptions.Center,
            //		Children = {
            //			new Label {
            //				HorizontalTextAlignment = TextAlignment.Center,
            //				Text = "Welcome to Xamarin Forms!"
            //			}
            //		}
            //	}
            //};
            var myNavigationPage = new NavigationPage(applicationStartPage);

            MainPage = myNavigationPage;

            //Initialize Dog Photo View Page

            MyDogListMVVMPage        = new DogListMVVMPage();
            MyDogListPhotoPage       = new DogListPhotoPage();
            MyDogListPhotoBase64Page = new DogListPhotoBase64Page();

            MyDogListPhotoBlobPage = new DogListPhotoBlobPage();



            //THIS WILL RUN EACH TIME YOU CHANGE THE PATH OF THE DATABASE (ie. creating a new Database)
            //            IfDogSQLListEmptyThenFill();
        }
        public MainPage()
        {
            this.InitializeComponent();

            var repository = new PantryPalDatabase(FileAccessHelper.GetLocalFilePath("PantryPal.db3"));

            FreshIOC.Container.Register(repository);

            LoadApplication(new PantryPalwithFreshMVVM.App());
        }
Пример #21
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            string dbPath = FileAccessHelper.GetLocalFilePath("LittleVictories.db3");

            Forms.Init();

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Пример #22
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            string dbPath = FileAccessHelper.GetLocalFilePath("HopeDB.db3");

            LoadApplication(new App(dbPath));

            return(base.FinishedLaunching(app, options));
        }
Пример #23
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
            //acesso a pasta do nosso aplicativo criando a base de dados com seu respectivo nome
            string dbPath = FileAccessHelper.GetLocalFilePath("lista.db3");

            LoadApplication(new App(dbPath));
            return(base.FinishedLaunching(app, options));
        }
Пример #24
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "CollectionView_Experimental");
            global::Xamarin.Forms.Forms.Init();
            string dbpath = FileAccessHelper.GetLocalFilePath("eLiDAR.sqlite");

            //  Xamarin.RisePlugin.AutoCompleteTextView.iOS.AutoCompleteTextViewRenderer.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Пример #25
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            InitializeAssembly();
            FileAccessHelper.GetLocalFilePath("StationData.sqlite");
            LoadApplication(new App());
        }
Пример #26
0
 /// <summary>
 /// 生成html文件
 /// </summary>
 /// <param name="content">内容</param>
 /// <param name="htmlpath">生成html路径</param>
 /// <returns></returns>
 public bool CreateHtml(string content, string htmlpath)
 {
     try
     {
         FileAccessHelper.WriteTextFile(htmlpath, content);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #27
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            string dbPath = FileAccessHelper.GetLocalFilePath("datastoragedemo.db3");

            LoadApplication(new App(dbPath));
        }
Пример #28
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = KaraokeTOP2.Droid.Resource.Layout.Tabbar;
            ToolbarResource   = KaraokeTOP2.Droid.Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            string dbPath = FileAccessHelper.GetLocalFilePath("Songs.db");

            LoadApplication(new App(dbPath, new SQLitePlatformAndroid()));
        }
Пример #29
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            view = inflater.Inflate(Resource.Layout.GalleryFragment, container, false);

            var capturedImages = GlobalVariables.db.GetAllCapturedImages();

            adapter            = new GalleryAdapter(capturedImages);
            adapter.ItemClick += OnItemClick;

            mRecyclerView = view.FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.GalleryRecyclerView);
            var emptyTextView = view.FindViewById <TextView>(Resource.Id.EmptyGalleryTextView);
            var fab           = view.FindViewById <CustomFAB>(Resource.Id.GalleryTabFAB);

            if (capturedImages.Count < 1)
            {
                mRecyclerView.Visibility = ViewStates.Gone;
                emptyTextView.Visibility = ViewStates.Visible;
            }
            else
            {
                emptyTextView.Visibility = ViewStates.Gone;
                mRecyclerView.Visibility = ViewStates.Visible;
            }
            mRecyclerView.SetAdapter(adapter);

            mLayoutManager = new Android.Support.V7.Widget.GridLayoutManager(Context, 2, Android.Support.V7.Widget.GridLayoutManager.Vertical, false);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            fab.AttachToRecyclerView(mRecyclerView);
            var rootView = fab.RootView;

            fab.Click += (sender, args) =>
            {
                var          ImageDirectory = FileAccessHelper.GetImageDirectory();
                var          imageName      = Guid.NewGuid() + ".jpg";
                Java.IO.File ImageFile      = new Java.IO.File(ImageDirectory, imageName.ToString());

                ((MainActivity)Activity).setImageFile(ImageFile);
                ((MainActivity)Activity).setImageName(imageName.ToString());
                ((MainActivity)Activity).setImageDirectory(ImageDirectory.AbsolutePath);

                var intent = new Intent(MediaStore.ActionImageCapture);
                intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(ImageFile));
                ((MainActivity)Activity).StartActivityForResult(intent, 0);
            };

            return(view);
        }
Пример #30
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false);
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes
            {
                TextColor = UIColor.Blue
            });

            global::Xamarin.Forms.Forms.Init();
            InitializeAssembly();
            FileAccessHelper.GetLocalFilePath("StationData.sqlite");
            LoadApplication(new App());

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }