Пример #1
0
 public override bool Equals(System.Object otherStylist)
 {
     if (!(otherStylist is Stylist))
     {
         return(false);
     }
     else
     {
         Stylist newStylist   = (Stylist)otherStylist;
         bool    idEquality   = (this.GetStyId() == newStylist.GetStyId());
         bool    nameEquality = (this.GetStylistName() == newStylist.GetStylistName());
         return(idEquality && nameEquality);
     }
 }
Пример #2
0
 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    stylistEquality = (this.GetStylistName() == newStylist.GetStylistName());
         // bool clientEquality = this.GetClientId() == newStylist.GetClientId();
         return(idEquality && stylistEquality);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
        public string GetName(Client clientele)
        {
            int clientSearchId = clientele.GetStylistId();

            MySqlConnection conn = DB.Connection();

            conn.Open();

            var cmd = conn.CreateCommand() as MySqlCommand;

            cmd.CommandText = @"SELECT * FROM stylists WHERE id = @searchId;";

            MySqlParameter searchId = new MySqlParameter();

            searchId.ParameterName = "@searchId";
            searchId.Value         = clientSearchId;
            cmd.Parameters.Add(searchId);

            var rdr = cmd.ExecuteReader() as MySqlDataReader;

            int    stylistId   = 0;
            string stylistName = "";

            while (rdr.Read())
            {
                stylistId   = rdr.GetInt32(0);
                stylistName = rdr.GetString(1);
            }

            Stylist foundStylist = new Stylist(stylistName, stylistId);

            conn.Close();
            if (conn != null)
            {
                conn.Dispose();
            }

            string namedStylist = foundStylist.GetStylistName();

            return(namedStylist);
        }
Пример #5
0
 public void ToDictionary(Stylist stylist)
 {
     _Styler.Add(stylist.GetId(), stylist.GetStylistName());
 }