예제 #1
0
        public void UpdateUserInfo(string _FirstName, string _LastName, string _Username, string _Email, string _ShareCode)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("UPDATE Users SET first_name='" + _FirstName + "',last_name='" + _LastName + "',username='******',email='" + _Email + "',share_code='" + _ShareCode + "' where username='******'");
            con.CloseConnection();
        }
예제 #2
0
        public void UpdateUserCred(string _Username, string _Password)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("UPDATE User_Cred SET username='******',passwords='" + _Password + "' where username='******'");
            con.CloseConnection();
        }
예제 #3
0
        public void AddUserInfo(string _FirstName, string _LastName, string _Username, string _Email, string _ShareCode)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("insert into Users (first_name,last_name,username,email,share_code) values ('" + _FirstName + "','" + _LastName + "','" + _Username + "','" + _Email + "','" + _ShareCode + "')");
            con.CloseConnection();
        }
        public static void AddMyFile(string path)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("insert into my_files (file_path) values ('" + path + "')");
            con.CloseConnection();
        }
예제 #5
0
        public void AddUserCred(string _Username, string _Password)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("insert into User_Cred values ('" + _Username + "','" + _Password + "')");
            con.CloseConnection();
        }
        public static void AddNewContact(string name, string code)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("insert into Contacts (contact_name,contact_code) values ('" + name + "', '" + code + "')");
            con.CloseConnection();
        }
        public static void DeleteContact(string name)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("delete from Contacts where contact_name='" + name + "'");
            con.CloseConnection();
        }
        public static void CreateSession(string username, string time, int active)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("insert into Session values('" + username + "','" + time + "',1)");
            con.CloseConnection();
        }
        public static void EndSession()
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            con.ExecuteQueries("UPDATE Session SET active = 0");
            con.CloseConnection();
        }
        public static void AddFileVersion(string parent, string child)
        {
            DatabaseCon con = new DatabaseCon();

            con.OpenConnection();
            SqlDataReader read   = con.DataReader("select * from my_files where file_path='" + parent + "'");
            int           FileID = -1;

            while (read.Read())
            {
                FileID = (int)read["file_id"];
            }
            read.Close();
            if (FileID >= 0)
            {
                con.ExecuteQueries("insert into version (file_id,file_path) values (" + FileID + ",'" + child + "')");
            }
            con.CloseConnection();
        }