Example #1
0
        private void ShowInfo(int _id)
        {
            BLL.wx_product   bll   = new BLL.wx_product();
            Model.wx_product model = bll.GetModel(_id);

            ddlCategoryId.SelectedValue = model.typeId.Value.ToString();

            this.lblid.Text       = model.id.ToString();
            this.txtTitle.Text    = model.hdName;
            this.txtpSubject.Text = model.pSubject;

            this.txtbeginDate.Text = model.beginDate == null ? "" : model.beginDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            this.txtendDate.Text   = model.endDate == null ? "" : model.endDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            this.txtaddr.Text      = model.addr;
            this.txtContent.Value  = model.pContent;
            txtImgUrl.Text         = model.extStr2;

            this.txtPrice.Text         = model.price == null ? "" : model.price.Value.ToString();
            this.chkShowDate.Checked   = model.showDate;
            this.chkShowPrice.Checked  = model.showPrice;
            this.chkShowYuDing.Checked = model.showYuDing;
            this.txtAnNiuTxt.Text      = model.btnName == "" ? "预定" : model.btnName;
            this.txtSortId.Text        = model.extInt == null ? "99" : model.extInt.Value.ToString();
            txtUrl.Text = model.url == null ? "" : model.url;
        }
Example #2
0
        private bool DoAdd()
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            bool result = false;

            Model.wx_product model = new Model.wx_product();
            BLL.wx_product   bll   = new BLL.wx_product();

            string   hdName     = this.txtTitle.Text;
            string   hdSubject  = this.txtpSubject.Text;
            string   hdAddr     = this.txtaddr.Text;
            string   hdContent  = this.txtContent.Value;
            DateTime createTime = DateTime.Now;
            string   tupian     = txtImgUrl.Text;//封面图片
            decimal  price      = decimal.Parse(txtPrice.Text);
            bool     showDate   = chkShowDate.Checked;
            bool     showPrice  = chkShowPrice.Checked;
            bool     showYuDing = chkShowYuDing.Checked;
            int      seq        = MyCommFun.Str2Int(txtSortId.Text);

            model.hdName   = hdName;
            model.pSubject = hdSubject;

            model.addr       = hdAddr;
            model.pContent   = hdContent;
            model.extStr2    = tupian;
            model.btnName    = txtAnNiuTxt.Text.Trim();
            model.typeId     = MyCommFun.Str2Int(ddlCategoryId.SelectedItem.Value);
            model.price      = price;
            model.showDate   = showDate;
            model.showPrice  = showPrice;
            model.showYuDing = showYuDing;
            model.extInt     = seq;
            model.wid        = weixin.id;
            model.url        = txtUrl.Text.Trim();
            model.createDate = DateTime.Now;
            if (txtbeginDate.Text.Trim() != "")
            {
                if (MyCommFun.isDateTime(txtbeginDate.Text))
                {
                    model.beginDate = DateTime.Parse(txtbeginDate.Text);
                }
            }

            if (txtendDate.Text.Trim() != "")
            {
                if (MyCommFun.isDateTime(txtendDate.Text))
                {
                    model.endDate = DateTime.Parse(txtendDate.Text);
                }
            }
            if (bll.Add(model) > 0)
            {
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加产品库信息:" + model.hdName); //记录日志
                result = true;
            }
            return(result);
        }
Example #3
0
        public void BindData(int id)
        {
            BLL.wx_product   hdBll   = new BLL.wx_product();
            Model.wx_product huodong = hdBll.GetModel(id);
            Page.Title    = huodong.hdName;
            litTheme.Text = huodong.pSubject;

            litCreateDate.Text = huodong.createDate == null ? "" : huodong.createDate.Value.ToString("yyyy-MM-dd");
            if (huodong.extStr2 == null || huodong.extStr2.ToString().Trim() == "")
            {
                imgPic.Style.Add("display", "none");
            }
            else
            {
                imgPic.ImageUrl = huodong.extStr2;
            }
            StringBuilder detailSB = new StringBuilder();

            if (isNotNullFun(huodong.beginDate))
            {
                detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">");
                detailSB.Append("时间 :" + huodong.beginDate.Value.ToShortDateString() + " ~ ");
                if (isNotNullFun(huodong.endDate))
                {
                    detailSB.Append(huodong.endDate.Value.ToShortDateString());
                }
                detailSB.Append(" </div></li>\r\n");
            }
            if (isNotNullFun(huodong.addr))
            {
                detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">");
                detailSB.Append("地点 :" + huodong.addr);
                detailSB.Append(" </div></li>\r\n");
            }

            if (isNotNullFun(huodong.pContent))
            {
                //detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">");
                //detailSB.Append("活动内容 :");
                //detailSB.Append(" </div></li>\r\n");
                //detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">");
                //detailSB.Append("  " + huodong.hdContent);
                //detailSB.Append(" </div></li>\r\n");
                litContent.Text = huodong.pContent;
            }

            litDetail.Text = detailSB.ToString();

            //底部菜单设置
            int    wid    = MyCommFun.RequestInt("wid");
            string openid = MyCommFun.RequestOpenid();

            BLL.wx_product_type   hdtypeBll  = new BLL.wx_product_type();
            Model.wx_product_type type       = hdtypeBll.GetModel(huodong.typeId.Value);
            StringBuilder         bottomMenu = new StringBuilder("");
            int num_dh = 0;

            if (isNotNullFun(type.tel))
            {
                num_dh++;
                bottomMenu.Append("  <li> <a href=\"tel:" + type.tel + "\">");
                bottomMenu.Append("  <img src=\"/images/templates/bottommenu/181.png\"><label>联系电话</label></a></li>");
            }

            if (isNotNullFun(type.daohangurl))
            {
                num_dh++;
                bottomMenu.Append(" <li> <a href=\"" + type.daohangurl + "\">");
                bottomMenu.Append(" <img src=\"/images/templates/bottommenu/131.png\"><label>一键导航</label></a>  </li>");
            }
            if (isNotNullFun(type.showDefault) && type.showDefault)
            {
                bottomMenu.Append(" <li class=\"home\"><a href=\"/index.aspx?wid=" + wid + "&openid=" + openid + "\"></a></li>");
            }

            num_dh++;
            if (isNotNullFun(huodong.url))
            {
                num_dh++;
                string yudingName = "在线预定";
                if (isNotNullFun(huodong.btnName))
                {
                    yudingName = huodong.btnName;
                }
                bottomMenu.Append(" <li> <a href=\"" + huodong.url + "\">");
                bottomMenu.Append(" <img src=\"/images/templates/bottommenu/127.png\"><label>" + yudingName + "</label></a>  </li>");
            }
            if (num_dh == 4)
            {
                bottomMenu.Append("<li> <a href=\"http://m.baidu.com\">");
                bottomMenu.Append("<img src=\"/images/templates/bottommenu/43.png\"><label>百度搜索</label></a>  </li>");
            }

            litdaohang.Text = bottomMenu.ToString();
        }
        private bool DoAdd()
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            bool result = false;
            Model.wx_product model = new Model.wx_product();
            BLL.wx_product bll = new BLL.wx_product();

            string hdName = this.txtTitle.Text;
            string hdSubject = this.txtpSubject.Text;
            string hdAddr = this.txtaddr.Text;
            string hdContent = this.txtContent.Value;
            DateTime createTime = DateTime.Now;
            string tupian = txtImgUrl.Text;//封面图片
            decimal price = decimal.Parse(txtPrice.Text);
            bool showDate = chkShowDate.Checked;
            bool showPrice = chkShowPrice.Checked;
            bool showYuDing = chkShowYuDing.Checked;
            int seq =MyCommFun.Str2Int(txtSortId.Text);

            model.hdName = hdName;
            model.pSubject = hdSubject;

            model.addr = hdAddr;
            model.pContent = hdContent;
            model.extStr2 = tupian;
            model.btnName = txtAnNiuTxt.Text.Trim();
            model.typeId =MyCommFun.Str2Int( ddlCategoryId.SelectedItem.Value);
            model.price = price;
            model.showDate = showDate;
            model.showPrice = showPrice;
            model.showYuDing = showYuDing;
            model.extInt = seq;
            model.wid = weixin.id;
            model.url = txtUrl.Text.Trim();
            model.createDate = DateTime.Now;
            if (txtbeginDate.Text.Trim() != "")
            {
                if (MyCommFun.isDateTime(txtbeginDate.Text))
                {
                    model.beginDate = DateTime.Parse(txtbeginDate.Text);
                }
            }

            if (txtendDate.Text.Trim() != "")
            {
                if (MyCommFun.isDateTime(txtendDate.Text))
                {
                    model.endDate = DateTime.Parse(txtendDate.Text);
                }
            }
            if (bll.Add(model) > 0)
            {
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加产品库信息:" + model.hdName); //记录日志
                result = true;
            }
            return result;
        }