Ejemplo n.º 1
0
		///<summary></summary>
		public static long Insert(TaskUnread taskUnread){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
				taskUnread.TaskUnreadNum=Meth.GetLong(MethodBase.GetCurrentMethod(),taskUnread);
				return taskUnread.TaskUnreadNum;
			}
			return Crud.TaskUnreadCrud.Insert(taskUnread);
		}
Ejemplo n.º 2
0
 ///<summary></summary>
 public static long Insert(TaskUnread taskUnread)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         taskUnread.TaskUnreadNum = Meth.GetLong(MethodBase.GetCurrentMethod(), taskUnread);
         return(taskUnread.TaskUnreadNum);
     }
     return(Crud.TaskUnreadCrud.Insert(taskUnread));
 }
Ejemplo n.º 3
0
        ///<summary>Sets unread for a single user.  Works well without duplicates, whether it's already set to Unread(new) or not.</summary>
        public static void SetUnread(long userNum, Task task)
        {
            if (IsUnread(userNum, task))
            {
                return;                //Already set to unread, so nothing else to do
            }
            TaskUnread taskUnread = new TaskUnread();

            taskUnread.TaskNum = task.TaskNum;
            taskUnread.UserNum = userNum;
            task.IsUnread      = true;
            Insert(taskUnread);
        }
Ejemplo n.º 4
0
        ///<summary>Sets unread for a single user.  Works well without duplicates, whether it's already set to Unread(new) or not.</summary>
        public static void SetUnread(long userNum, long taskNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), userNum, taskNum);
                return;
            }
            if (IsUnread(userNum, taskNum))
            {
                return;                //Already set to unread, so nothing else to do
            }
            TaskUnread taskUnread = new TaskUnread();

            taskUnread.TaskNum = taskNum;
            taskUnread.UserNum = userNum;
            Insert(taskUnread);
        }
Ejemplo n.º 5
0
        ///<summary>Sets unread for a list of users.  This assumes that the list passed in has already checked for duplicate task unreads.</summary>
        public static void SetUnreadMany(List <long> listUserNums, long taskNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), listUserNums, taskNum);
                return;
            }
            List <TaskUnread> listUnreadsToInsert = new List <TaskUnread>();

            foreach (long userNum in listUserNums)
            {
                TaskUnread taskUnread = new TaskUnread();
                taskUnread.TaskNum = taskNum;
                taskUnread.UserNum = userNum;
                listUnreadsToInsert.Add(taskUnread);
            }
            Crud.TaskUnreadCrud.InsertMany(listUnreadsToInsert);
        }
Ejemplo n.º 6
0
        ///<summary>Sets unread for a list of users.  This assumes that the list passed in has already checked for duplicate task unreads.</summary>
        public static bool SetUnreadMany(List <long> listUserNums, Task task)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                task.IsUnread = Meth.GetBool(MethodBase.GetCurrentMethod(), listUserNums, task);
                return(task.IsUnread);
            }
            List <TaskUnread> listUnreadsToInsert = new List <TaskUnread>();

            foreach (long userNum in listUserNums)
            {
                TaskUnread taskUnread = new TaskUnread();
                taskUnread.TaskNum = task.TaskNum;
                taskUnread.UserNum = userNum;
                listUnreadsToInsert.Add(taskUnread);
            }
            Crud.TaskUnreadCrud.InsertMany(listUnreadsToInsert);
            if (listUserNums.Contains(Security.CurUser.UserNum))             //The IsUnread flag is only used for local refreshes.
            {
                task.IsUnread = true;
            }
            return(task.IsUnread);
        }
Ejemplo n.º 7
0
		///<summary>Sets unread for a single user.  Works well without duplicates, whether it's already set to Unread(new) or not.</summary>
		public static void SetUnread(long userNum,long taskNum) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),userNum,taskNum);
				return;
			}
			if(IsUnread(userNum,taskNum)) {
				return;//Already set to unread, so nothing else to do
			}
			TaskUnread taskUnread=new TaskUnread();
			taskUnread.TaskNum=taskNum;
			taskUnread.UserNum=userNum;
			Insert(taskUnread);
		}