public string UpdateEvent(int eventId, string name, DateTime eventdate, string addressStreetName,
                                  string addressStreetNumber, string addressPostalCode, string location, string phone,
                                  string email, string city, string countryCode, Boolean official)
        {
            string  sql = "";
            DataSet drA = null;
            DataSet drL = null;

            LocationConnection locationConnection = new LocationConnection();

            sql = "select location_id from events where id = '" + eventId + "'; ";

            drL = this.Query(sql);
            int locationId = int.Parse(drL.Tables[0].Rows[0][0].ToString());

            // getting the location_address id
            sql = "select address_id from locations where id = '" + locationId + "'; ";

            drA = this.Query(sql);
            int addressId = int.Parse(drA.Tables[0].Rows[0][0].ToString());

            this._UpdateEvent(eventId, name, eventdate, official, locationId);

            locationConnection.UpdateLocation(locationId, location, phone, email, addressId);
            AddressConnection addConn = new AddressConnection();

            addConn.UpdateAddress(addressId, addressStreetName, addressStreetNumber, city, addressPostalCode, countryCode);

            return("");
        }
Exemple #2
0
        //public string InserrtNewAthleteFromOther(string id, string firstName, string middleName, string lastName,
        //  DateTime dateOfBirth,
        //  string primaryPhoneNo, string secondaryPhoneNo, string email,
        //  string countryCode, string City, string addressStreetName, string addressStreetNumber, string addressPostalCode,
        //  string rank, string localClubId)
        //{
        //    string sql = "";
        //    DataSet dr = null;

        //    //this.updatePerson(id, firstName, middleName, lastName,
        //    //dateOfBirth,
        //    //primaryPhoneNo, secondaryPhoneNo, email);

        //    this._InsertAthlete(id, rank, localClubId);

        //    // getting the athlete_address id
        //    sql = "select address_id from persons where id = '" + id + "'; ";
        //    dr = this.Query(sql);
        //    int addressId = int.Parse(dr.Tables[0].Rows[0][0].ToString());

        //    AddressConnection addConn = new AddressConnection();
        //    addConn.UpdateAddress(addressId, countryCode, City, addressStreetName, addressStreetNumber, addressPostalCode);

        //    return "";
        //}



        public string UpdateAthlete(int id, string firstName, string lastName, string fathersName, string sex,
                                    DateTime dateOfBirth,
                                    string primaryPhoneNo, string secondaryPhoneNo, string email,
                                    string addressStreetName, string addressStreetNumber, string addressPostalCode, string countryCode, string City,
                                    string rank, string localClubId)
        {
            string  sql = "";
            DataSet dr  = null;

            this._UpdatetAthlete(id, rank, localClubId);

            // getting the athlete_address id
            sql = "select address_id from persons where id = '" + id + "'; ";

            dr = this.Query(sql);
            int addressId = int.Parse(dr.Tables[0].Rows[0][0].ToString());

            this.updatePerson(id, firstName, lastName, fathersName, sex, dateOfBirth,
                              primaryPhoneNo, secondaryPhoneNo, email, addressId);

            AddressConnection addConn = new AddressConnection();

            addConn.UpdateAddress(addressId, addressStreetName, addressStreetNumber, City, addressPostalCode, countryCode);

            return("");
        }