コード例 #1
0
ファイル: ModelFunction.cs プロジェクト: yidane/51wine
        /// <summary>
        /// 喜帖
        /// </summary>
        /// <param name="id"></param>
        /// <param name="apiid"></param>
        /// <param name="openid"></param>
        /// <returns></returns>
        private IList <Model.ResponseContentEntity> xitieReponse(int id, int apiid, string openid)
        {
            IList <Model.ResponseContentEntity> responselist = new List <Model.ResponseContentEntity>();

            Model.ResponseContentEntity responseEntity = new Model.ResponseContentEntity();
            responseEntity.id  = id;
            responseEntity.wid = apiid;


            BLL.wx_xt_base   xtBll    = new BLL.wx_xt_base();
            Model.wx_xt_base actModel = xtBll.GetModel(id);
            if (actModel.statedate < DateTime.Now)
            {  //活动尚未开始
                responseEntity.rcType   = Model.ReponseContentType.text;
                responseEntity.rContent = "【" + actModel.wxTitle + "】将于" + actModel.statedate + "举办,现已经结束";
            }

            else
            {
                //活动正在进行中

                responseEntity.rcType    = Model.ReponseContentType.txtpic;
                responseEntity.rContent  = actModel.wxTitle;
                responseEntity.rContent2 = actModel.word;
                responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/xitie/index.aspx?wid=" + apiid + "&xid=" + id;
                responseEntity.picUrl    = actModel.fengmian;
            }

            responselist.Add(responseEntity);
            return(responselist);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                int    xid    = MyCommFun.RequestInt("xid");
                int    wid    = MyCommFun.RequestInt("wid");
                string openid = MyCommFun.RequestOpenid();
                if (wid == 0 || openid == "")
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }

                if (xid > 0 && wid > 0)
                {
                    BLL.wx_xt_base bll = new BLL.wx_xt_base();
                    xitie       = bll.GetModel(xid);
                    xitie.music = MyCommFun.getWebSite() + xitie.music;
                    this.Title  = xitie.wxTitle;
                    BLL.wx_xt_photo           pbll  = new BLL.wx_xt_photo();
                    IList <Model.wx_xt_photo> plist = pbll.GetModelList("bId=" + xid);
                    if (plist == null || plist.Count <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < plist.Count; i++)
                    {
                        photolistStr += "<li class=\"pb_10\"><img src=\"" + plist[i].pUrl + "\" style=\"width: 100%;\"></li>";
                    }
                }
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                int xid = MyCommFun.RequestInt("xid");
                int  wid = MyCommFun.RequestInt("wid");
               string  openid = MyCommFun.RequestOpenid();
                if (wid == 0 || openid=="")
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }

                if (xid > 0 && wid>0)
                {

                    BLL.wx_xt_base bll = new BLL.wx_xt_base();
                    xitie = bll.GetModel(xid);
                    xitie.music = MyCommFun.getWebSite() + xitie.music;
                    this.Title = xitie.wxTitle;
                    BLL.wx_xt_photo pbll = new BLL.wx_xt_photo();
                    IList<Model.wx_xt_photo> plist = pbll.GetModelList("bId=" + xid );
                    if (plist == null || plist.Count <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < plist.Count; i++)
                    {
                        photolistStr += "<li class=\"pb_10\"><img src=\"" + plist[i].pUrl + "\" style=\"width: 100%;\"></li>";

                    }
                }

                

            }


        }
コード例 #4
0
        private void ShowInfo(int id)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();
            litwUrl.Text = MyCommFun.getWebSite() + "/weixin/xitie/index.aspx?wid=" + weixin.id + "&xid=" + id;
            hidid.Value  = id.ToString();
            Model.wx_xt_base xitie = sstBll.GetModel(id);

            Model.wx_requestRule rule = rBll.GetModelList("modelFunctionName='喜帖' and modelFunctionId=" + id)[0];
            txtKW.Text = rule.reqKeywords;

            //图片
            txtImgUrl.Text       = xitie.fengmian;
            imgbeginPic.ImageUrl = xitie.fengmian;

            txtKcdh.Text     = xitie.donghua;
            imgKcdh.ImageUrl = xitie.donghua;

            txtdonghuaSlt.Text     = xitie.donghuaSlt;
            imgdonghuaSlt.ImageUrl = xitie.donghuaSlt;


            txtwxTitle.Text          = xitie.wxTitle;
            txtmanName.Text          = xitie.manName;
            txtfelmanName.Text       = xitie.felmanName;
            radNameSeq.SelectedValue = xitie.nameSeq.Value.ToString();
            txttel.Text       = xitie.tel;
            txtstatedate.Text = xitie.statedate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            txtaddr.Text      = xitie.addr;
            txtvideo.Text     = xitie.video;
            txtMusic.Text     = xitie.music;
            txtword.Value     = xitie.word;
            txtsqrurl.Text    = xitie.sqrurl;
            txtcopyrite.Value = xitie.copyrite;
            txtPwd.Text       = xitie.pwd;

            txtLatXPoint.Text = xitie.lngX.Value.ToString();
            txtLngYPoint.Text = xitie.latY.Value.ToString();
            ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'> $(\"#baiduframe\").attr(\"src\", \"../lbs/MapSelectPoint.aspx?yjindu=" + xitie.latY.Value.ToString() + "&xweidu=" + xitie.lngX.Value.ToString() + "\");</script>");
        }
コード例 #5
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.wx_userweixin         weixin = GetWeiXinCode();
            Model.wx_requestRuleContent rc     = new Model.wx_requestRuleContent();
            int id = MyCommFun.Str2Int(hidid.Value);

            #region  //先判断
            string   strErr    = "";
            DateTime beginDate = DateTime.Parse(this.txtstatedate.Text);
            if (DateTime.Now >= beginDate)
            {
                JscriptMsg("开始时间必须大于当前时间", "", "Error");
                return;
            }

            if (this.txtKW.Text.Trim().Length == 0)
            {
                strErr += "关键词不能为空!";
            }
            if (this.txtwxTitle.Text.Trim().Length == 0)
            {
                strErr += "喜帖名称不能为空!";
            }
            if (txtmanName.Text.Trim().Length == 0 || txtmanName.Text.Trim().Length == 0)
            {
                strErr += "新郎和新娘名称不能为空!";
            }
            if (this.txtstatedate.Text.Trim().Length == 0 || !MyCommFun.isDateTime(txtstatedate.Text))
            {
                strErr += "婚宴时间不能为空!";
            }
            if (this.txtaddr.Text.Trim().Length == 0)
            {
                strErr += "宴席地点不能为空!";
            }
            if (strErr != "")
            {
                JscriptMsg(strErr, "back", "Error");
                return;
            }
            #endregion

            #region 赋值
            Model.wx_xt_base     xitie = new Model.wx_xt_base();
            Model.wx_requestRule rule  = new Model.wx_requestRule();

            string beginPic = txtImgUrl.Text.Trim();
            string kcdh     = txtKcdh.Text.Trim();

            string kcdh_slt = txtdonghuaSlt.Text.Trim();


            if (id > 0)
            {
                xitie = sstBll.GetModel(id);
            }

            xitie.wxTitle    = txtwxTitle.Text.Trim();
            xitie.manName    = txtmanName.Text.Trim();
            xitie.felmanName = txtfelmanName.Text.Trim();
            xitie.nameSeq    = int.Parse(radNameSeq.SelectedItem.Value);
            xitie.tel        = txttel.Text;
            xitie.statedate  = MyCommFun.Obj2DateTime(txtstatedate.Text);
            xitie.addr       = txtaddr.Text.Trim();

            xitie.video    = txtvideo.Text.Trim();
            xitie.music    = txtMusic.Text.Trim();
            xitie.word     = txtword.Value.Trim();
            xitie.sqrurl   = txtsqrurl.Text.Trim();
            xitie.copyrite = txtcopyrite.Value.Trim();
            xitie.pwd      = txtPwd.Text.Trim();
            //图片
            xitie.fengmian   = beginPic;
            xitie.donghua    = kcdh;
            xitie.donghuaSlt = kcdh_slt;

            //坐标
            decimal xPoint = (decimal)MyCommFun.Str2Float(this.txtLatXPoint.Text);
            decimal yPoint = (decimal)MyCommFun.Str2Float(this.txtLngYPoint.Text);
            xitie.lngX = xPoint;
            xitie.latY = yPoint;

            #endregion

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


                //2 新增回复规则表
                rBll.AddModeltxtPicRule(weixin.id, "喜帖", id, txtKW.Text.Trim());
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加喜帖,主键为" + id); //记录日志
                JscriptMsg("添加帖成功!", "xitielist.aspx", "Success");
            }
            else
            {   //修改
                //1修改主表
                sstBll.Update(xitie);

                //2 修改回复规则表
                IList <Model.wx_requestRule> rlist = rBll.GetModelList("modelFunctionName = '喜帖' and modelFunctionId=" + id);

                if (rlist != null && rlist.Count > 0)
                {
                    rule             = rlist[0];
                    rule.reqKeywords = txtKW.Text.Trim();
                    rBll.Update(rule);
                }
                else
                {
                    rBll.AddModeltxtPicRule(weixin.id, "喜帖", id, txtKW.Text.Trim());
                }

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改喜帖,主键为" + id); //记录日志
                JscriptMsg("修改喜帖成功!", "xitielist.aspx", "Success");
            }
        }