Exemple #1
0
        /// <summary>
        /// 添加短信内容并发送短信
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void ADDDXGL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            try
            {
                SZHL_DXGL dxgl = JsonConvert.DeserializeObject <SZHL_DXGL>(P1);
                bool      isLJ = bool.Parse(P2);//是否定时发送,如果否,则立即发送
                if (dxgl.dxContent.Trim() != "")
                {
                    dxgl.CRUser   = UserInfo.User.UserName;
                    dxgl.CRDate   = DateTime.Now;
                    dxgl.SendTime = dxgl.SendTime == null ? DateTime.Now : dxgl.SendTime;
                    dxgl.ComId    = UserInfo.User.ComId.Value;
                    if (!isLJ)
                    {
                        dxgl.isSend = "Y";
                    }
                    else
                    {
                        dxgl.isSend = "N";
                    }
                    //发送短信
                    if (new SZHL_DXGLB().Insert(dxgl))
                    {
                        if (!isLJ)
                        {
                            string MASresult = CommonHelp.SendMAS(dxgl.dxnums, dxgl.dxContent);
                        }
                    }

                    //消息提醒
                    SZHL_TXSX TX = new SZHL_TXSX();
                    TX.Date      = dxgl.SendTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
                    TX.APIName   = "DXGL";
                    TX.ComId     = UserInfo.User.ComId;
                    TX.FunName   = "DXGL_CHECK";
                    TX.MsgID     = dxgl.ID.ToString();
                    TX.TXContent = dxgl.dxContent;
                    TX.TXUser    = dxgl.dxnums;
                    TX.TXMode    = "DXGL";
                    TX.CRUser    = UserInfo.User.UserName;
                    TXSX.TXSXAPI.AddALERT(TX); //时间为发送时间
                }
                else
                {
                    msg.ErrorMsg = "请输入短信内容";
                }
            }
            catch (Exception ex)
            {
                msg.ErrorMsg = ex.Message;
            }
        }
Exemple #2
0
        /// <summary>
        /// 添加短信内容并发送短信
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void ADDDXGL(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            try
            {
                SZHL_DXGL dxgl = JsonConvert.DeserializeObject <SZHL_DXGL>(P1);
                if (dxgl.dxContent.Trim() != "")
                {
                    dxgl.CRUser   = UserInfo.User.UserName;
                    dxgl.CRDate   = DateTime.Now;
                    dxgl.SendTime = dxgl.SendTime == null ? DateTime.Now : dxgl.SendTime;
                    dxgl.ComId    = UserInfo.User.ComId.Value;
                    //发送短信
                    new SZHL_DXGLB().Insert(dxgl);

                    //消息提醒
                    SZHL_TXSX TX = new SZHL_TXSX();
                    TX.Date      = dxgl.SendTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
                    TX.APIName   = "DXGL";
                    TX.ComId     = UserInfo.User.ComId;
                    TX.FunName   = "DXGLCHECK";
                    TX.MsgID     = dxgl.ID.ToString();
                    TX.TXContent = dxgl.dxContent;
                    TX.TXUser    = dxgl.dxnums;
                    TX.TXMode    = "DXGL";
                    TX.CRUser    = UserInfo.User.UserName;
                    TXSXAPI.AddALERT(TX); //时间为发送时间
                }
                else
                {
                    msg.ErrorMsg = "请输入短信内容";
                }
            }
            catch (Exception ex)
            {
                msg.ErrorMsg = ex.Message;
            }
        }