CinderellaMGS.SQL_Queries.NewCinderella C# (CSharp) Méthode

NewCinderella() public méthode

Inserts into the Cinderella Table the new Cinderella to be added
public NewCinderella ( string id, string fname, string lname, string date, string time, string referral ) : string
id string Cinderellas given iD
fname string Cinderellas First Name
lname string Cinderellas Last Name
date string Cinderellas Appt Date
time string Cinderellas Appt Time
referral string The person who referred the Cinderella to the Program
Résultat string
        public string NewCinderella(string id, string fname, string lname, string date, string time, string referral)
        {
            string tempSQLa = "INSERT INTO Cinderella ([ID], [firstName], [lastName], [apptDate], [apptTime], [referralName], [certificateSent], [notes]) ";
            string tempSQLb = "VALUES ('"+id +"'" + "," + "'" + fname + "'" + ", " + "'" + lname + "'" + ", " + "'"  + date + "'"  +"," + "'" + time + "'" + "," + "'" + referral+ "'" + "," + "NULL" + "," + "NULL" +  ")";
            string sql = tempSQLa + tempSQLb;

            database.ExecuteQuery(sql);

            //return the godmother id
            DataSet ds = sqlSelect("getlastCinderellaID");

            DataTable dt = ds.Tables["tableName"];
            return dt.Rows[0][0].ToString();
        }