public Visitor GetVisitorEntity(BioService.Visitor proto)
    {
      if (proto == null)
        return null;

      Visitor entity = new Visitor();

      entity.Id = proto.Id;
      entity.Location_Id = proto.Locationid;
      entity.Detection_Time = new DateTime(proto.Time);
      entity.Card_Number = proto.CardNumber;
      entity.Photo_ID  = proto.Photoid;
      entity.Person_ID = proto.Personid;
      entity.Status    = (byte)proto.Status;
      return entity;
    }
    public BioService.Visitor GetVisitorProto(Visitor entity)
    {
      if (entity == null)
        return null;

      BioService.Visitor proto = new BioService.Visitor();

      proto.Id = entity.Id;
      proto.Locationid = entity.Location_Id;
      proto.Time = entity.Detection_Time.Ticks;
      proto.CardNumber = entity.Card_Number;
      proto.Status = (BioService.ResultStatus)entity.Status;
      //TODO something bad in logic
      if (entity.Photo_ID.HasValue)
        proto.Photoid = entity.Photo_ID.Value;

      if (entity.Person_ID.HasValue)
        proto.Personid = entity.Person_ID.Value;


      return proto;
    }