示例#1
0
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            textBlockx.Text      = "Passwords,";
            listView1.Visibility = Visibility.Collapsed;
            var query = conn.Table <Userdata>();

            conn.CreateTable <Userdata1>();
            foreach (var me in query)
            {
                if (me.Username == us)
                {
                    var s = conn.Insert(new Userdata1()
                    {
                        Site         = me.Site,
                        SiteUsername = me.SiteUsername,
                        Password     = me.Password
                    });
                }
            }
            var query2 = conn.Table <Userdata1>();

            listView.ItemsSource = query2;
            listView.Visibility  = Visibility.Visible;
            conn.DropTable <Userdata1>();
        }
示例#2
0
 //Delete all contactlist or delete Contacts table
 public void DeleteAllContact()
 {
     using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         conn.DropTable <Contacts>();
         conn.CreateTable <Contacts>();
         conn.Dispose();
         conn.Close();
     }
 }
示例#3
0
 private static void ExcluirTodasGastoCnpj()
 {
     using (SQLite.Net.SQLiteConnection conexao = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         conexao.DropTable <GastoCnpj>();
         conexao.CreateTable <GastoCnpj>();
         conexao.Dispose();
         conexao.Close();
     }
 }
        private async Task UpdateNobAlanIfXLSExistsAsync()
        {
            var res_SentryLocationFN = LocalizationUtils.ResourceValueByKey("SENTRYLOCATION_xlsx");
            var res_SENTRYLOCATION_xlsx_SENTRYLOCATION_TITLE = LocalizationUtils.ResourceValueByKey("SENTRYLOCATION_xlsx_SENTRYLOCATION_TITLE");

            if (!File.Exists(Path.Combine(App.WorkingPath, $"{res_SentryLocationFN}.xlsx")))
            {
                return;
            }


            ExcelReader a = ExcelReader.SharedReader();

            List <string> NöbetAlanList = new List <string>();

            StorageFile f = await StorageFile.GetFileFromPathAsync(Path.Combine(App.WorkingPath, $"{res_SentryLocationFN}.xlsx"));

            List <SheetData> x = await a.ParseSpreadSheetFile(f);

            var conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), FileUtils.FullDataPath);

            conn.DropTable <SentryLocationDataset>();
            conn.CreateTable <SentryLocationDataset>();

            foreach (var xx in x)
            {
                var data = xx.data;

                foreach (var dd in data)
                {
                    foreach (var ddc in dd)
                    {
                        if (ddc.Key == res_SENTRYLOCATION_xlsx_SENTRYLOCATION_TITLE)
                        {
                            NöbetAlanList.Add(ddc.Value.ToUpper());
                        }
                    }
                }
            }

            for (int i = 0; i < NöbetAlanList.Count; i++)
            {
                SentryLocationDataset row = new SentryLocationDataset
                {
                    SentryLocation = NöbetAlanList[i],
                };
                conn.Insert(row);
            }

            File.Delete(Path.Combine(App.WorkingPath, $"{res_SentryLocationFN}_OLD.xlsx"));
            File.Move(Path.Combine(App.WorkingPath, $"{res_SentryLocationFN}.xlsx"), Path.Combine(App.WorkingPath, $"{res_SentryLocationFN}_OLD.xlsx"));
        }
示例#5
0
        private void SaveListViewHolidays()
        {
            var conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), FileUtils.FullDataPath);

            conn.DropTable <HolidaysDataSet>();
            conn.CreateTable <HolidaysDataSet>();

            foreach (var x in HolidayManager.Holidays)
            {
                HolidaysDataSet h = new HolidaysDataSet {
                    date = x.date
                };
                conn.Insert(h);
            }
        }
示例#6
0
        private void Save_listViewNobMudYrdCalendar()
        {
            var conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), FileUtils.FullDataPath, false);

            conn.DropTable <DirectorAssistantSentinelDayDataset>();
            conn.CreateTable <DirectorAssistantSentinelDayDataset>();

            foreach (var x in DirectorAssistantSentinelDayManager.MdYrdNöbetGünleri)
            {
                DirectorAssistantSentinelDayDataset row = new DirectorAssistantSentinelDayDataset
                {
                    FullName     = x.sentinelDirectorAssistant.FullName,
                    SentinelDate = x.SentinelDate
                };
                conn.Insert(row);
            }
        }
示例#7
0
        private void SavelistViewNobMudYrd()
        {
            var conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), FileUtils.FullDataPath);

            conn.DropTable <SentinelDirectorAssistantDataset>();
            conn.CreateTable <SentinelDirectorAssistantDataset>();

            foreach (var x in SentinelDirectorAssistantManager.SentinelDirectorAssistantList)
            {
                SentinelDirectorAssistantDataset row = new SentinelDirectorAssistantDataset
                {
                    FullName     = x.FullName,
                    NotMonday    = x.UnwantedDays[0],
                    NotTuesday   = x.UnwantedDays[1],
                    NotWednesday = x.UnwantedDays[2],
                    NotThursday  = x.UnwantedDays[3],
                    NotFriday    = x.UnwantedDays[4]
                };
                conn.Insert(row);
            }
        }
示例#8
0
 private static void ExcluirTodosOsDeputados()
 {
     using (SQLite.Net.SQLiteConnection conexao = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         for (int i = 0; i <= 10; i++)
         {
             try
             {
                 conexao.DropTable <Deputado>();
                 conexao.CreateTable <Deputado>();
                 conexao.Dispose();
                 conexao.Close();
                 break;
             }
             catch
             {
                 Task.Delay(5000);
                 break;
             }
         }
     }
 }
 //DROP DB NOTES
 public void clearDatabase()
 {
     conn.DropTable <Note>();
     conn.CreateTable <Note>();
     Debug.WriteLine("[DB] Cleared note table!");
 }
        private async Task UpdateNobOgrIfXLSExistsAsync()
        {
            string res_SentinelsFN = LocalizationUtils.ResourceValueByKey("SENTINELS_xlsx");//determine whether file is SENTINELS.xlsx or NOBETCILER.xlsx etc.

            if (!File.Exists(Path.Combine(App.WorkingPath, $"{res_SentinelsFN}.xlsx")))
            {
                return;
            }

            string res_SentinelFullNameTitle = LocalizationUtils.ResourceValueByKey("SENTINELS_xlsx_SENTINELFULLNAME_TITLE");
            string res_SentryDateTitle       = LocalizationUtils.ResourceValueByKey("SENTINELS_xlsx_SENTRYDATE_TITLE");
            string res_SentryLocationTitle   = LocalizationUtils.ResourceValueByKey("SENTINELS_xlsx_SENTRYLOCATION_TITLE");

            ExcelReader   a = ExcelReader.SharedReader();
            List <string> ÖğretmenAdıSoyadıList = new List <string>();
            List <string> NöbetGünüList         = new List <string>();
            List <string> NöbetAlanList         = new List <string>();

            StorageFile f = await StorageFile.GetFileFromPathAsync(Path.Combine(App.WorkingPath, $"{res_SentinelsFN}.xlsx"));

            List <SheetData> x = await a.ParseSpreadSheetFile(f);

            var conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), FileUtils.FullDataPath);

            conn.DropTable <SentinelsDataset>();
            conn.CreateTable <SentinelsDataset>();

            foreach (var xx in x)
            {
                var data = xx.data;

                foreach (var dd in data)
                {
                    foreach (var ddc in dd)
                    {
                        if (ddc.Key == res_SentinelFullNameTitle)
                        {
                            ÖğretmenAdıSoyadıList.Add(ddc.Value.ToUpper());
                        }
                        else
                        if (ddc.Key == res_SentryDateTitle)
                        {
                            NöbetGünüList.Add(ddc.Value.ToUpper());
                        }
                        else
                        if (ddc.Key == res_SentryLocationTitle)
                        {
                            NöbetAlanList.Add(ddc.Value.ToUpper());
                        }
                    }
                }
            }

            for (int i = 0; i < ÖğretmenAdıSoyadıList.Count; i++)
            {
                SentinelsDataset row = new SentinelsDataset
                {
                    SentinelFullName = ÖğretmenAdıSoyadıList[i],
                    SentryDate       = NöbetGünüList[i],
                    SentryLocation   = NöbetAlanList[i]
                };
                conn.Insert(row);
            }

            File.Delete(Path.Combine(App.WorkingPath, $"{res_SentinelsFN}_OLD.xlsx"));
            File.Move(Path.Combine(App.WorkingPath, $"{res_SentinelsFN}.xlsx"), Path.Combine(App.WorkingPath, $"{res_SentinelsFN}_OLD.xlsx"));
        }