Example #1
0
        /// <summary>
        /// Removes a Notification from the repository
        /// </summary>
        /// <param name="notification">
        /// To be removed from the repository
        /// </param>
        /// <returns>
        /// True if the Notification was found and removed from the repository, otherwise false
        /// </returns>
        public bool Delete(NotificationDAL notification)
        {
            /*
             * find the Notification in the repo. It is identified by the combination of its TaskId
             * and Time fields
             */
            var findQuery = from row in table.AsEnumerable()
                            where row.RowState != DataRowState.Deleted &&
                            row.Field <string>("TaskId") == notification.taskId.ToString() &&
                            row.Field <string>("Time") == notification.time.ToString()
                            select row;

            if (findQuery.Count() != 1)
            {
                return(false);
            }

            try {
                findQuery.First().Delete();
            }
            catch {
                return(false);
            }

            return(true);
        }
        public string Accept(string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //FRIEND ACCEPTS YOU INVITATION

            FriendshipDAL dal = new FriendshipDAL();

            string memberId = Context.Session["memberID"].ToString();
            Member aMember  = new Member(memberId);

            Member aFriend = new Member(friendID);

            dal.UpdateInvitationStatus(aMember, aFriend, "Accepted");

            notificationDAL.InsertFriendRequestAcceptedNotification(aMember, aFriend);

            //To update status on form
            //=====================================================================
            dal.GetInvitationStatus(aMember, aFriend);

            List <Member_Friend> statusList = new List <Member_Friend>();

            statusList = dal.GetInvitationStatus(aMember, aFriend);
            string InvitationStatus = statusList[0].InvitationStatus;

            return(InvitationStatus);
        }
        public string AddComment(int postID, string commentTxt)
        {
            Comments comment = new Comments();
            comment.MemberId = Context.Session["memberID"].ToString();
            comment.CommentText = commentTxt;
            comment.PostId = postID;
            messageDAL.InsertComment(comment);

            //Insert notification
            NotificationDAL notificationDAL = new NotificationDAL();

            Post aPost = new Post(postID);

            List<Member> MemberList = new List<Member>();
            MemberList = notificationDAL.GetPostOwner(aPost);
            string friendId = MemberList[0].MemberId;
            Member aFriend = new Member(friendId);

            Member aMember = new Member(Context.Session["memberID"].ToString());

            if (aMember.MemberId != aFriend.MemberId)
            {
                notificationDAL.InsertCommentedOnPostNotification(aMember, aFriend, aPost);
            }
            //Refreshing the Comment count
            Post post = new Post();
            post.PostId = comment.PostId;

            return messageDAL.CountComments(post).ToString();
        }
        public int TagAPost(int postID, string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //Tag method here
            Member m;
            Post   p;

            bool isTagged = tagDAL.TagFriend(p = new Post(postID), m = new Member(friendID));


            // INSERT NOTIFICATION
            string friendId = friendID;
            Member aFriend  = new Member(friendId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember  = new Member(memberId);

            aPost.PostId = postID;

            notificationDAL.InsertTagNotification(aMember, aFriend, aPost);
            //return number of tags
            int numberoftags = newsFeedDAL.CountPostTags(aPost);

            return(numberoftags);
        }
        public string Accept(string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //FRIEND ACCEPTS YOU INVITATION

            FriendshipDAL dal = new FriendshipDAL();

            string memberId = Context.Session["memberID"].ToString();
            Member aMember = new Member(memberId);

            Member aFriend = new Member(friendID);

            dal.UpdateInvitationStatus(aMember, aFriend, "Accepted");

            notificationDAL.InsertFriendRequestAcceptedNotification(aMember, aFriend);

            //To update status on form
            //=====================================================================
            dal.GetInvitationStatus(aMember, aFriend);

            List<Member_Friend> statusList = new List<Member_Friend>();

            statusList = dal.GetInvitationStatus(aMember, aFriend);
            string InvitationStatus = statusList[0].InvitationStatus;
            return InvitationStatus;
        }
        public string AddComment(int postID, string commentTxt)
        {
            Comments comment = new Comments();

            comment.MemberId    = Context.Session["memberID"].ToString();
            comment.CommentText = commentTxt;
            comment.PostId      = postID;
            messageDAL.InsertComment(comment);

            //Insert notification
            NotificationDAL notificationDAL = new NotificationDAL();

            Post aPost = new Post(postID);

            List <Member> MemberList = new List <Member>();

            MemberList = notificationDAL.GetPostOwner(aPost);
            string friendId = MemberList[0].MemberId;
            Member aFriend  = new Member(friendId);

            Member aMember = new Member(Context.Session["memberID"].ToString());

            if (aMember.MemberId != aFriend.MemberId)
            {
                notificationDAL.InsertCommentedOnPostNotification(aMember, aFriend, aPost);
            }
            //Refreshing the Comment count
            Post post = new Post();

            post.PostId = comment.PostId;


            return(messageDAL.CountComments(post).ToString());
        }
        public async Task <HttpResponseMessage> GetNotificationList(int UserID, int currentIndex, int maxRow)
        {
            try
            {
                NotificationDAL dal  = new NotificationDAL();
                NotiInfo        data = await dal.GetNotificationList(UserID, currentIndex, maxRow);

                if (data != null)
                {
                    return(Request.CreateResponse <NotiInfo>(HttpStatusCode.OK, data));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, Constants.ErrorNotFound));
                }
            }
            catch (DbEntityValidationException ex)
            {
                var    controllerName = ControllerContext.RouteData.Values["controller"].ToString();
                var    actionName     = ControllerContext.RouteData.Values["action"].ToString();
                Logger log            = new Logger();
                log.ErrorLog(ex, controllerName, actionName);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, Constants.ErrorSysError));
            }
        }
Example #8
0
 public static string insertNotification(NotificationBO objNotification)
 {
     if (!objNotification.MyNotification.Equals(""))
     {
         return(NotificationDAL.insertNotification(objNotification));
     }
     else
     {
         return(null);
     }
 }
        public NotificationDetails GetAllNotificationDetailById(int id)
        {
            try
            {
                NotificationDAL notificationDAL = new NotificationDAL();
                return notificationDAL.GetAllNotificationDetailById(id);
            }
            catch (Exception ex)
            {

            }
            return null;
        }
        public List<NotificationDetails> GetAllUnseenNotificationDetailByUser(int userId)
        {
            try
            {
                NotificationDAL notificationDAL = new NotificationDAL();
                return notificationDAL.GetAllUnseenNotificationDetailByUser(userId);
            }
            catch (Exception ex)
            {

            }
            return null;
        }
        public static List<NotificationDetails> GetAllNotificationDetails()
        {
            try
            {
                NotificationDAL notificationDAL = new NotificationDAL();
                return notificationDAL.GetAllNotificationDetails();
            }
            catch(Exception ex)
            {

            }
            return null;
        }
Example #12
0
 /// <summary>
 /// This method is used for the get details for Template Master details.
 /// </summary>
 /// <param name="i_sConnectionString">DB COnnection string</param>
 /// <param name="i_nTradingPolicyId">Template Master ID</param>
 /// <returns></returns>
 public List <NotificationDTO> GetNotificationAlertList(string i_sConnectionString, int inp_iLoggedInUserId, string sCalledFrom)
 {
     try
     {
         using (var objNotificationDAL = new NotificationDAL())
         {
             return(objNotificationDAL.GetNotificationAlertList(i_sConnectionString, inp_iLoggedInUserId, sCalledFrom));
         }
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Example #13
0
 /// <summary>
 /// This method is used for the get details for Template Master details.
 /// </summary>
 /// <param name="i_sConnectionString">DB COnnection string</param>
 /// <param name="i_nTradingPolicyId">Template Master ID</param>
 /// <returns></returns>
 public NotificationDTO GetDetails(string i_sConnectionString, int i_nNotificationQueueId)
 {
     try
     {
         using (var objNotificationDAL = new NotificationDAL())
         {
             return(objNotificationDAL.GetDetails(i_sConnectionString, i_nNotificationQueueId));
         }
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Example #14
0
 /// <summary>
 /// This method is used for the get details for User notification.
 /// </summary>
 /// <param name="i_sConnectionString">DB COnnection string</param>
 /// <param name="inp_iLoggedInUserId"> LoggedIn User ID</param>
 /// <returns></returns>
 public List <NotificationDTO> GetDashboardNotificationList(string i_sConnectionString, int inp_iLoggedInUserId)
 {
     try
     {
         using (var objNotificationDAL = new NotificationDAL())
         {
             return(objNotificationDAL.GetDashboardNotificationList(i_sConnectionString, inp_iLoggedInUserId));
         }
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Example #15
0
        public int LikeAComment(int commentID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //LIKE A COMMENT

            RateAndTagDAL dal = new RateAndTagDAL();

            Comments aComment = new Comments(commentID);

            List <Member> MemberList = new List <Member>();

            MemberList = notificationDAL.GetCommentOwner(aComment);
            Member aFriend = new Member(MemberList[0].MemberId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember  = new Member(memberId);


            //checking if u have already rated the comment
            if (dal.CommentRatingExists(aMember, aComment) == 0)
            {
                //proceed and rate if u havnt commented
                dal.RateComment(aMember, aComment);

                List <Rating> RatingList = new List <Rating>();
                RatingList = notificationDAL.GetCommentRatingID(aComment, aMember);

                Rating aRating = new Rating(RatingList[0].RatingId);

                if (RatingList.Count > 0)
                {
                    notificationDAL.InsertCommentRatingNotification(aRating, aMember, aFriend, aComment);
                }
            }
            else
            {
                //you have already rated the comment
                //MessageBox.Show("already rated by u");
            }

            //like count
            int numberofCommentLikes = newsFeedDAL.CountCommentsLikes(aComment);

            return(numberofCommentLikes);
        }
Example #16
0
        /// <summary>
        /// This method is used for the Get Company Details For Notification
        /// </summary>
        /// <param name="i_sConnectionString">Master DB Connection string</param>
        /// <param name="i_nCompanyId">Company ID</param>
        /// <param name="i_sCompanyDBName">Company database name for fetching the SMTP details for the corresponding company.
        /// If Companyid is not given i.e. is 0 then this will be used for fetching the details.</param>
        /// <returns></returns>
        public CompanyDetailsForNotificationDTO GetCompanyDetailsForNotification(string i_sConnectionString, int i_nCompanyId, string i_sCompanyDBName = "")
        {
            List <InsiderTradingDAL.CompanyDetailsForNotificationDTO> objCompanyDetailsForNotificationDTO = new List <CompanyDetailsForNotificationDTO>();

            //NotificationDAL objNotificationDAL = new NotificationDAL();
            try
            {
                using (var objNotificationDAL = new NotificationDAL())
                {
                    objCompanyDetailsForNotificationDTO = (List <InsiderTradingDAL.CompanyDetailsForNotificationDTO>)objNotificationDAL.GetCompanyDetailsForNotification(i_sConnectionString, i_nCompanyId, i_sCompanyDBName);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            return(objCompanyDetailsForNotificationDTO.Count > 0?objCompanyDetailsForNotificationDTO[0]:null);
        }
Example #17
0
        public int LikeAPost(int postID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            RateAndTagDAL dal = new RateAndTagDAL();

            Post aPost = new Post(postID);

            List <Member> MemberList = new List <Member>();

            MemberList = notificationDAL.GetPostOwner(aPost);
            Member aFriend = new Member(MemberList[0].MemberId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember  = new Member(memberId);

            //Check if like exists
            if (dal.PostRatingExists(aMember, aPost) == 0)
            {
                dal.RatePost(aMember, aPost);


                List <Rating> RatingList = new List <Rating>();
                RatingList = notificationDAL.GetPostRatingID(aPost, aMember);

                Rating aRating = new Rating(RatingList[0].RatingId);

                if (RatingList.Count > 0)
                {
                    notificationDAL.InsertPostRatingNotification(aRating, aMember, aFriend, aPost);
                }
            }
            else
            {
                //MessageBox.Show("already rated by u");
            }


            aPost.PostId = postID;

            int numberofPostLikes = newsFeedDAL.CountPostLikes(aPost);

            return(numberofPostLikes);
        }
Example #18
0
        protected void OnNotificationAdded(object source, Notification notification)
        {
            //update database with new notification
            NotificationDAL notificationDal = new NotificationDAL {
                taskId = notification.Producer.ID,
                time   = notification.Time
            };

            INotificationRepository notificationRepo = notificationRepositoryFactory.New();

            notificationRepo.Add(notificationDal);

            ITaskItemRepository taskRepo = taskItemRepositoryFactory.New();
            List <TaskItemDAL>  tasks    = new List <TaskItemDAL>(taskRepo.GetAll());

            if (notification.Producer is TaskItem task)
            {
                //update the notifications producer in the database
                TaskItemDAL taskItemDAL = tasks.Find(t => t.id == task.ID);
                taskItemDAL.lastNotificationTime = task.LastNotificationTime;
                if (taskRepo.Update(taskItemDAL) == false)
                {
                    //could not update task in database
                }

                //create DTO to invoke NotificationAdded with
                NotificationDTO dto = new NotificationDTO()
                {
                    TaskId = task.ID,
                    Time   = notification.Time,
                    Title  = notification.Producer.Title,
                    R      = task.Colour.R,
                    G      = task.Colour.G,
                    B      = task.Colour.B
                };

                //invoked event delegates
                NotificationAdded?.Invoke(source, dto);
            }

            taskRepo.Save();
            notificationRepo.Save();
        }
Example #19
0
        /// <summary>
        /// Adds a new Notification to the repository for it to manage.
        /// </summary>
        /// <param name="notification">
        /// To be added to the repository
        /// </param>
        /// <returns>
        /// True if the NotificationDAL was successfuly added to the repository, otherwise false.
        /// </returns>
        public bool Add(NotificationDAL notification)
        {
            //create new row with table's schema
            DataRow newRow = table.NewRow();

            try {
                //set the fields of the new row
                newRow.SetField("TaskId", notification.taskId.ToString());
                newRow.SetField("Time", notification.time.ToString());
            }
            catch {
                newRow.Delete();
                return(false);
            }

            //add the row to the table
            table.Rows.Add(newRow);

            return(true);
        }
        public string InviteFriend(string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //INVITE FRIEND

            FriendshipDAL dal = new FriendshipDAL();

            string memberId = Context.Session["memberID"].ToString();
            Member aMember = new Member(memberId);

            Member aFriend = new Member(friendID);

            if (dal.InviteExists(aMember, aFriend) == 1)
            {
                //An invitation has already been sent
                //MessageBox.Show("invite exists");
            }
            else if (dal.InviteExists(aMember, aFriend) == 0)
            {
                //invite friend
                dal.InviteFriend(aMember, aFriend);

                notificationDAL.InsertFriendRequestSentNotification(aMember, aFriend);
            }

            //UPDATE STATUS ON FORM
            //=====================================================================
            dal.GetInvitationStatus(aMember, aFriend);

            List<Member_Friend> statusList = new List<Member_Friend>();

            statusList = dal.GetInvitationStatus(aMember, aFriend);
            string InvitationStatus = statusList[0].InvitationStatus;

            return InvitationStatus;
        }
        public string InviteFriend(string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //INVITE FRIEND

            FriendshipDAL dal = new FriendshipDAL();

            string memberId = Context.Session["memberID"].ToString();
            Member aMember  = new Member(memberId);

            Member aFriend = new Member(friendID);

            if (dal.InviteExists(aMember, aFriend) == 1)
            {
                //An invitation has already been sent
                //MessageBox.Show("invite exists");
            }
            else if (dal.InviteExists(aMember, aFriend) == 0)
            {
                //invite friend
                dal.InviteFriend(aMember, aFriend);

                notificationDAL.InsertFriendRequestSentNotification(aMember, aFriend);
            }

            //UPDATE STATUS ON FORM
            //=====================================================================
            dal.GetInvitationStatus(aMember, aFriend);

            List <Member_Friend> statusList = new List <Member_Friend>();

            statusList = dal.GetInvitationStatus(aMember, aFriend);
            string InvitationStatus = statusList[0].InvitationStatus;

            return(InvitationStatus);
        }
Example #22
0
        public string[] AddCommentnRefresh(int postID, string commentTxt, int lastCommentID)
        {
            NewsfeedDAL newsfeedDAL = new NewsfeedDAL();
            MessagesDAL messageDAL = new MessagesDAL();
            Comments comment = new Comments();
            StringBuilder commentBuilder = new StringBuilder();

            //Decrypting the member ID
            comment.MemberId = Context.Session["memberID"].ToString();

            comment.CommentText = commentTxt;
            comment.PostId = postID;
            comment.Commentid = lastCommentID;
            messageDAL.InsertComment(comment);

            //Insert notification
            NotificationDAL notificationDAL = new NotificationDAL();

            Post aPost = new Post(postID);

            List<Member> MemberList = new List<Member>();
            MemberList = notificationDAL.GetPostOwner(aPost);
            string friendId = MemberList[0].MemberId;
            Member aFriend = new Member(friendId);

            Member aMember = new Member(Context.Session["memberID"].ToString());

            if (aMember.MemberId != aFriend.MemberId)
            {
                notificationDAL.InsertCommentedOnPostNotification(aMember, aFriend, aPost);
            }

            //Refreshing the Comment count
            Post post = new Post();
            post.PostId = comment.PostId;

            //###################################
            //refreshing Comments
            //###################################

            DataTable comments = newsfeedDAL.GetRefreshComments(post, comment);

            foreach (DataRow row in comments.Rows)
            {
                date = Convert.ToDateTime(row["CreateDate"]).ToString("M");

                //Building single message view box
                commentBuilder.Append("<div id='");
                commentBuilder.Append((row["CommentID"]).ToString());

                commentBuilder.Append("' class='aComment'><div class='deleteComment floatright'>");

                if ((row["MemberID"]).ToString() == Session["memberID"].ToString())
                {

                    commentBuilder.Append("<a class='btnDleteComment ui-icon ui-icon-close tip' title='Delete this comment'></a>");
                }
                else
                {
                    commentBuilder.Append("<a class='btnOpenMenuComment ui-icon ui-icon-circle-triangle-s tip' title='More options..'></a>");
                }

                commentBuilder.Append("</div><h5><a style='font-weight:normal;' ");
                commentBuilder.Append("id='" + (row["MemberID"]).ToString() + "'> ");

                commentBuilder.Append(row["Friend"].ToString());
                commentBuilder.Append("</a><span class='DateWithTime ui-corner-all floatright'>");

                Reusable_Methods reusable_Methods = new Reusable_Methods();
                date = reusable_Methods.FormatDateTime(Convert.ToDateTime(row["CreateDate"]));

                commentBuilder.Append(date);
                commentBuilder.Append("</span></h5><p>");
                commentBuilder.Append((row["CommentText"]).ToString());
                commentBuilder.Append("</p></div>");
                //End Building

            }
                        //Array with the       //number of commeents         //new comments
              var comentArray =  new string[] { messageDAL.CountComments(post).ToString(), commentBuilder.ToString()};

            return comentArray;
        }
 public static void AddNotificationForUser(int userId, int notificationId)
 {
     NotificationDAL.Add(new user_notification_tbl {
         user_id = userId, notification_id = notificationId, is_read = false
     });
 }
Example #24
0
        public int LikeAPost(int postID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            RateAndTagDAL dal = new RateAndTagDAL();

            Post aPost = new Post(postID);

            List<Member> MemberList = new List<Member>();
            MemberList = notificationDAL.GetPostOwner(aPost);
            Member aFriend = new Member(MemberList[0].MemberId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember = new Member(memberId);

            //Check if like exists
            if (dal.PostRatingExists(aMember, aPost) == 0)
            {
                dal.RatePost(aMember, aPost);

                List<Rating> RatingList = new List<Rating>();
                RatingList = notificationDAL.GetPostRatingID(aPost, aMember);

                Rating aRating = new Rating(RatingList[0].RatingId);

                if (RatingList.Count > 0)
                {
                    notificationDAL.InsertPostRatingNotification(aRating, aMember, aFriend, aPost);
                }
            }
            else
            {
                //MessageBox.Show("already rated by u");
            }

            aPost.PostId = postID;

            int numberofPostLikes = newsFeedDAL.CountPostLikes(aPost);
            return numberofPostLikes;
        }
Example #25
0
        public int TagAPost(int postID, string friendID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //Tag method here
            Member m;
            Post p;

            bool isTagged = tagDAL.TagFriend(p = new Post(postID), m = new Member(friendID));

            // INSERT NOTIFICATION
            string friendId = friendID;
            Member aFriend = new Member(friendId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember = new Member(memberId);

            aPost.PostId = postID;

            notificationDAL.InsertTagNotification(aMember, aFriend, aPost);
            //return number of tags
            int numberoftags = newsFeedDAL.CountPostTags(aPost);
            return numberoftags;
        }
Example #26
0
 public static void AddNotification(Notification notification)
 {
     NotificationDAL.Add(Converters.NotificationConverter.ToDAL(notification));
 }
Example #27
0
        public int LikeAComment(int commentID)
        {
            NotificationDAL notificationDAL = new NotificationDAL();

            //LIKE A COMMENT

            RateAndTagDAL dal = new RateAndTagDAL();

            Comments aComment = new Comments(commentID);

            List<Member> MemberList = new List<Member>();
            MemberList = notificationDAL.GetCommentOwner(aComment);
            Member aFriend = new Member(MemberList[0].MemberId);

            string memberId = Context.Session["memberID"].ToString();
            Member aMember = new Member(memberId);

            //checking if u have already rated the comment
            if (dal.CommentRatingExists(aMember, aComment) == 0)
            {
                //proceed and rate if u havnt commented
                dal.RateComment(aMember, aComment);

                List<Rating> RatingList = new List<Rating>();
                RatingList = notificationDAL.GetCommentRatingID(aComment, aMember);

                Rating aRating = new Rating(RatingList[0].RatingId);

                if (RatingList.Count > 0)
                {
                    notificationDAL.InsertCommentRatingNotification(aRating, aMember, aFriend, aComment);
                }
            }
            else
            {
                //you have already rated the comment
                //MessageBox.Show("already rated by u");
            }

            //like count
            int numberofCommentLikes = newsFeedDAL.CountCommentsLikes(aComment);
            return numberofCommentLikes;
        }
Example #28
0
 public NotificationBAL()
 {
     notificationDal = new NotificationDAL();
 }
Example #29
0
        private void OpenWrapper(int i)
        {
            #region OPENING WRAPPER
            aPost = (Post)ArrayPosts[i];

            ArrayMembers = bl.GetMemberDisplayName(aPost.MemberId);
            countMembers = ArrayMembers.Count;

            for (int a = 0; a < countMembers; ++a)
            {
                aMember = (Member)ArrayMembers[a];

                NotificationDAL notificationDAL = new NotificationDAL();
                Group group = new Group(aPost.GroupId);

                string groupDescription = notificationDAL.GetGroupDescription2(group);
                if (aPost.PostType != "Article")
                {

                    concatinater.Append("<div class='aPost ");

                    switch (aPost.PostType)
                    {
                        case "Text":
                            concatinater.Append("typeOfText");
                            ClientUpdateType = "Text";
                            break;
                        case "Event":
                            concatinater.Append("typeOfEvent");
                            ClientUpdateType = "Event";
                            break;
                        case "Photo":
                            concatinater.Append("typeOfPhoto");
                            ClientUpdateType = "Photo";
                            break;
                        case "Article":
                            concatinater.Append("typeOfArticle");
                            ClientUpdateType = "Article";
                            break;
                        case "Video":
                            concatinater.Append("typeOfVideo");
                            ClientUpdateType = "Video";
                            break;
                        case "File":
                            concatinater.Append("typeOfFile");
                            ClientUpdateType = "File";
                            break;
                        default:

                            break;


                    }


                    concatinater.Append("' id='");
                    concatinater.Append(aPost.PostId);
                    concatinater.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> Posted by: <a href='#' id='");
                    concatinater.Append(aPost.MemberId);
                    concatinater.Append("' class='btnMemberProfile' style='font-weight:normal; '>");
                    concatinater.Append(aMember.DisplayName);

                    bool isForMember = false;

                    string date = "";



                    date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                    try
                    {
                        tempMemberID = Context.Session["memberID"].ToString();

                    }
                    catch
                    {
                        tempMemberID = ClientUpdateMemberID;

                    }

                    if (aPost.MemberId == tempMemberID)
                    { isForMember = true; }

                    if (GroupID == aPost.GroupId)
                    {


                    }
                    else
                    {
                        concatinater.Append("</a> <span class='space'></span> in group: <a id='");
                        ClientUpdateGroupID = aPost.GroupId;
                        concatinater.Append(aPost.GroupId);

                        concatinater.Append("' class='btnGoToGroupPage groupDesc'>");
                        concatinater.Append(groupDescription);

                    }

                    concatinater.Append("</a>");
                    if (isForMember)
                    {
                        concatinater.Append("<span class='ui-icon ui-icon-closethick floatright deletePost pointer ' title ='Delete this post' style='display:none;'></span>");
                    }

                    concatinater.Append("<span class='DateWithTime ui-corner-all floatright'>");
                    concatinater.Append(date);
                    //concatinater.Append(Convert.ToDateTime(aPost.CreateDate).ToString("D"));
                    concatinater.Append("</span></h2></div> <div class='postContentArea'> <div> ");


                }
                else
                {
                    string sessionMemberID = "";
                    ChatDAL chatDAL = new ChatDAL();
                    try
                    {
                        sessionMemberID = Context.Session["memberID"].ToString();

                    }
                    catch
                    {
                        sessionMemberID = ClientUpdateMemberID;

                    }

                    Member thisMember = new Member(sessionMemberID);


                    Post post = new Post(aPost.PostId);
                    Article_Post thisArticle = chatDAL.getChatText(ref post);

                    //BulabulaApp.Other_Classes. date new = reusable_Methods.FormatDateTime(aPost.CreateDate);
                    Reusable_Methods reusable_Methods = new Reusable_Methods();
                    string date = reusable_Methods.FormatDateTimeForChat(post.CreateDate);
                    thisMember = chatDAL.GetMemberDisplayName(thisMember);

                    ChatText.Append(" <div id='");
                    ChatText.Append(aPost.PostId);
                    ChatText.Append("' class='chatMemberWrapper'>");
                    ChatText.Append("<div class='memberNameSection  '> <a id=");
                    ChatText.Append(thisMember.MemberId);
                    ChatText.Append(" class='btnMemberProfile pointer' ><em>");
                    ChatText.Append(thisMember.DisplayName);
                    ChatText.Append("</em></a></div>");
                    ChatText.Append("</a></div>");
                    ChatText.Append("<div class='chatContentSection '>");
                    ChatText.Append(thisArticle.ArticleText);



                    ChatText.Append("</div> <div class='clr'></div><span class='time'>");
                    ChatText.Append(date);
                    ChatText.Append(" <span> </div>");
                    string chatString = ChatText.ToString();
                }
            }
            #endregion
        }
 public static List <Notification> GetAll()
 {
     return(Converters.NotificationConverter.ListToDTO(NotificationDAL.Get()));
 }
Example #31
0
 /// <summary>
 /// Not supported by this repository because all the elements of a Notification
 /// form a composite key, so editing them would affect the Notifications identity
 /// </summary>
 /// <param name="notification">unused</param>
 /// <returns>always false</returns>
 public bool Update(NotificationDAL notification)
 {
     return(false);
 }
 public int GetuserIdBYSignalRId(string signalRID)
 {
     NotificationDAL notificationDAL = new NotificationDAL();
     var userid =notificationDAL.GetuserIdBYSignalRId(signalRID);
     return userid;
 }
 public void SaveUserDetails(UserDetails ud)
 {
     NotificationDAL notificationDAL = new NotificationDAL();
     notificationDAL.SaveUserDetails(ud);
 }
 public void SaveNotification(NotificationDetails nd)
 {
     NotificationDAL notificationDAL = new NotificationDAL();
     notificationDAL.SaveNotification(nd);
 }
 public static Notification GetById(int id)
 {
     return(Converters.NotificationConverter.ToDTO(NotificationDAL.GetById(id)));
 }
        //public static Notification GetByUsetId(int id)
        //{
        //    return Converters.NotificationConverter.ToDTO(NotificationDAL.GetById(id));
        //}
        public static List <Notification> GetByUsetId(int userId)
        {
            List <UserNotification> notifications = UserNotificationConverter.ListToDTO(UserNotificationDAL.GetByUserId(userId));

            return(NotificationDAL.GetByUserId(notifications));
        }
Example #37
0
 public NotificationBUS()
 {
     notificationDAL = new NotificationDAL();
 }
 public static int AddNotification(string message)
 {
     return(NotificationDAL.Add(new notification_tbl {
         messege = message
     }));
 }