Exemple #1
0
    public void hyjstx()
    {
        HyoaClass.Hyoa_jstx Hyoa_jstx = new HyoaClass.Hyoa_jstx();
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();

        try
        {
            DataTable dt = Hyoa_jstx.Getjstxs_wf();
            if (dt.Rows.Count > 0)
            {
                string ls_content = "";
                string ls_mudelname = "消息提醒";
                string ls_url = "";
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    //得到模块名称
                    DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_from"].ToString());
                    if (dt_mudel.Rows.Count > 0)
                        ls_mudelname = dt_mudel.Rows[0]["hy_mudelname"].ToString();

                    //如果没找到该文档对应的待办事宜,则不发送消息
                    DataTable dt_dbsy = Hyoa_dbsy.Getdbsybydocid(dt.Rows[i]["DOCID"].ToString());
                    if (dt_dbsy.Rows.Count > 0)
                    {
                        ls_url = dt_dbsy.Rows[0]["hy_url"].ToString();
                        ls_content = "[" + ls_mudelname + "]-<a href='" + amtooa_ym + "/jstx_login.aspx?uid=" + dt.Rows[i]["hy_jsrid"].ToString() + "&key=cd04fa144ec48507&redirectto=" + ls_url + "' target=_blank>" + dt.Rows[i]["hy_content"].ToString() + "</a>";
                        int li_value = SendMessage("消息提醒", ls_content, dt.Rows[i]["hy_jsrid"].ToString());
                        if (li_value == 1)
                        {
                            Hyoa_jstx.ID = dt.Rows[i]["ID"].ToString();
                            Hyoa_jstx.hy_state = 1;
                            Hyoa_jstx.Update();
                        }
                        else
                        {
                            Hyoa_jstx.ID = dt.Rows[i]["ID"].ToString();
                            Hyoa_jstx.hy_state = 2;
                            Hyoa_jstx.Update();
                        }
                    }
                }
            }
        }
        catch
        {
        }
        finally
        {
        }
    }