Пример #1
0
        ///<summary>IComparable.CompareTo implementation.  This is used to order sigmessages.
        ///This is needed because ordering SigMessages is too complex to do with a query.</summary>
        public int CompareTo(object obj)
        {
            if (!(obj is SigMessage))
            {
                throw new ArgumentException("object is not a SigMessage");
            }
            SigMessage sig = (SigMessage)obj;
            DateTime   date1;
            DateTime   date2;

            if (AckDateTime.Year < 1880)             //if not acknowledged
            {
                date1 = MessageDateTime;
            }
            else
            {
                date1 = AckDateTime;
            }
            if (sig.AckDateTime.Year < 1880)             //if not acknowledged
            {
                date2 = sig.MessageDateTime;
            }
            else
            {
                date2 = sig.AckDateTime;
            }
            return(date1.CompareTo(date2));
        }
Пример #2
0
 ///<summary></summary>
 public static long Insert(SigMessage sigMessage)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         sigMessage.SigMessageNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sigMessage);
         return(sigMessage.SigMessageNum);
     }
     return(Crud.SigMessageCrud.Insert(sigMessage));
 }
Пример #3
0
 ///<summary></summary>
 public static void Update(SigMessage sigMessage)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), sigMessage);
         return;
     }
     Crud.SigMessageCrud.Update(sigMessage);
 }
Пример #4
0
        ///<summary>Gets all sigelementdefs for the sigmessage passed in.  Includes user, extra, and message element defs.</summary>
        public static List <SigElementDef> GetDefsForSigMessage(SigMessage sigMessage)
        {
            //No need to check RemotingRole; no call to db.
            List <SigElementDef> listSigElementDefs = new List <SigElementDef>();

            listSigElementDefs.AddRange(SigElementDefs.GetWhere(x => x.SigElementDefNum == sigMessage.SigElementDefNumUser));
            listSigElementDefs.AddRange(SigElementDefs.GetWhere(x => x.SigElementDefNum == sigMessage.SigElementDefNumExtra));
            listSigElementDefs.AddRange(SigElementDefs.GetWhere(x => x.SigElementDefNum == sigMessage.SigElementDefNumMsg));
            return(listSigElementDefs);
        }
Пример #5
0
 ///<summary>Acknowledge one sig message from the manage module grid.</summary>
 public static void AckSigMessage(SigMessage sigMessage)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), sigMessage);
         return;
     }
     //To ack a message, simply update the AckDateTime on the original row.
     sigMessage.AckDateTime = MiscData.GetNowDateTime();
     Update(sigMessage);
 }