예제 #1
0
        private void PostCommentOnClick(object sender, EventArgs e, Entry entry, Competition comp)
        {
            if (!entry.IsVisible)
            {
                entry.IsVisible = true;
                return;
            }
            else
            {
                if (meetsCommentCriteria(entry))
                {
                    //Post a comment
                    CommentRepos commentRep = new CommentRepos();
                    Comment      com        = new Comment(0, DateTime.Now, entry.Text, comp.Id, Session.Id);

                    try
                    {
                        MySQLManager.InsertComment(com);
                        entry.Text      = "";
                        entry.IsVisible = false;
                        Navigation.PushAsync(new CompetitionDetails(comp));
                    }
                    catch
                    {
                        return;
                    }
                }
                else
                {
                    //error msg mby
                }
            }
        }
예제 #2
0
 public UnitOfWork(ToDoListContext context)
 {
     _context      = context;
     ToDoTasks     = new ToDoTaskRepos(_context);
     Users         = new UserRepos(_context);
     JointUsers    = new JointUserRepos(_context);
     Comments      = new CommentRepos(_context);
     AttachedFiles = new AttachedFileRepos(_context);
     DbLogs        = new DbLogRepos(_context);
 }