Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string type = HttpUtil.GetReqStrValue("type");
        //string isSaveFile = HttpUtil.GetReqStrValue("isSaveFile");
        WEC_XX_MESSAGE conf = new WEC_XX_MESSAGE();

        conf.OPENID = HttpUtil.GetReqStrValue("openid");
        conf.OrderBy("ADDTIME DESC");
        WEC_XX_MESSAGE xx_message = BLLTable <WEC_XX_MESSAGE> .GetRowData(new WEC_XX_MESSAGE(), conf);


        if ("0".Equals(type))//Îı¾»Ø¸´
        {
            string          message     = HttpUtil.GetReqStrValue("message");
            WEC_HF_RESPONSE hf_response = new WEC_HF_RESPONSE();
            hf_response.R_CONTENT  = message;
            hf_response.OPENID     = HttpUtil.GetReqStrValue("openid");
            hf_response.ADDTIME    = DateTime.Now;
            hf_response.REQUEST_ID = xx_message.ID;
            hf_response.TYPE       = 0;
            BLLTable <WEC_HF_RESPONSE> .Insert(hf_response, WEC_HF_RESPONSE.Attribute.ID);

            string responseText = "<div class='res right'>" + hf_response.ADDTIME + "<br/>" + hf_response.R_CONTENT + "</div><br/>";
            //  Response.Write("{\"res\":\""+responseText+"\"}");
            responseText = responseText.Replace("\n", "<br/>");
            Response.Write("{\"res\":\"" + responseText + "\"}");

            WeiXinUtil.Factory(this).actificialResponseText(hf_response.OPENID, hf_response.R_CONTENT);
        }
        else if ("1".Equals(type))//ͼƬ»Ø¸´
        {
            HttpFileCollection postedFile = Request.Files;
            string             path       = Request.PhysicalApplicationPath + "UploadFiles\\Res_Pic\\" + userBase2.Curraid;
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            string filename = DateTime.Now.ToString("yyyyMMddHHmmss") + ".jpg";
            postedFile[0].SaveAs(path + "\\" + filename);

            // WEC_HF_RESPONSE hf_response = new WEC_HF_RESPONSE();
            WEC_HF_RESPONSE hf_response = new WEC_HF_RESPONSE();
            hf_response.R_CONTENT  = "UploadFiles/Res_Pic/" + userBase2.Curraid + "/" + filename;
            hf_response.OPENID     = HttpUtil.GetReqStrValue("openid");
            hf_response.ADDTIME    = DateTime.Now;
            hf_response.REQUEST_ID = xx_message.ID;
            hf_response.TYPE       = 1;
            BLLTable <WEC_HF_RESPONSE> .Insert(hf_response, WEC_HF_RESPONSE.Attribute.ID);

            string responseText = "<div class='res right'>" + hf_response.ADDTIME + "<br/>" + "<img class=\"img\" src='" + WebHelper.GetAppPath() + hf_response.R_CONTENT + "'/>" + "</div><br/>";
            //  Response.Write("{\"res\":\""+responseText+"\"}");
            Response.Write(responseText);
            WeiXinUtil.Factory(this).actificialResponseImg(hf_response.OPENID, path + "\\" + filename);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(WEC_XX_MESSAGE.Attribute.EXP1);
        //hideTableColumnList.Add(WEC_XX_MESSAGE.Attribute.EXP2);
        //hideTableColumnList.Add(WEC_XX_MESSAGE.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(WEC_XX_MESSAGE.Attribute.EXP1);
        //hideFindColumnList.Add(WEC_XX_MESSAGE.Attribute.EXP2);
        //hideFindColumnList.Add(WEC_XX_MESSAGE.Attribute.EXP3);
        #endregion
        condObj.OrderBy(WEC_XX_MESSAGE.Attribute.ID, Order.Desc);

        if (!IsPostBack)
        {
            btnFind.Text              = LanguageService.GetLanguageString("btnFind", "查询");
            aspPager.PageSize         = 10;
            aspPager.CurrentPageIndex = 1;

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                WEC_XX_MESSAGE roleOld = new WEC_XX_MESSAGE();
                roleOld.Where(WEC_XX_MESSAGE.Attribute.ID, Request["ids"].ToString());
                listObj = BLLTable <WEC_XX_MESSAGE> .Select(valObj, roleOld);

                for (int i = 0; i < listObj.Count; i++)
                {
                    if (i > 0)
                    {
                        hidOld.Value     += ",";
                        hidInitIDS.Value += ",";
                    }
                    hidOld.Value     += "{ID:'" + listObj[i].ID + "',Name:'" + listObj[i].ID + "'}";//这里的Name用于显示在列表中,请自行重定义。
                    hidInitIDS.Value += listObj[i].ID;
                }
            }
            try
            {
                listObj = BLLTable <WEC_XX_MESSAGE> .SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount);

                repList.DataSource = listObj;
                repList.DataBind();
                aspPager.RecordCount = recount;
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string type=HttpUtil.GetReqStrValue("type");
        //string isSaveFile = HttpUtil.GetReqStrValue("isSaveFile");
        WEC_XX_MESSAGE conf = new WEC_XX_MESSAGE();
        conf.OPENID = HttpUtil.GetReqStrValue("openid");
        conf.OrderBy("ADDTIME DESC");
        WEC_XX_MESSAGE xx_message = BLLTable<WEC_XX_MESSAGE>.GetRowData(new WEC_XX_MESSAGE(), conf);

        if("0".Equals(type)){//�ı��ظ�
            string message = HttpUtil.GetReqStrValue("message");
            WEC_HF_RESPONSE hf_response = new WEC_HF_RESPONSE();
            hf_response.R_CONTENT = message;
            hf_response.OPENID = HttpUtil.GetReqStrValue("openid");
            hf_response.ADDTIME = DateTime.Now;
            hf_response.REQUEST_ID = xx_message.ID;
            hf_response.TYPE = 0;
            BLLTable<WEC_HF_RESPONSE>.Insert(hf_response, WEC_HF_RESPONSE.Attribute.ID);
            string responseText = "<div class='res right'>" + hf_response.ADDTIME + "<br/>" + hf_response.R_CONTENT + "</div><br/>";
          //  Response.Write("{\"res\":\""+responseText+"\"}");
           responseText= responseText.Replace("\n","<br/>");
           Response.Write("{\"res\":\"" + responseText + "\"}");

            WeiXinUtil.Factory(this).actificialResponseText(hf_response.OPENID, hf_response.R_CONTENT);
        }
        else if ("1".Equals(type))//ͼƬ�ظ�
        {

            HttpFileCollection postedFile = Request.Files;
            string path = Request.PhysicalApplicationPath + "UploadFiles\\Res_Pic\\" + userBase2.Curraid;
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            string filename = DateTime.Now.ToString("yyyyMMddHHmmss") + ".jpg";
            postedFile[0].SaveAs(path + "\\" + filename);

           // WEC_HF_RESPONSE hf_response = new WEC_HF_RESPONSE();
            WEC_HF_RESPONSE hf_response = new WEC_HF_RESPONSE();
            hf_response.R_CONTENT = "UploadFiles/Res_Pic/" + userBase2.Curraid + "/" + filename;
            hf_response.OPENID = HttpUtil.GetReqStrValue("openid");
            hf_response.ADDTIME = DateTime.Now;
            hf_response.REQUEST_ID = xx_message.ID;
            hf_response.TYPE = 1;
            BLLTable<WEC_HF_RESPONSE>.Insert(hf_response, WEC_HF_RESPONSE.Attribute.ID);
            string responseText = "<div class='res right'>" + hf_response.ADDTIME + "<br/>" + "<img class=\"img\" src='" +WebHelper.GetAppPath()+hf_response.R_CONTENT+ "'/>" + "</div><br/>";
            //  Response.Write("{\"res\":\""+responseText+"\"}");
            Response.Write(responseText);
            WeiXinUtil.Factory(this).actificialResponseImg(hf_response.OPENID, path + "\\" + filename);

        }
    }