Esempio n. 1
0
        public DataTable UpdateOwner([FromBody] ClubOwner_signup p)
        {
            System.Diagnostics.Debug.WriteLine("Inside update_player********************************** ");
            DataTable result = handler.UpdateOwner(p);

            return(result);
        }
Esempio n. 2
0
        public DataTable clubOwner_signup(ClubOwner_signup c)
        {
            string query = "INSERT INTO clubOwner (userName,password,firstName,lastName,email,phone,officeHours) " +
                           " VALUES ('" + c.username + "','" + c.password + "','" + c.fname
                           + "','" + c.lname + "','" + c.email + "'," + c.phone + ",'" + (c.officeHours == null ? "NULL" : c.officeHours) + "')";

            if (dbMan.ExecuteNonQuery(query) != 0)
            {
                query = "INSERT INTO CLUB(name,city,street,clubOwner) "
                        + "VALUES ('" + c.clubName + "','" + c.clubCity + "','" + c.clubStreet
                        + "','" + c.username + "')";
                if (dbMan.ExecuteNonQuery(query) != 0)
                {
                    query = "SELECT *, 'owner' AS type FROM clubOwner WHERE userName='******' AND password='******';";
                    return(dbMan.ExecuteReader(query));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
        public DataTable PostOwner([FromBody] ClubOwner_signup c)
        {
            System.Diagnostics.Debug.WriteLine("Inside owner_Post********************************** ");
            DataTable result = handler.clubOwner_signup(c);

            return(result);
        }
Esempio n. 4
0
        public DataTable UpdateOwner(ClubOwner_signup p)
        {
            string query = "update ClubOwner set firstName = '" + p.fname + "' , lastName = '" + p.lname + "' , phone = '" + p.phone + "' , email = '" + p.email + "' , password = '******' where userName = '******'";

            if (dbMan.ExecuteNonQuery(query) != 0)
            {
                query = "SELECT *, 'owner' AS type FROM ClubOwner WHERE userName='******' AND password='******';";
                return(dbMan.ExecuteReader(query));
            }
            return(null);
        }