コード例 #1
0
        async void fNEXT(object sender, EventArgs e)
        {
            if (nn < PARAGGELIES.NReadSQL("select count(*) from PARASTAT"))
            {
                nn = nn + 1;
            }
            TITLOS.Text = PARAGGELIES.ReadSQL("select ifnull(TITLOS,'') AS C FROM PARASTAT WHERE ID=" + nn.ToString());


            ARITMISI.Text = PARAGGELIES.ReadSQL("select  ARITMISI  FROM PARASTAT WHERE  ID=" + nn.ToString());


            EIDOS.Text = PARAGGELIES.ReadSQL("select ifnull(EIDOS,'') AS C FROM PARASTAT WHERE ID=" + nn.ToString());
        }
コード例 #2
0
        async void CreateTables(object sender, EventArgs e)
        {
            string c = "CREATE TABLE IF NOT EXISTS EID( ID  INTEGER PRIMARY KEY,KOD [nvarchar](25)," +
                       "[ONO] [nvarchar](255) ," +
                       "[ENAL] [nvarchar](25) ," +
                       "[YPOL] [real] ," +
                       "[XONDR] [real] ," +

                       "[DESM] [real] ," +
                       "[ANAM] [real] ," +
                       "[BARCODE] [nvarchar](15)  )  ";

            MainPage.ExecuteSqlite(c);

            await DisplayAlert("ΕΙΔΗ ΟΚ", "ΕΙΔΗ ΔΗΜΙΟΥΡΓΗΘΗΚΑΝ", "OK");

            // Κωδικός;Α.Φ.Μ.;Επωνυμία;Διεύθυνση;Πόλη;Τηλ.1

            c = "CREATE TABLE IF NOT EXISTS PEL( ID  INTEGER PRIMARY KEY,KOD [nvarchar](25)," +
                "[EPO] [nvarchar](255) ," +
                "[DIE] [nvarchar](35) ," +
                "[POL] [nvarchar](35) ," +
                "[THL] [nvarchar](35) ," +
                "[AFM] [nvarchar](15) )";


            MainPage.ExecuteSqlite(c);

            // αν δεν υπαρχει το πεδιο "TYP" ΠΡΟΣΘΕΣΕ ΤΟ
            string nc = PARAGGELIES.ReadSQL("SELECT COUNT(*) AS CNTREC FROM pragma_table_info('PEL') WHERE name='TYP' ");

            if (Int16.Parse(nc) == 0)
            {
                MainPage.ExecuteSqlite("alter table PEL ADD TYP REAL");
                MainPage.ExecuteSqlite("alter table PEL ADD DOY [varchar](20)");
                MainPage.ExecuteSqlite("alter table PEL ADD PEK [INT] ");
            }



            await DisplayAlert("ΠΕΛΑΤΕΣ ΟΚ", "ΠΕΛΑΤΕΣ ΔΗΜΙΟΥΡΓΗΘΗΚΑΝ", "OK");

            c = "CREATE TABLE IF NOT EXISTS EGGTIM (" +
                "[ATIM] [varchar](55)," +
                "[HME] [datetime] ," +
                "[IDPARAGG] [int] ," +
                "[KODE] [nvarchar](55) ," +
                "[POSO] [real] ," +
                "[TIMH] [real] ," +
                "[ONO] [varchar](55) ," +
                "[PROSUETA] [varchar](55) ," +
                "[CH1] [varchar](55) ," +
                "[CH2] [varchar](55) ," +
                "[NUM1] [int] ," +
                "[NUM2] [int] ," +
                "[ENERGOS] [int] ," +
                "[ID]  INTEGER PRIMARY KEY )";

            MainPage.ExecuteSqlite(c);


            // αν δεν υπαρχει το πεδιο "TYP" ΠΡΟΣΘΕΣΕ ΤΟ
            nc = PARAGGELIES.ReadSQL("SELECT COUNT(*) AS CNTREC FROM pragma_table_info('EGGTIM') WHERE name='EKPT' ");
            if (Int16.Parse(nc) == 0)
            {
                MainPage.ExecuteSqlite("alter table EGGTIM ADD EKPT REAL");
                MainPage.ExecuteSqlite("alter table EGGTIM ADD KAU_AJ REAL");
                MainPage.ExecuteSqlite("alter table EGGTIM ADD MIK_AJ REAL");
            }



            c = "CREATE TABLE IF NOT EXISTS ARITMISI( ID  INTEGER PRIMARY KEY,ARITMISI [int] )";


            MainPage.ExecuteSqlite(c);

            MainPage.ExecuteSqlite("INSERT INTO ARITMISI (ARITMISI) VALUES (0)");
            await DisplayAlert("ΑΡΙΘΜΗΣΗ ΟΚ", " ΔΗΜΙΟΥΡΓΗΘΗΚΑΝ", "OK");



            c = "CREATE TABLE IF NOT EXISTS PARALABES( ID  INTEGER PRIMARY KEY,ATIM [nvarchar](35),BARCODE [nvarchar](45) )";


            MainPage.ExecuteSqlite(c);



            c = "CREATE TABLE IF NOT EXISTS BARCODES( ID  INTEGER PRIMARY KEY,KOD [nvarchar](25),BARCODE [nvarchar](15) )";


            MainPage.ExecuteSqlite(c);



            c = "CREATE TABLE IF NOT EXISTS MEM( ID  INTEGER PRIMARY KEY,IP [nvarchar](45)," +
                "[EPO] [nvarchar](255) ," +
                "[DIE] [nvarchar](35) ," +
                "[POL] [nvarchar](35) ," +
                "[THL] [nvarchar](35) ," +
                "[AFM] [nvarchar](15) )";
            MainPage.ExecuteSqlite("INSERT INTO MEM (IP) VALUES ('*')");
            await DisplayAlert("ΑΡΙΘΜΗΣΗ ΟΚ", " ΔΗΜΙΟΥΡΓΗΘΗΚΑΝ", "OK");

            MainPage.ExecuteSqlite(c);

            c = " CREATE TABLE  IF NOT EXISTS TIMOKAT ( [KOD] [nvarchar](14) NOT NULL," +
                "[EKPT] [decimal](5, 2) NOT NULL, [TIMOK] [int] NOT NULL,[ONO] [nvarchar](35) NULL," +
                "[TIMOKPEL] [varchar](5) NULL,[TIMOKEID] [varchar](5) NULL,	[TIMH] [decimal](18, 0) NULL," +
                "[TIMOKID] [int] NOT NULL) ";
            MainPage.ExecuteSqlite(c);

            c = "CREATE TABLE IF NOT EXISTS PARASTAT( ID  INTEGER PRIMARY KEY,EIDOS [nvarchar](5)," +
                "[TITLOS] [nvarchar](30) ," +

                "[ARITMISI] [INT] ," +
                "[N1] [real] ," +
                "[N2] [real] ," +
                "[N3] [real] ," +
                "[C1] [nvarchar](15) ,[C2] [nvarchar](15) , [C3] [nvarchar](15) )  ";

            MainPage.ExecuteSqlite(c);

            if (PARAGGELIES.NReadSQL("select count(*) from PARASTAT") < 2)
            {
                MainPage.ExecuteSqlite("INSERT INTO PARASTAT (TITLOS,EIDOS) VALUES ('ΤΙΜΟΛΟΓΙΟ ΠΩΛΗΣΗΣ-Δ.Α.','T')");
                MainPage.ExecuteSqlite("INSERT INTO PARASTAT (TITLOS,EIDOS) VALUES ('ΔΕΛΤΙΟ ΑΠΟΣΤΟΛΗΣ','A')");
            }
        }