コード例 #1
0
        private long AddSMSLog(DateTime Date, string PhoneNo, string SendOrReceive, string Message, string TRANID)
        {
            long smslogID = 0;

            SuSmsLogService = (ISuSmsLogService)ContextRegistry.GetContext().GetObject("SuSmsLogService");
            try
            {
                long userID = UserAccount == null ? 0 : UserAccount.UserID;


                SuSmsLog smsLog = new SuSmsLog();
                smsLog.Active        = true;
                smsLog.CreBy         = userID;
                smsLog.CreDate       = Date;
                smsLog.Date          = Date;
                smsLog.Message       = Message;
                smsLog.TRANID        = TRANID;
                smsLog.PhoneNo       = PhoneNo;
                smsLog.SendOrReceive = SendOrReceive.ToString();
                smsLog.SendMsgDate   = Date;
                smsLog.SendMsgDetail = string.Empty;
                smsLog.SendMsgStatus = string.Empty;
                smsLog.SendMsgSMID   = string.Empty;
                smsLog.UpdBy         = userID;
                smsLog.UpdDate       = Date;
                smsLog.UpdPgm        = "Receive SMS Program";
                smslogID             = SuSmsLogService.Save(smsLog);
            }
            catch (Exception ex)
            {
                Utilities.WriteLogs(ex.Message, "smslog", "Logs", "txt");
                // error = ex.Message;
            }
            return(smslogID);
        }
コード例 #2
0
 public bool UpdateDLVRREP(SuSmsLog smsLog)
 {
     try
     {
         SuSmsLogService.Update(smsLog);
         return(true);
     }
     catch (Exception exgs)
     {
         SS.Standard.Utilities.Utilities.WriteLogs("AddLog SMS : " + exgs.Message, "smslog", "Logs", "txt");
         return(false);
     }
 }
コード例 #3
0
        private void AddNotifySMSLog(DateTime Date, string PhoneNo, string SendOrReceive, string Message, string SMSGateWayResult)
        {
            string SendMsgStatus = string.Empty;
            string SendMsgDetail = string.Empty;
            string SendMsgSMID   = string.Empty;

            try
            {
                XmlDocument xDoc = new XmlDocument();
                xDoc.LoadXml(SMSGateWayResult);
                XmlNodeList status = xDoc.GetElementsByTagName("STATUS");
                XmlNodeList detail = xDoc.GetElementsByTagName("DETAIL");
                XmlNodeList SMID   = xDoc.GetElementsByTagName("SMID");

                SendMsgStatus = status.Item(0).InnerXml;
                SendMsgDetail = detail.Item(0).InnerXml;
                SendMsgSMID   = SMID.Item(0).InnerXml;
            }
            catch (Exception exg)
            {
                SS.Standard.Utilities.Utilities.WriteLogs("LoadXml SMS : " + exg.Message, "smslog", "Logs", "txt");
            }
            try
            {
                long     userID     = UserAccount == null ? 0 : UserAccount.UserID;
                SuSmsLog smsLog     = new SuSmsLog();
                string   tmpPhoneNo = PhoneNo.TrimStart(new char[] { '6', '6' });

                smsLog.Active        = true;
                smsLog.CreBy         = userID;
                smsLog.CreDate       = Date;
                smsLog.Date          = Date;
                smsLog.Message       = Message;
                smsLog.PhoneNo       = tmpPhoneNo.PadLeft(10, '0');
                smsLog.SendOrReceive = SendOrReceive.ToString();
                smsLog.SendMsgDate   = Date;
                smsLog.SendMsgDetail = SendMsgDetail;
                smsLog.SendMsgStatus = SendMsgStatus;
                smsLog.SendMsgSMID   = SendMsgSMID;
                smsLog.UpdBy         = userID;
                smsLog.UpdDate       = Date;
                smsLog.UpdPgm        = UserAccount == null ? "SMS Services Class" : UserAccount.CurrentProgramCode;
                SuSmsLogService.Save(smsLog);
            }
            catch (Exception exgs)
            {
                SS.Standard.Utilities.Utilities.WriteLogs("AddLog SMS : " + exgs.Message, "smslog", "Logs", "txt");
            }
        }
コード例 #4
0
        private void UpdateSMSLog(DateTime Date, string SMSGateWayResult, long smsLogID)
        {
            string SendMsgStatus = string.Empty;
            string SendMsgDetail = string.Empty;
            string SendMsgSMID   = string.Empty;

            try
            {
                XmlDocument xDoc = new XmlDocument();
                xDoc.LoadXml(SMSGateWayResult);
                XmlNodeList status = xDoc.GetElementsByTagName("STATUS");
                XmlNodeList detail = xDoc.GetElementsByTagName("DETAIL");
                XmlNodeList SMID   = xDoc.GetElementsByTagName("SMID");

                SendMsgStatus = status.Item(0).InnerXml;
                SendMsgDetail = detail.Item(0).InnerXml;
                SendMsgSMID   = SMID.Item(0).InnerXml;
            }
            catch (Exception exg)
            {
                SS.Standard.Utilities.Utilities.WriteLogs("LoadXml SMS : " + exg.Message, "smslog", "Logs", "txt");
            }
            try
            {
                long     userID = UserAccount == null ? 0 : UserAccount.UserID;
                SuSmsLog smsLog = SuSmsLogQuery.FindByID(smsLogID);
                if (smsLog != null)
                {
                    smsLog.Date          = Date;
                    smsLog.SendMsgDate   = Date;
                    smsLog.SendMsgDetail = SendMsgDetail;
                    smsLog.SendMsgStatus = SendMsgStatus;
                    smsLog.SendMsgSMID   = SendMsgSMID;
                    smsLog.UpdBy         = userID;
                    smsLog.UpdDate       = Date;
                    smsLog.UpdPgm        = UserAccount == null ? "SMS Services Class" : UserAccount.CurrentProgramCode;
                    SuSmsLogService.Save(smsLog);
                }
            }
            catch (Exception exgs)
            {
                SS.Standard.Utilities.Utilities.WriteLogs("AddLog SMS : " + exgs.Message, "smslog", "Logs", "txt");
            }
        }