Example #1
0
        /// <summary>
        /// (old)发送短信接口
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public static dt_SMSInsert_res OldSMSInsert(dt_SMSInsert_req req)
        {
            try
            {
                string   reqStr    = js.Serialize(req);
                DateTime timeStart = DateTime.Now;
                logger.Info("si_SMSInsert_real_obService请求信息new:" + reqStr + "\r\n");

                si_SMSInsert_real_obService web = new si_SMSInsert_real_obService();

                dt_SMSInsert_res res = web.si_SMSInsert_real_ob(req);

                string   resStr  = js.Serialize(res);
                DateTime timeEnd = DateTime.Now;
                logger.Info("响应信息" + resStr + "\r\n");


                datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, "si_SMSInsert_real_obService", "发送短信接口");
                return(res);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public static dt_SMSInsert_res SMSInsert(dt_SMSInsert_req req,
                                                 bool isdebug = false)
        {
            string        reqStr    = js.Serialize(req);
            string        resStr    = string.Empty;
            DateTime?     timeStart = null;
            DateTime?     timeEnd   = null;
            string        isok      = "OK";
            SystemService _set      = new SystemService();

            try
            {
                timeStart = DateTime.Now;
                _set.AddLog(new SPACRM.Entity.WXLOG()
                {
                    CON  = "发送短信si_SMSInsert_real_obService请求信息" + timeStart + ":" + reqStr,
                    TIME = DateTime.Now
                });
                si_SMSInsert_real_obService web = new si_SMSInsert_real_obService();

                dt_SMSInsert_res res = web.si_SMSInsert_real_ob(req);

                resStr  = js.Serialize(res);
                timeEnd = DateTime.Now;
                _set.AddLog(new SPACRM.Entity.WXLOG()
                {
                    CON  = "发送短信响应信息" + timeStart + ":" + resStr + "\r\n",
                    TIME = DateTime.Now
                });
                if (res == null)
                {
                    isok = "NO";
                }

                return(res);
            }
            catch (Exception ex)
            {
                resStr = ex.Message;
                isok   = "NO";
                _set.AddLog(new SPACRM.Entity.WXLOG()
                {
                    CON  = "发送短信响应信息" + timeStart + ":" + resStr + "\r\n",
                    TIME = DateTime.Now
                });
                throw ex;
            }
            finally
            {
                if (!isdebug)
                {
                    //datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, SystemCode.SMSInsert.ToString(), isok);
                }
            }
        }
Example #3
0
        /// <summary>
        /// 会员状态调整
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public static dt_SMSInsert_res SMSInsert(dt_SMSInsert_req req,
                                                 bool isdebug = false)
        {
            string   reqStr    = js.Serialize(req);
            string   resStr    = string.Empty;
            DateTime?timeStart = null;
            DateTime?timeEnd   = null;
            string   isok      = "OK";

            try
            {
                timeStart = DateTime.Now;
                logger.Info("发送短信si_SMSInsert_real_obService请求信息:" + reqStr);
                si_SMSInsert_real_obService web = new si_SMSInsert_real_obService();

                dt_SMSInsert_res res = web.si_SMSInsert_real_ob(req);

                resStr  = js.Serialize(res);
                timeEnd = DateTime.Now;
                logger.Info("响应信息" + resStr + "\r\n");

                if (res == null)
                {
                    isok = "NO";
                }

                return(res);
            }
            catch (Exception ex)
            {
                resStr = ex.Message;
                isok   = "NO";
                return(null);
            }
            finally
            {
                if (!isdebug)
                {
                    datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, SystemCode.SMSInsert.ToString(), isok);
                }
            }
        }