Advertisement
Guest User

Untitled

a guest
Jun 15th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. sql.ReadConnectionString();
  2. if (sql.Open()) {
  3. sql.SetQuery(_T("SELECT [ID],[description],[action_type],[dl_Server],[dl_User],[dl_Password],[dl_Database],[dl_Query],[dl_IsSP] FROM [MsgAutomation_Actions] WHERE [rule_id] = ?"));
  4. sql.AddParameter(m_nRowID);
  5. if (sql.Fetch()) {
  6. for (int i = 0; i < sql.GetCount(); i++) {
  7. CAMMessage::CAMInboundRule::CAMInboundRule_Action camAction;
  8. camAction.m_nRowID = atoi(sql.GetItem(_T("ID"),i));
  9. camAction.m_neammaraType = (enumAMMARuleActionType)atoi(sql.GetItem(_T("action_type"),i));
  10. camAction.m_strMsgType = sql.GetItem(_T("action_type"),i);
  11. camAction.m_strdl_Server = sql.GetItem(_T("dl_Server"),i);
  12. camAction.m_strdl_User = sql.GetItem(_T("dl_User"),i);
  13. camAction.m_strdl_Password = sql.GetItem(_T("dl_Password"),i);
  14. camAction.m_strdl_Database = sql.GetItem(_T("dl_Database"),i);
  15. camAction.m_strdl_Query = sql.GetItem(_T("dl_Query"),i);
  16. camAction.m_bdl_IsSP = sql.GetIsTrue(_T("dl_IsSP"),i);
  17. l.Format("[action_type]: %s, [dl_Server]: %s, [dl_User]: %s, [dl_Password]: %s, [dl_Database]: %s, [dl_Query]: %s, [rule_id]: %d, Description: %s",
  18. sql.GetItem(_T("action_type"),i), sql.GetItem(_T("dl_Server"),i), sql.GetItem(_T("dl_User"),i),
  19. sql.GetItem(_T("dl_Password"),i), sql.GetItem(_T("dl_Database"),i), sql.GetItem(_T("dl_Query"),i), m_nRowID, sql.GetItem(_T("description"),i));
  20. trace.Trace(l);
  21. vActions.push_back(camAction);
  22. }
  23. }
  24. sql.Close();
  25.  
  26. // the action_type come back as null
  27.  
  28. //and defults the switch statement
  29.  
  30. for (vector<CAMMessage::CAMInboundRule::CAMInboundRule_Action>::iterator vI = vActions.begin();
  31. vI != vActions.end();
  32. vI++) {
  33. CString logs;
  34. trace.Trace(_T("-- Just performing the action now Message Automation--"));
  35.  
  36. switch(vI->m_neammaraType) {
  37. case AMMARATSendEmail:
  38. vI->Action_SendEmail(*vI,camMessage);
  39. trace.Trace(_T("-- Action is send email Message Automation--"));
  40. break;
  41. case AMMARATSendSMS:
  42. vI->Action_SendSMS(*vI,camMessage);
  43. trace.Trace(_T("-- Action is send SMS Message Automation--"));
  44. break;
  45. case AMMARATForward:
  46. vI->Action_Forward(*vI,camMessage);
  47. trace.Trace(_T("-- Action is forrward something Message Automation--"));
  48. break;
  49. default:
  50. trace.Trace(_T("-- switch Default HIt Message Automation--"));
  51. break;
  52. }
  53. trace.Trace(_T("-- Done performing the action Message Automation--"));
  54. }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement