Supplier.cs 721 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. namespace Lab18
  3. {
  4. public class Supplier
  5. {
  6. string s_name;
  7. int s_id;
  8. public string S_name
  9. {
  10. get { return s_name; }
  11. }
  12. public int S_id
  13. {
  14. get { return s_id; }
  15. }
  16. public Supplier(string s_name, int s_id)
  17. {
  18. this.s_name = s_name;
  19. this.s_id = s_id;
  20. }
  21. public void Display()
  22. {
  23. Console.WriteLine("Supplier: s_name={0} s_id={1},s_name,s_id");
  24. }
  25. public override bool Equals(object obj)
  26. {
  27. Supplier p = obj as Supplier;
  28. return ((s_name == p.s_name) && (s_id == p.s_id));
  29. }
  30. }
  31. }