Beispiel #1
0
    //保存评论
    protected void btnSave_Click(object sender, EventArgs e)
    {
        OAJournalComment model2 = this.GetModel();

        this.pcSer4.Add(model2);
        base.RegisterScriptRefresh();
    }
Beispiel #2
0
    private OAJournalComment GetModel()
    {
        OAJournalComment model = new OAJournalComment();

        model.Id         = System.Guid.NewGuid().ToString(); //主键ID
        model.journal_id = this.KeyId.Value;                 //日志ID
        model.user_id    = base.UserCode.ToString();         //
        model.content    = this.comment_content.Text;        //内容
        model.time       = DateTime.Now;                     //创建时间
        return(model);
    }
Beispiel #3
0
    private OAJournalComment GetModel()
    {
        OAJournalComment model = new OAJournalComment();

        model.Id         = System.Guid.NewGuid().ToString(); //主键ID
        model.journal_id = this.KeyId.Value;                 //日志ID
        model.user_id    = base.UserCode.ToString();         //
        if (!string.IsNullOrEmpty(this.Copyto.Text.ToString()))
        {
            model.content = this.comment_content.Text + " @" + this.Copyto.Text.ToString();//内容
        }
        else
        {
            model.content = this.comment_content.Text;//内容
        }

        model.time = DateTime.Now;//创建时间
        return(model);
    }
Beispiel #4
0
    //保存评论
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //保存评论
        OAJournalComment model3 = this.GetModel();

        this.pcSer4.Add(model3);

        //保存评论@的人
        OAJournalAppend model2  = new OAJournalAppend();
        string          strXGRS = hfldCopyto.Value.ToString();//评论@相关人

        if (!string.IsNullOrEmpty(strXGRS))
        {
            string   strUsers = "";
            string[] strXGR   = strXGRS.Split(',');
            foreach (string str in strXGR)
            {
                strUsers += "'" + str + "'" + ",";
                DataTable dt = pcSer2.resulet(str, Id);
                if (dt.Rows.Count > 0)
                {
                }
                else
                {
                    model2.Id         = Guid.NewGuid().ToString(); //主键
                    model2.journal_id = Id;                        //日志ID
                    model2.user_id    = str;                       //审阅人ID
                    model2.user_type  = 1;                         // 3 提交人、0 审阅人、1相关人、2审阅及相关人;
                    this.pcSer2.Add(model2);
                }
            }
            //发送微信消息
            WXAPI.sendWeChatMsg(UserCode.ToString(), "", strXGRS, "logPL", this.Id, title.Text.ToString(), create_date.Text.ToString());
            //string strSQL = "select * from PT_yhmc where v_yhdm in(" + strUsers.Substring(0, strUsers.Length-1) + ")";
            //DataTable dt2 = publicDbOpClass.DataTableQuary(strSQL);
            ////string wxUsers = "";
            //if (dt2.Rows.Count > 0)
            //{
            //    foreach (DataRow dr in dt2.Rows)
            //    {
            //        //    wxUsers += dr["WXID"] + "|";
            //        //}
            //        //string str0 = "";//"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx251384a873c4d422&redirect_uri=";
            //        string str1 = new BasicConfigService().GetValue("domain");
            //        string str2 = "/WeChat/log/show.html?id=" + this.KeyId.Value.ToString() + "&userType=tj&userID="+ dr["v_yhdm"];
            //        //string str3 = "";//"&action=add&response_type=code&scope=snsapi_base#wechat_redirect";
            //        string str4 = System.Web.HttpUtility.UrlEncode(str1 + str2);//System.Web.HttpUtility.UrlDecode("");
            //                                                                    // string strURL = str0 + str4 + str3;
            //                                                                    // //WXAPI.sendText(1000008, "有新的工作日志评论@您\n" + title.Text.ToString() + "\n", strURL, wxUsers.Substring(0, wxUsers.Length - 1));
            //                                                                    //WXAPI.sendText(1000008, "有新的工作日志评论@您\n<h2><b>" + title.Text.ToString() + "</b></h2>[填写人:"+ creater.Text.ToString() + "]\n", strURL, dr["WXID"].ToString());

            //        // string strTitle = "有新的工作日志评论@您";
            //        // string description = "<div class=\\\"highlight\\\">" + title.Text.ToString() + "</div><div class=\\\"gray\\\">[填写人:" + creater.Text.ToString() + "] " + this.create_date.Text.ToString() + "</div>";
            //        // string btntxt = "点击查看";
            //        // WXAPI.sendTextCard(strTitle, 1000008, description, strURL, dr["WXID"].ToString(), btntxt);
            //        string strSQL1 = "select * from PT_yhmc where v_yhdm ='" + dr["v_yhdm"] + "'";
            //        DataTable dt1 = publicDbOpClass.DataTableQuary(strSQL1);
            //        string strURL = str1 + str2;
            //        string strTitle = "有新的工作日志评论@您";
            //        string description = "<div class=\\\"highlight\\\">" + title.Text.ToString() + "</div><div class=\\\"gray\\\">[评论人:" + dt1.Rows[0]["v_xm"].ToString() + "] " + DateTime.Now.ToShortDateString()+ "</div>";
            //        string btntxt = "点击查看";
            //        WXAPI.sendTextCard(strTitle, 1000008, description, strURL, dr["WXID"].ToString(), btntxt);
            //    }
            //}
        }
        base.RegisterScriptRefresh();
    }