Пример #1
0
    public static TWho Create(SqlInt32 APerson, SqlInt32 ARepresentative)
    {
        if (APerson.IsNull || APerson.Value <= 0 )
          return Null;

        TWho h = new TWho();
        h._Person         = APerson.Value;
        if (ARepresentative.IsNull || ARepresentative.Value <= 0)
          h._Representative = 0;
        else
          h._Representative = ARepresentative.Value;
        return h;
    }
Пример #2
0
    public static TWho Parse(SqlString s)
    {
        if (s.IsNull)
          return Null;

        String value = s.Value;
        if (value == "")
          return Null;

        int Pos = value.IndexOf(":");
        if (Pos < 0)
          return Null;

        TWho u = new TWho();
        if (Pos > 0)
          u._Person         = Int32.Parse(value.Substring(0, Pos));
        else
          u._Person         = 0;

        if (Pos < value.Length - 1)
          u._Representative = Int32.Parse(value.Substring(Pos + 1));
        else
          u._Representative = 0;

        return u;
    }
Пример #3
0
 public bool Equals(TWho arg)
 {
     return (this._Person == arg._Person) && (this._Representative == arg._Representative);
 }