Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtContent.Text.Trim() == "")
            {
                MessageBox.Show("没有内容可发送");
                return;
            }
            if (txtPhoneNumber.Text.Trim() == "")
            {
                MessageBox.Show("请输入电话号码");
                return;
            }
            if (txtPhoneNumber.Text.Trim().Length != 11)
            {
                MessageBox.Show("电话号码长度有误");
                return;
            }
            //try
            //{
            //    int dh = Convert.ToInt32(textBox7.Text.Trim());
            //}
            //catch
            //{
            //    MessageBox.Show("电话号码有误");
            //    return;
            //}
            if (F_blh == "")
            {
                MessageBox.Show("无法发送");
                return;
            }

            if (bgys != ysmc && shys != ysmc)
            {
                MessageBox.Show("非报告医生或审核医生,无法发送");
                return;
            }
            SMSService fswjz = new SMSService();
            string     url   = f.ReadString("wjz", "url", "");

            if (url != "")
            {
                fswjz.Url = url;
            }
            string msgid = Guid.NewGuid().ToString();
            string ss    = fswjz.SendSMS(msgid, txtPhoneNumber.Text, txtContent.Text.Trim(), "B55E51E062EC377E42C7FF0BC0149B57C4BC3E4224F5631148A3852C64DA398E");

            if (ss.ToLower() == "ok")
            {
                aa.ExecuteSQL("update T_jcxx set F_yl6='" + DateTime.Now.ToString("yyyyMMddHHmmss") + " '+'" + txtPhoneNumber.Text + " " + txtContent.Text.Trim() + " " + msgid + "' where F_blh='" + F_blh + "'");

                //记录到数据库
                InsertCrisisRecord(msgid);
                //推送到平台
                CrisisReportService crs = new CrisisReportService();
                crs.Url = f.ReadString("hszxyy", "wjzurl", "http://172.16.80.174:8081/CrisisReportService.asmx");
                crs.ReportCrisis(F_blh, txtContent.Text);

                writebg(txtContent.Text.Trim(), F_blh, "发送危急值", "危急值");
                MessageBox.Show("危机值消息发送完成");
                btnSend.Enabled = false;
            }
            else
            {
                MessageBox.Show(ss);
            }
        }
Exemple #2
0
        public void ReportCrisisTest()
        {
            CrisisReportService service = new CrisisReportService();

            service.ReportCrisis("1708226600", "测试危急值");
        }