Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sql.ReadConnectionString();
- if (sql.Open()) {
- 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] = ?"));
- sql.AddParameter(m_nRowID);
- if (sql.Fetch()) {
- for (int i = 0; i < sql.GetCount(); i++) {
- CAMMessage::CAMInboundRule::CAMInboundRule_Action camAction;
- camAction.m_nRowID = atoi(sql.GetItem(_T("ID"),i));
- camAction.m_neammaraType = (enumAMMARuleActionType)atoi(sql.GetItem(_T("action_type"),i));
- camAction.m_strMsgType = sql.GetItem(_T("action_type"),i);
- camAction.m_strdl_Server = sql.GetItem(_T("dl_Server"),i);
- camAction.m_strdl_User = sql.GetItem(_T("dl_User"),i);
- camAction.m_strdl_Password = sql.GetItem(_T("dl_Password"),i);
- camAction.m_strdl_Database = sql.GetItem(_T("dl_Database"),i);
- camAction.m_strdl_Query = sql.GetItem(_T("dl_Query"),i);
- camAction.m_bdl_IsSP = sql.GetIsTrue(_T("dl_IsSP"),i);
- 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",
- sql.GetItem(_T("action_type"),i), sql.GetItem(_T("dl_Server"),i), sql.GetItem(_T("dl_User"),i),
- 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));
- trace.Trace(l);
- vActions.push_back(camAction);
- }
- }
- sql.Close();
- // the action_type come back as null
- //and defults the switch statement
- for (vector<CAMMessage::CAMInboundRule::CAMInboundRule_Action>::iterator vI = vActions.begin();
- vI != vActions.end();
- vI++) {
- CString logs;
- trace.Trace(_T("-- Just performing the action now Message Automation--"));
- switch(vI->m_neammaraType) {
- case AMMARATSendEmail:
- vI->Action_SendEmail(*vI,camMessage);
- trace.Trace(_T("-- Action is send email Message Automation--"));
- break;
- case AMMARATSendSMS:
- vI->Action_SendSMS(*vI,camMessage);
- trace.Trace(_T("-- Action is send SMS Message Automation--"));
- break;
- case AMMARATForward:
- vI->Action_Forward(*vI,camMessage);
- trace.Trace(_T("-- Action is forrward something Message Automation--"));
- break;
- default:
- trace.Trace(_T("-- switch Default HIt Message Automation--"));
- break;
- }
- trace.Trace(_T("-- Done performing the action Message Automation--"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement