public bool CreateComment(string id, string comment)
        {
            int rightId;

            if (Int32.TryParse(id, out rightId) &&
                !String.IsNullOrEmpty(comment))
            {
                if (_fileDao.GetFileById(rightId) != null)
                {
                    _commentDao.CreateComment(rightId, comment);

                    return(true);
                }
                else
                {
                    Console.WriteLine("Can't find file");
                    return(false);
                }
            }
            else
            {
                Console.WriteLine("Incorrect ID (not number) or incorrect comment (empty)");
                return(false);
            }
        }
Пример #2
0
 public Files GetFileById(int id)
 {
     return(_fileDao.GetFileById(id));
 }