예제 #1
0
 ///<summary></summary>
 public static long Insert(JobNotification jobNotification)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         jobNotification.JobNotificationNum = Meth.GetLong(MethodBase.GetCurrentMethod(), jobNotification);
         return(jobNotification.JobNotificationNum);
     }
     return(Crud.JobNotificationCrud.Insert(jobNotification));
 }
예제 #2
0
 ///<summary></summary>
 public static void Update(JobNotification jobNotification)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), jobNotification);
         return;
     }
     Crud.JobNotificationCrud.Update(jobNotification);
 }
예제 #3
0
        public override bool Equals(object obj)
        {
            JobNotification notif = obj as JobNotification;

            if (notif == null)
            {
                return(false);
            }
            return(this.JobNotificationNum == notif.JobNotificationNum &&
                   this.JobNum == notif.JobNum &&
                   this.UserNum == notif.UserNum &&
                   this.Changes == notif.Changes);
        }
예제 #4
0
        public static long UpsertNotification(long jobNum, long userNum, JobNotificationChanges changes)
        {
            //No need for remoting call here.
            JobNotification notification = GetForJobAndUser(jobNum, userNum);

            if (notification == null)
            {
                notification         = new JobNotification();
                notification.JobNum  = jobNum;
                notification.UserNum = userNum;
                notification.Changes = changes;
                return(Insert(notification));
            }
            else
            {
                notification.Changes = notification.Changes | changes;
                Update(notification);
                return(notification.JobNotificationNum);
            }
        }