示例#1
0
        /// <summary>
        /// Method send informations about IP adress into database on the server
        /// </summary>
        public async void Send_IP_Raport_Into_Server()
        {
            // Preare async method
            Task <string> task = new Task <string>(Classes.IP_Data.Get_Data_From_IP);

            // Start working async
            task.Start();

            // Create instance of Database Connection
            Classes.Database conn = new Classes.Database();

            // Wait for results
            var query = await task;

            // Send IP data into server
            conn.Insert(query);

            // Check error flag
            if (conn.Error_Flag)
            {
                // Set main error flag as true
                Error_Flag = true;
                // Set main error message
                Error_Message = conn.Error_Message;
            }
        }
示例#2
0
        /// <summary>
        /// Method add new admin into database
        /// </summary>
        /// <param name="Database"></param>
        private void Add_New_Admin(Classes.Database Database)
        {
            // Prepare query
            var query = $"INSERT INTO admins (login, password, last_logedin) VALUES ('{Login_Textbox.Text.ToString()}', '{Password1_Textbox.Text.ToString()}', NOW())";

            // Add new rew into database
            Database.Insert(query);
        }
示例#3
0
        /// <summary>
        /// Method create & send informations about PC adress into database on the server
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public void Send_PC_Raport_Into_Server()
        {
            // Create class with informations about user's PC
            Classes.PC_Data A = new Classes.PC_Data();

            var query = A.Query;

            // Create instance of Database Connection
            Classes.Database conn = new Classes.Database();

            // Load list of packs from server
            conn.Insert(query);

            // Check error flag
            if (conn.Error_Flag)
            {
                // Set main error flag as true
                Error_Flag = true;
                // Set main error message
                Error_Message = conn.Error_Message;
            }
        }