public void AddStylist(Stylist newStylist) { MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"INSERT INTO stylists_clients (client_id, stylist_id) VALUES (@ClientId, @StylistId);"; MySqlParameter clientId = new MySqlParameter(); clientId.ParameterName = "@ClientId"; clientId.Value = _id; cmd.Parameters.Add(clientId); MySqlParameter stylistId = new MySqlParameter(); stylistId.ParameterName = "@stylistId"; stylistId.Value = newStylist.GetStylistId();//llok at path cmd.Parameters.Add(stylistId); cmd.ExecuteNonQuery(); conn.Close(); if (conn != null) { conn.Dispose(); } }
public void AddStylist(Stylist newStylist) { MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"INSERT INTO stylists_specialists (stylist_id, specialist_id) VALUES (@stylistId, @specialistId);"; MySqlParameter specialist_id = new MySqlParameter(); specialist_id.ParameterName = "@specialistId"; specialist_id.Value = _id; cmd.Parameters.Add(specialist_id); MySqlParameter Stylist_id = new MySqlParameter(); Stylist_id.ParameterName = "@stylistId"; Stylist_id.Value = newStylist.GetStylistId(); cmd.Parameters.Add(Stylist_id); // cmd.Parameters.AddWithValue("@stylsit_id", stylistId); // cmd.Parameters.AddWithValue("@specialist_id", this.Id); cmd.ExecuteNonQuery(); conn.Close(); if (conn != null) { conn.Dispose(); } }
public override bool Equals(System.Object otherStylist) { if (!(otherStylist is Stylist)) { return(false); } else { Stylist newStylist = (Stylist)otherStylist; bool idEquality = (this.GetStylistId() == newStylist.GetStylistId()); bool nameEquality = (this.GetStylistName() == newStylist.GetStylistName()); return(idEquality && nameEquality); } }
public override bool Equals(System.Object otherStylist) { if (!(otherStylist is Stylist)) { return(false); } else { Stylist newStylist = (Stylist)otherStylist; bool idEquality = this.GetStylistId() == newStylist.GetStylistId(); bool nameEquality = this.GetStylist() == newStylist.GetStylist(); return(idEquality && nameEquality); // bool idEquality = (this.Id == newClient.Id); // bool stylistEquality = (this.StylistName == newStylist.Stylist); // bool clientNameEquality = (this.ClientName == newStylist.ClientName); // return (idEquality && stylistEquality && clientNameEquality); } }
public override bool Equals(System.Object otherStylist) { if (!(otherStylist is Stylist)) { return(false); } else { Stylist newStylist = (Stylist)otherStylist; bool areNamesEqual = this.GetStylistName().Equals(newStylist.GetStylistName()); bool areIdsEqual = this.GetStylistId().Equals(newStylist.GetStylistId()); bool arePhoneEqual = this.GetStylistPhone().Equals(newStylist.GetStylistPhone()); bool areEmailEqual = this.GetStylistEmail().Equals(newStylist.GetStylistEmail()); bool areDateEqual = this.GetStylistDate().Equals(newStylist.GetStylistDate()); return(areNamesEqual && areIdsEqual && arePhoneEqual && areEmailEqual && areDateEqual); } }
public void AddStylist(Stylist newStylist) { MySqlConnection conn = DB.Connection(); conn.Open(); var cmd = conn.CreateCommand() as MySqlCommand; cmd.CommandText = @"INSERT INTO stylists_specialties (stylist_id, specialty_id) VALUES (@StylistId, @SpecialtyId);"; cmd.Parameters.Add(new MySqlParameter("@SpecialtyId", _specialtyId)); cmd.Parameters.Add(new MySqlParameter("@StylistId", newStylist.GetStylistId())); cmd.ExecuteNonQuery(); conn.Close(); if (conn != null) { conn.Dispose(); } }