コード例 #1
0
ファイル: Form1.cs プロジェクト: mvrshvl/mongoshop_myakishev
 private void ClearProduct_Click(object sender, EventArgs e)
 {
     codeProduct.Clear();
     NameProduct.Clear();
     quantityPtoduct.Clear();
     idProduct.Clear();
 }
コード例 #2
0
 public bool Equals(Product other)
 {
     if (other == null)
     {
         return(false);
     }
     else
     {
         if (!TypeProduct.Equals(other.TypeProduct))
         {
             return(false);
         }
         if (!NameProduct.Equals(other.NameProduct))
         {
             return(false);
         }
         if (!PriceProduct.Equals(other.PriceProduct))
         {
             return(false);
         }
         if (!QuantityProduct.Equals(other.QuantityProduct))
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #3
0
 public override int GetHashCode()
 {
     return(NameProduct.ToArray()[0] * 100 + (int)MessageType * 10 + (int)MessageTopic);
 }
コード例 #4
0
 public bool Equals(Category category)
 {
     return(category != null && NameProduct != null && NameProduct.Equals(category.NameProduct) &&
            MessageTopic == category.MessageTopic &&
            MessageType == category.MessageType);
 }