Example #1
0
        private void saveSettingsButton_Clicked(object sender, EventArgs e)
        {
            foreach (object field in settingFields)
            {
                SettingModel setting = new SettingModel();

                if (field.GetType() == typeof(TextBox))
                {
                    TextBox tb = (TextBox)field;
                    setting.SettingName  = tb.Name;
                    setting.SettingValue = tb.Text;

                    if (!SqliteDataMgr.SettingExists(tb.Name))
                    {
                        SqliteDataMgr.AddSetting(setting);
                    }
                    else
                    {
                        SqliteDataMgr.UpdateSetting(setting);
                    }
                }
            }

            SKUDBMgr.ConnectToDatabase(databaseLocation.Text.Trim());
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();

            deviceList.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            updateThread = new BackgroundWorker();

            updateThread.DoWork                    += UpdateThread_DoWork;
            updateThread.RunWorkerCompleted        += UpdateThread_RunUpdateCompleted;
            updateThread.ProgressChanged           += UpdateThread_ProgressChanged;
            updateThread.WorkerReportsProgress      = true;
            updateThread.WorkerSupportsCancellation = true;


            settingFields = new List <object>();

            settingFields.Add(dataLocation);
            settingFields.Add(labelerLocation);
            settingFields.Add(labelLocation);
            settingFields.Add(databaseLocation);
            mainString  = new StringBuilder();
            mainString2 = new StringBuilder();

            selectOptionCB.SelectedIndex = 0;
            this.KeyPreview = true;

            LoadSettings();

            SKUDBMgr.ConnectToDatabase(databaseLocation.Text.Trim());

            object[] row  = { "iphone 5s 16gb", "1234asf1234df", "11111333333444", "111113333334445555", "M123 LL/A 2345", null };
            object[] row2 = { "iphone 7s 32gb", "345gfg43tt3vv", "111155333444", "1111553334447777", "M456 LL/A rwrt", null };
            object[] row3 = { "iphone 11 pro 128gb", "7u7u7u7u7u7u", "00000088677774", "000006555333", "M765 LL/A feef", null };
            object[] row4 = { "iphone 6s 64gb", "8i8i8i8i8i8i", "222223333445", "6664446464646", "M353 LL/A f33g", null };
            object[] row5 = { "iphone 8 16gb", "9o9o6u6y5t4t4t", "57575757575757", "5757575757", "M634 LL/A aa4g", null };
            //var listViewItem = new ListViewItem(row);

            deviceList.Rows.Add(row);
            deviceList.Rows.Add(row2);
            deviceList.Rows.Add(row3);
            deviceList.Rows.Add(row4);
            deviceList.Rows.Add(row5);

            //ProcessLabels("THIS IS TITLE ENJOY", "whats going on man", null, @"C:\Users\Vince\Documents\QrCodeLabelTemp2.dotx", true);



            //doc.Close(ref saveChanges, ref missing, ref missing);
            //AndroidMgr.GetConnectedDevices();

            /*
             * ImageConverter conv = new ImageConverter();
             * System.Drawing.Image im = Bitmap.FromFile(@"C:\Users\Vince\Pictures\maxresdefault.jpg");
             * byte[] xByte = (byte[])conv.ConvertTo(im, typeof(byte[]));
             *
             *
             *
             * //SKUDBMgr.ExecuteQuery($"INSERT INTO Pics (Data) VALUES ('{"efe"}')",null);
             *
             * //SKUDBMgr.ExecuteQuery("SELECT F1 FROM Table1 WHERE F2='23456'");
             *
             * string qry = "INSERT INTO Pics (Data) VALUES(@Data)";
             *
             * using (SKUDBMgr.conn)
             * {
             *  OleDbCommand cmd = new OleDbCommand(qry, SKUDBMgr.conn);
             *  cmd.Parameters.AddWithValue("@Data", xByte);
             *
             *  //SKUDBMgr.conn.Open();
             *  cmd.ExecuteNonQuery();
             * }
             *
             * List<KeyValuePair<string, object>> values = new List<KeyValuePair<string, object>>();
             *
             * values.Add(new KeyValuePair<string, object>("F9", "00500"));
             * values.Add(new KeyValuePair<string, object>("F11", "44444"));
             *
             * SKUDBMgr.ExecuteQuery(SKUDBMgr.SKUDBOPTIONS.SELECT, "Smartphones", new List<string> { "F3","F9","F11"}, SKUDBMgr.SKUDBOPTIONS.FROM, values,SKUDBMgr.SKUDBOPTIONS.WHERE,SKUDBMgr.SKUDBOPTIONS.OR);
             *
             *
             * var usbDevices = GetUSBDevices();
             *
             * foreach (var usbDevice in usbDevices)
             * {
             *  Console.WriteLine("Device ID: {0}, PNP Device ID: {1}, Description: {2}",
             *      usbDevice.DeviceID, usbDevice.PnpDeviceID, usbDevice.Description);
             * }
             *
             * Console.Read();
             */


            AndroidMgr.InitiateADBService();

            List <string> dev = AndroidMgr.GetConnectedDevices();

            foreach (string devs in dev)
            {
                Console.WriteLine(devs);
            }

            foreach (aDevice ad in AndroidMgr.LoadDevices(dev))
            {
                Console.WriteLine($"DEVICE: {ad.deviceName} MODEL: {ad.model} SERIAL: {ad.serialNo} IMEI: {ad.imeiNo} MANUFACTURER: {ad.manufacturer}");
            }
        }