Esempio n. 1
0
 public override bool Equals(object obj)
 {
     if (obj is SmartDate)
     {
         SmartDate tmp = (SmartDate)obj;
         if (this.IsEmpty && tmp.IsEmpty)
         {
             return(true);
         }
         else
         {
             return(this.Date.Equals(tmp.Date));
         }
     }
     else if (obj is DateTime)
     {
         return(this.Date.Equals((DateTime)obj));
     }
     else if (obj is string)
     {
         return(this.CompareTo(obj.ToString()) == 0);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
 public int CompareTo(SmartDate value)
 {
     if (this.IsEmpty && value.IsEmpty)
     {
         return(0);
     }
     else
     {
         return(_date.CompareTo(value.Date));
     }
 }