Esempio n. 1
0
 public static bool Contatins(int id)
 {
     using (var connector = new BDConnector())
     {
         return(connector.GetFirstString("Meetings", "FirstUserID", $"ID = {id}") != null &&
                connector.GetFirstString("Meetings", "SecondUserID", $"ID = {id}") != null);
     }
 }
Esempio n. 2
0
        public static Meeting GetById(int id)
        {
            using (var connector = new BDConnector())
            {
                var condition = $"ID = {id}";
                var meeting   = new Meeting
                {
                    FirstUserId       = connector.GetFirstString("Meetings", "ID", condition),
                    SecondUserId      = connector.GetFirstString("Meetings", "FirstUserId", condition),
                    Date              = connector.GetFirstDataTime("Meetings", "Date", condition),
                    FirstUserSetRate  = connector.GetFirstOrDefaultBool("Meetings", "FirstUserSetRate", condition),
                    SecondUserSetRate = connector.GetFirstOrDefaultBool("Meetings", "SecondUserSetRate", condition)
                };

                return(Contatins(meeting) ? meeting : null);
            }
        }