Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                wid    = MyCommFun.RequestInt("wid");
                id     = MyCommFun.RequestInt("id");
                openid = MyCommFun.RequestOpenid();
                if (wid == 0 || id == 0)
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }
                BLL.wx_yy_base   yyBll = new BLL.wx_yy_base();
                Model.wx_yy_base yuyue = yyBll.GetModel(id);

                if (yuyue.needPIC)
                {
                    StringBuilder sb = new StringBuilder("");
                    sb.Append(" <li class=\"nob\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"kuang\">\r\n<tr>");
                    sb.Append("  <th>图片 </th> <td> <input id=\"picUpload\" name=\"picUpload\" type=\"file\" accept=\"image/jpeg, image/jpg, image/png\"  onchange=\"my.changeImg(this, event, {base_url:'http://img.uweixin.cn/'});\"/><br />");
                    sb.Append(" <img src='\\images\\noneimg.jpg' id=\"img_show\" style=\"max-width:100px; max-height:80px;\"> </td> </tr> </tbody> </table> </li>");
                    litPic.Text = sb.ToString();
                }

                #region 预约的基本信息
                StringBuilder sbBase = new StringBuilder("");
                if (yuyue.picUrl != null && yuyue.picUrl.Trim() != "")
                {
                    sbBase.Append(" <div class=\"qiandaobanner\"><img src=\"" + yuyue.picUrl + "\"></div>\r\n");
                }

                if (yuyue.content != null && yuyue.content.Trim().Length > 0)
                {
                    sbBase.Append(" <ul class=\"round\"><li><h2>说明</h2><div class=\"text\">" + yuyue.content + "</div></li></ul>\r\n");
                }
                if (yuyue.phone != null && yuyue.phone.Trim() != "" && yuyue.addr != null && yuyue.addr.Trim() != "")
                {
                    //预约电话或者地址
                    sbBase.Append(" <ul class=\"round\">");

                    if (yuyue.addr != null && yuyue.addr.Trim() != "")
                    {
                        sbBase.Append("<li class=\"addr\"><span>" + yuyue.addr.Trim() + "</span></li>\r\n");
                    }
                    if (yuyue.phone != null && yuyue.phone.Trim() != "")
                    {
                        sbBase.Append("<li class=\"tel\"><a href=\"tel:" + yuyue.phone.Trim() + "\"><span>" + yuyue.phone.Trim() + " 电话</span> </a></li>\r\n");
                    }

                    sbBase.Append("</ul>");
                }

                litBaseInfo.Text = sbBase.ToString();
                #endregion

                this.Title = yuyue.title;
                BindControlers(id);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                wid    = MyCommFun.RequestInt("wid");
                id     = MyCommFun.RequestInt("id");
                openid = MyCommFun.RequestOpenid();
                if (wid == 0 || id == 0)
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }
                BLL.wx_yy_base   yyBll = new BLL.wx_yy_base();
                Model.wx_yy_base yuyue = yyBll.GetModel(id);

                #region 预约的基本信息
                StringBuilder sbBase = new StringBuilder("");
                if (yuyue.picUrl != null && yuyue.picUrl.Trim() != "")
                {
                    sbBase.Append(" <div class=\"qiandaobanner\"><img src=\"" + yuyue.picUrl + "\"></div>\r\n");
                }

                if (yuyue.content != null && yuyue.content.Trim().Length > 0)
                {
                    sbBase.Append(" <ul class=\"round\"><li><h2>说明</h2><div class=\"text\">" + yuyue.content + "</div></li></ul>\r\n");
                }
                if (yuyue.phone != null && yuyue.phone.Trim() != "" && yuyue.addr != null && yuyue.addr.Trim() != "")
                {
                    //预约电话或者地址
                    sbBase.Append(" <ul class=\"round\">");

                    if (yuyue.addr != null && yuyue.addr.Trim() != "")
                    {
                        sbBase.Append("<li class=\"addr\"><span>" + yuyue.addr.Trim() + "</span></li>\r\n");
                    }
                    if (yuyue.phone != null && yuyue.phone.Trim() != "")
                    {
                        sbBase.Append("<li class=\"tel\"><a href=\"tel:" + yuyue.phone.Trim() + "\"><span>" + yuyue.phone.Trim() + " 电话</span> </a></li>\r\n");
                    }

                    sbBase.Append("</ul>");
                }

                litBaseInfo.Text = sbBase.ToString();
                #endregion

                this.Title = yuyue.title;
                BindControlers(id);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            //暂只考虑添加留言信息
            context.Response.ContentType = "text/json";
            try
            {
                string           openid   = MyCommFun.QueryString("openid");//openid
                int              formid   = MyCommFun.RequestInt("formid");
                int              wid      = MyCommFun.RequestInt("wid");
                BLL.wx_yy_base   ybBll    = new BLL.wx_yy_base();
                Model.wx_yy_base baseinfo = ybBll.GetModel(formid);


                BLL.wx_yy_control           cBll  = new BLL.wx_yy_control();
                BLL.wx_yy_result            rBll  = new BLL.wx_yy_result();
                Model.wx_yy_result          ret   = new Model.wx_yy_result();
                IList <Model.wx_yy_control> clist = cBll.GetModelList("formId=" + formid);

                // rBll.DeleteByOpenid(openid, formid);
                StringBuilder smsContent = new StringBuilder("活动名称:" + baseinfo.title + ",客户表单内容:");
                for (int i = 0; i < clist.Count; i++)
                {
                    ret            = new Model.wx_yy_result();
                    ret.formId     = formid;
                    ret.openid     = openid;
                    ret.cId        = clist[i].id;
                    ret.userResult = MyCommFun.QueryString("control_" + clist[i].id);
                    ret.cName      = clist[i].cName;
                    ret.createDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
                    rBll.Add(ret);
                    smsContent.Append(ret.cName + ":" + ret.userResult + " ");
                }
                if (baseinfo.needSMS)
                {
                    smsMgr smgr = new smsMgr(wid);
                    smgr.SendSMS(baseinfo.phone, smsContent.ToString(), "在线预约", baseinfo.title, baseinfo.id);
                }
                context.Response.Write("{\"success\":\"true\",\"content\":\"提交成功!\"}");
            }
            catch (Exception ex)
            {
                context.Response.Write("{\"success\":\"false\",\"content\":\"系统出现问题,请重新提交!\"}");
            }
        }
Esempio n. 4
0
        private void ShowInfo(int id)
        {
            hidid.Value = id.ToString();
            Model.wx_yy_base yuyue = yyBll.GetModel(id);
            hidid.Value                = yuyue.id.ToString();
            txttitle.Text              = yuyue.title.ToString();
            txtaddr.Value              = yuyue.addr;
            txtphone.Text              = yuyue.phone;
            txtcontent.InnerText       = yuyue.content;
            rblSMSTXType.SelectedValue = yuyue.needSMS == true?"1":"0";
            rblPICType.SelectedValue   = yuyue.needPIC == true ? "1" : "0";

            //封面图片
            if (yuyue.picUrl != null && yuyue.picUrl.Trim() != "" && yuyue.picUrl.Trim() != "/images/noneimg.jpg")
            {
                txtImgUrl.Text         = yuyue.picUrl;
                imgfacePicPic.ImageUrl = yuyue.picUrl;
            }

            //绑定控件的值
            //绑定奖项信息
            IList <Model.wx_yy_control> itemlist = cBll.GetModelList("formId=" + id + " order by seq asc");

            //系统内置控件
            //1手机号
            IList <Model.wx_yy_control> itemlist_sys_tel = (from c in itemlist where c.isSys == true && c.sysControlerType == "tel" select c).ToArray <Model.wx_yy_control>();

            if (itemlist_sys_tel != null && itemlist_sys_tel.Count > 0)
            {
                chkTelNeed.Checked    = true;
                txtTelNeedName.Text   = itemlist_sys_tel[0].cName;
                txtTelNeedValue.Text  = itemlist_sys_tel[0].defaultValue;
                chkTelNeedBT.Checked  = itemlist_sys_tel[0].isBiTian;
                txtTelNeedSortid.Text = itemlist_sys_tel[0].seq.ToString();
            }

            //2姓名
            IList <Model.wx_yy_control> itemlist_sys_name = (from c in itemlist where c.isSys == true && c.sysControlerType == "name" select c).ToArray <Model.wx_yy_control>();

            if (itemlist_sys_name != null && itemlist_sys_name.Count > 0)
            {
                chkNameNeed.Checked    = true;
                txtNameNeedName.Text   = itemlist_sys_name[0].cName;
                txtNameNeedValue.Text  = itemlist_sys_name[0].defaultValue;
                chkNameNeedBT.Checked  = itemlist_sys_name[0].isBiTian;
                txtNameNeedSortid.Text = itemlist_sys_name[0].seq.ToString();
            }

            //1时间
            IList <Model.wx_yy_control> itemlist_sys_date = (from c in itemlist where c.isSys == true && c.sysControlerType == "date" select c).ToArray <Model.wx_yy_control>();

            if (itemlist_sys_date != null && itemlist_sys_date.Count > 0)
            {
                chkDateNeed.Checked    = true;
                txtDateNeedName.Text   = itemlist_sys_date[0].cName;
                txtDateNeedValue.Text  = itemlist_sys_date[0].defaultValue;
                chkDateNeedBT.Checked  = itemlist_sys_date[0].isBiTian;
                txtDateNeedSortid.Text = itemlist_sys_date[0].seq.ToString();
            }



            //自定义控件
            IList <Model.wx_yy_control> itemlist_zdy = (from c in itemlist where c.isSys != true select c).ToArray <Model.wx_yy_control>();

            if (itemlist_zdy != null && itemlist_zdy.Count > 0)
            {
                int          count = itemlist_zdy.Count;
                DropDownList ddlType;
                TextBox      txtName;
                TextBox      txtValue;
                CheckBox     chkBT;
                TextBox      txtSeq;

                Model.wx_yy_control itemEntity = new Model.wx_yy_control();
                for (int i = 1; i <= count; i++)
                {
                    itemEntity = itemlist_zdy[(i - 1)];

                    ddlType  = this.FindControl("ddl" + i + "Type") as DropDownList;
                    txtName  = this.FindControl("txt" + i + "Name") as TextBox;
                    txtValue = this.FindControl("txt" + i + "Value") as TextBox;
                    txtSeq   = this.FindControl("txt" + i + "Seq") as TextBox;
                    chkBT    = this.FindControl("chk" + i + "Btx") as CheckBox;

                    ddlType.SelectedValue = itemEntity.cType;
                    txtName.Text          = itemEntity.cName;
                    txtValue.Text         = itemEntity.defaultValue;
                    txtSeq.Text           = MyCommFun.Obj2Int(itemEntity.seq).ToString();
                    chkBT.Checked         = itemEntity.isBiTian;
                }
            }



            litwUrl.Text = MyCommFun.getWebSite() + "/weixin/yuyue/index.aspx?wid=" + yuyue.wid + "&id=" + id;
        }
Esempio n. 5
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string strErr = "";
            if (this.txttitle.Text.Trim().Length == 0)
            {
                strErr += "活动名称不能为空! ";
            }

            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }

            #endregion

            #region 赋值
            Model.wx_yy_base yuyue = new Model.wx_yy_base();

            if (id > 0)
            {
                yuyue = yyBll.GetModel(id);
            }

            string facePicc = "";
            if (txtImgUrl.Text.Trim() != "")
            {
                facePicc = txtImgUrl.Text.Trim();
            }
            yuyue.title   = txttitle.Text.Trim();
            yuyue.addr    = txtaddr.Value.Trim();
            yuyue.phone   = txtphone.Text;
            yuyue.content = txtcontent.Value.ToString();
            yuyue.needSMS = rblSMSTXType.SelectedValue == "0"?false:true;
            yuyue.needPIC = rblPICType.SelectedValue == "0" ? false : true;


            yuyue.seq    = 0;
            yuyue.picUrl = facePicc;

            #endregion



            if (id <= 0)
            {  //新增
                yuyue.wid        = weixin.id;
                yuyue.createDate = DateTime.Now;
                //1新增主表
                id = yyBll.Add(yuyue);

                AddControl(id);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加预约信息,主键为" + id); //记录日志
                JscriptMsg("添加预约信息成功!", "index.aspx", "Success");
            }
            else
            {   //修改
                yyBll.Update(yuyue);
                AddControl(id);
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改预约信息,主键为" + id); //记录日志
                JscriptMsg("修改预约信息成功!", "index.aspx", "Success");
            }
        }
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            int id = MyCommFun.Str2Int(hidid.Value);
            #region  //先判断
            string strErr = "";
            if (this.txttitle.Text.Trim().Length == 0)
            {
                strErr += "活动名称不能为空! ";
            }

            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }

            #endregion

            #region 赋值
            Model.wx_yy_base yuyue = new Model.wx_yy_base();

            if (id > 0)
            {
                yuyue = yyBll.GetModel(id);
            }

            string facePicc = "";
            if (txtImgUrl.Text.Trim() != "")
            {
                facePicc = txtImgUrl.Text.Trim();
            }
            yuyue.title = txttitle.Text.Trim();
            yuyue.addr = txtaddr.Value.Trim();
            yuyue.phone = txtphone.Text;
            yuyue.content = txtcontent.Value.ToString();
            yuyue.needSMS = rblSMSTXType.SelectedValue=="0"?false:true;
           
          
            yuyue.seq = 0;
            yuyue.picUrl = facePicc;

            #endregion

            

            if (id <= 0)
            {  //新增
                yuyue.wid = weixin.id;
                yuyue.createDate = DateTime.Now;
                //1新增主表
                id = yyBll.Add(yuyue);

                AddControl(id);
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加预约信息,主键为" + id); //记录日志
                JscriptMsg("添加预约信息成功!", "index.aspx", "Success");
            }
            else
            {   //修改
                yyBll.Update(yuyue);
                AddControl(id);
                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改预约信息,主键为" + id); //记录日志
                JscriptMsg("修改预约信息成功!", "index.aspx", "Success");
            }

        }