Esempio n. 1
0
        public void InitView(Int32 idCommunity)
        {
            litePerson p = CurrentManager.Get <litePerson>(UserContext.CurrentUserID);

            if (UserContext.isAnonymous && p != null)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                NoticeBoard.Domain.ModuleNoticeboard permissions = ServiceNoticeboard.GetPermissions((idCommunity > 0) ? idCommunity : 0);
                lm.Comol.Core.BaseModules.NoticeBoard.Domain.liteHistoryItem message = ServiceNoticeboard.GetLastHistoryItem(idCommunity);
                if (permissions.Administration || permissions.ViewCurrentMessage)
                {
                    if (message == null)
                    {
                        View.LoadNoMessage();
                    }
                    else
                    {
                        if (idCommunity == 0)
                        {
                            View.LoadMessage(message, p);
                        }
                        else
                        {
                            liteSubscriptionInfo s = Service.GetSubscriptionInfo(p.Id, idCommunity);
                            if (s == null)
                            {
                                View.LoadNoPermissionsToSeeMessage();
                            }
                            else
                            {
                                View.LoadMessage(message, idCommunity, s);
                            }
                        }
                    }
                }
                else
                {
                    View.LoadNoPermissionsToSeeMessage();
                }
            }
        }
Esempio n. 2
0
 public void InitView(Int32 idCommunity)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout();
     }
     else
     {
         NoticeBoard.Domain.ModuleNoticeboard permissions = ServiceNoticeboard.GetPermissions((idCommunity > 0) ? idCommunity : 0);
         if (permissions.Administration || permissions.ViewCurrentMessage)
         {
             View.LoadMessage(ServiceNoticeboard.GetLastMessageId((idCommunity > 0) ? idCommunity : 0), idCommunity);
         }
         else
         {
             View.LoadMessage(0, idCommunity);
         }
         if (permissions.Administration || permissions.DeleteMessage || permissions.EditMessage)
         {
             View.DisplayEdit(NoticeBoard.Domain.RootObject.NoticeboardDashboard(0, idCommunity, (idCommunity < 1), true));
         }
         View.AllowPrint = permissions.Administration || permissions.ViewCurrentMessage || permissions.PrintMessage;
     }
 }