Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void GdsPopulateNotificationQueue()
- {
- Gds.GdsMessage Msg = new Gds.GdsMessage();
- Gds.GdsPatInfo PatInfo = null;
- Preferences Pref = null;
- DataTable DtIds;
- DataTable DtMessages;
- long IntLinkId = 0;
- string MessageToSend;
- int MessageId = 0;
- DateTime DateTosendNotification = DateTime.MinValue;
- DtIds = Msg.GetListOfDiasendLinkIds();
- if (DtIds!=null && DtIds.Rows.Count > 0)
- {
- foreach (DataRow RowId in DtIds.Rows)
- {
- if (!string.IsNullOrEmpty(RowId["LINK_ID"].ToString()))
- {
- IntLinkId = Convert.ToInt64(RowId["LINK_ID"].ToString());
- }
- if (IntLinkId > 0)
- {
- DtMessages = Msg.GetMessageToSend(IntLinkId);
- if (DtMessages != null && DtMessages.Rows.Count > 0)
- {
- foreach (DataRow MsgRow in DtMessages.Rows)
- {
- MessageToSend = MsgRow["MessageToReturn"].ToString();
- if (!string.IsNullOrEmpty(MsgRow["MessageId"].ToString()))
- {
- MessageId = Convert.ToInt32(MsgRow["MessageId"].ToString());
- }
- if (!string.IsNullOrEmpty(MsgRow["DateToSendNotification"].ToString()))
- {
- DateTosendNotification = Convert.ToDateTime(MsgRow["DateToSendNotification"].ToString());
- }
- Pref = new Preferences(IntLinkId);
- Pref.Get();
- PatInfo = new Gds.GdsPatInfo(IntLinkId);
- if (Pref != null && PatInfo != null)
- {
- foreach (Preferences.NotificationTypes NotType in Pref.NotificationPreferenceList)
- {
- //check at least for message and message date to send
- if (!string.IsNullOrEmpty(MessageToSend) && !string.IsNullOrEmpty(DateTosendNotification.ToString()) && DateTosendNotification > DateTime.MinValue)
- GdsInsertNotificationQueue(MessageId, MessageToSend, IntLinkId, true, "", DateTosendNotification, NotType.NotificationTypeId, PatInfo.Email, PatInfo.MobileNumber);
- }
- }
- }//end for each message
- }//end check for message data table
- } //end if we have a row in the messages data table
- } //end outer for each
- } //end if we have rows in list of link ids data table
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement