Ejemplo n.º 1
0
        /// <summary>
        /// 绑定积分信息
        /// </summary>
        /// <param name="user"></param>
        private void bindJiFen(Model.wx_ucard_users user)
        {
            StringBuilder jiStr = new StringBuilder("");

            jiStr.Append("<div class=\"jifen-box\" style=\"margin-top:13px;\"><ul class=\"zongjifen\">");
            jiStr.Append("<li>  <div class=\"fengexian\">  <p>会员总积分</p>  <span>" + MyCommFun.ObjToStr(user.ttScore, "0") + "</span> </div>  </li>");

            jiStr.Append(" <li><a href=\"qiandao.aspx?wid=" + wid + "&sid=" + sid + "&openid=" + openid + "\">");
            jiStr.Append("  <div class=\"fengexian\"> <p>签到积分</p> <span>" + MyCommFun.ObjToStr(user.qdScore, "0") + "</span> </div> </a></li>");

            jiStr.Append(" <li><a href=\"shopping_history.aspx?wid=" + wid + "&sid=" + sid + "&openid=" + openid + "\">");
            jiStr.Append("<p>消费积分</p>  <span>" + MyCommFun.ObjToStr(user.consumeScore, "0") + "</span></a></li>");

            jiStr.Append(" </ul><div class=\"clr\"></div></div>");
            litJiFen.Text = jiStr.ToString();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 取商品列表,混合调用
        /// </summary>
        public DataTable ProductIndexPage()
        {
            Tag tag = this.Document.CurrentRenderingTag;
            //数据条数
            var topTag = tag.Attributes["top"];
            int top    = MyCommFun.Obj2Int(topTag.Value.GetValue());
            //取类ID
            var classlayer = tag.Attributes["cid"];
            int classid    = MyCommFun.Obj2Int(classlayer.Value.GetValue());
            //自定义where
            var    whereTag = tag.Attributes["where"];
            string mywhere  = MyCommFun.ObjToStr(whereTag.Value.GetValue());

            var    orderByTag = tag.Attributes["orderby"];
            string orderby    = MyCommFun.ObjToStr(orderByTag.Value.GetValue());

            string where = where = " wid=" + wid;
            if (classid != 0)
            {
                where += " and categoryId=" + classid;
            }

            where += mywhere;

            DataSet productlist = new DataSet();


            DAL.wx_shop_product artDal = new DAL.wx_shop_product();
            productlist = artDal.GetList(top, where, orderby);
            if (productlist != null && productlist.Tables.Count > 0 && productlist.Tables[0].Rows.Count > 0)
            {
                DataRow dr;

                for (int i = 0; i < productlist.Tables[0].Rows.Count; i++)
                {
                    dr             = productlist.Tables[0].Rows[i];
                    dr["link_url"] = MyCommFun.urlAddOpenid("detail.aspx?wid=" + wid + "&pid=" + dr["id"].ToString(), openid);
                    productlist.AcceptChanges();
                }
            }

            DataTable ds = new DataTable();

            ds = productlist.Tables[0].Copy();
            return(ds);
        }
Ejemplo n.º 3
0
        private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            this.page = MXRequest.GetQueryInt("page", 1);

            this.txtKeywords.Text = this.keywords;
            //图表或列表显示
            BLL.article bll = new BLL.article();
            DataSet     ds  = bll.GetWCodeList(weixin.id, _channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                int     cout = ds.Tables[0].Rows.Count;
                for (int i = 0; i < cout; i++)
                {
                    dr = ds.Tables[0].Rows[i];

                    string linkUrl = MyCommFun.ObjToStr(dr["link_url"]);

                    if (linkUrl.Length > 0)
                    {
                        //外链地址
                        dr["link_url"] = "<span class=\"lianjie_wai\">[外]</span>" + " <a href=\"javascript:;\">" + linkUrl + "</a>";
                    }
                    else
                    {
                        dr["link_url"] = "<span class=\"lianjie_ben\">[本]</span>" + " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/content.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&aid=" + dr["id"].ToString() + "</a>";

                        // dr["link_url"] = "<span class=\"lianjie_ben\">[本]</span>" + " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/detail.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&aid=" + dr["id"] + "</a>";
                    }
                }
                ds.AcceptChanges();
            }
            this.rptList1.DataSource = ds;
            this.rptList1.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("wx_article_page_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
                                              _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 4
0
        private void ShowInfo()
        {
            IList <Model.wx_ucard_score> syslist = scoreBll.GetModelList("sId=" + sid);

            if (syslist == null || syslist.Count <= 0)
            {
                return;
            }
            Model.wx_ucard_score score = syslist[0];
            hidid.Value               = score.id.ToString();
            txtuserdContent.Value     = score.userdContent;
            txtscoreRegular.Value     = score.scoreRegular;
            txtqiandaoScore.Text      = MyCommFun.ObjToStr(score.qiandaoScore.Value);
            txtqiandao6Score.Text     = MyCommFun.ObjToStr(score.qiandao6Score.Value);
            txtconsumeMoney.Text      = MyCommFun.ObjToStr(score.consumeMoney.Value);
            txtconsumeMoneyScore.Text = MyCommFun.ObjToStr(score.consumeMoneyScore.Value);


            //绑定等级
            BLL.wx_ucard_udegree           dBll     = new wx_ucard_udegree();
            IList <Model.wx_ucard_udegree> itemlist = dBll.GetModelList("sId=" + sid + " order by degreeNum asc");

            if (itemlist != null && itemlist.Count > 0)
            {
                int     count = itemlist.Count;
                TextBox txtLevelName;
                TextBox txtLevelMin;
                TextBox txtLevelMax;
                Model.wx_ucard_udegree itemEntity = new Model.wx_ucard_udegree();
                for (int i = 1; i <= count; i++)
                {
                    itemEntity = itemlist[(i - 1)];

                    txtLevelName = this.FindControl("txtLevel" + i + "Name") as TextBox;
                    txtLevelMin  = this.FindControl("txtLevel" + i + "Min") as TextBox;
                    txtLevelMax  = this.FindControl("txtLevel" + i + "Max") as TextBox;

                    txtLevelName.Text = itemEntity.callName;
                    txtLevelMin.Text  = itemEntity.score_min.Value.ToString();
                    txtLevelMax.Text  = itemEntity.score_max.Value.ToString();
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 关键词查询,找到该规则对应的主键ID,使用存储过程
        /// </summary>
        /// <param name="wid">微帐号主键Id</param>
        /// <param name="keywords">关键词</param>
        /// <param name="responseType">回复类型</param>
        /// <param name="modelFunctionName">模块名称</param>
        /// <param name="modelFunctionId">模块Id</param>
        /// <returns></returns>
        public int GetRuleIdByKeyWords(int wid, string keywords, out int responseType, out string modelFunctionName, out int modelFunctionId)
        {
            int ret = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@wid",               SqlDbType.Int,       4),
                new SqlParameter("@keywords",          SqlDbType.VarChar, 500),
                new SqlParameter("@id",                SqlDbType.Int,       4),
                new SqlParameter("@responseType",      SqlDbType.Int,       4),
                new SqlParameter("@modelFunctionName", SqlDbType.VarChar, 200),
                new SqlParameter("@modelFunctionId",   SqlDbType.Int, 4)
            };
            parameters[0].Value     = wid;
            parameters[1].Value     = keywords;
            parameters[2].Value     = 0;
            parameters[2].Direction = ParameterDirection.Output;

            parameters[3].Value     = 0;
            parameters[3].Direction = ParameterDirection.Output;

            parameters[4].Value     = "";
            parameters[4].Direction = ParameterDirection.Output;

            parameters[5].Value     = 0;
            parameters[5].Direction = ParameterDirection.Output;


            SqlDataReader sr = DbHelperSQL.RunProcedure("p_query_keywords", parameters);

            //while (sr.Read())
            //{
            //    ret = int.Parse(sr["id"].ToString());
            //}
            sr.Close();
            ret               = MyCommFun.Obj2Int(parameters[2].Value);
            responseType      = MyCommFun.Obj2Int(parameters[3].Value);
            modelFunctionName = MyCommFun.ObjToStr(parameters[4].Value);
            modelFunctionId   = MyCommFun.Obj2Int(parameters[5].Value);

            return(ret);
        }
Ejemplo n.º 6
0
        private void ShowInfo(int _id)
        {
            //获取实体对象
            ModelInfo = bll.GetModel(_id);
            //规格名称
            this.txt_sName.Text = ModelInfo.sName;
            //计量单位
            this.txt_sUnit.Text = ModelInfo.sUnit;
            //重量
            this.txt_sWeight.Text = MyCommFun.ObjToStr(ModelInfo.sWeight);
            //体积
            this.txt_sVolume.Text = MyCommFun.ObjToStr(ModelInfo.sVolume);
            //价格
            this.txt_sPrice.Text = MyCommFun.ObjToStr(ModelInfo.sPrice);
            //排序序号
            this.txtSortid.Text = MyCommFun.ObjToStr(ModelInfo.sSortNum);

            //备注
            //this.txt_Remark.Text = ModelInfo.sRemark;
        }
Ejemplo n.º 7
0
        private void ShowInfo(int _id)
        {
            //获取实体对象
            ModelInfo = bll.GetModel(_id);

            //收料编号
            txt_BNum.Text = ModelInfo.BNum;
            //存放仓库
            ddl_WareHouse.SelectedValue = ModelInfo.WareHouse;
            //客户姓名
            txt_CustomerName.Text = ModelInfo.CustomerName;
            //移动电话
            txt_Mobile.Text = ModelInfo.Mobile;
            //固定电话
            txt_Tel.Text = ModelInfo.Tel;
            //代发银行
            ddl_BankName.SelectedValue = ModelInfo.BankName;
            //银行账号
            txt_BankAccount.Text = ModelInfo.BankAccount;
            //户名
            txt_AccountName.Text = ModelInfo.AccountName;
            //产品名称ID
            ddl_ProductName.SelectedValue = MyCommFun.ObjToStr(ModelInfo.ProjectId);
            //产品规格ID
            ddl_ProductStandard.SelectedValue = MyCommFun.ObjToStr(ModelInfo.ProductStandardId);
            //单位
            txt_Unit.Text = ModelInfo.Unit;
            //毛重
            txt_GrossWeight.Text = MyCommFun.ObjToStr(ModelInfo.GrossWeight);
            //皮重
            txt_Tare.Text = MyCommFun.ObjToStr(ModelInfo.Tare);
            //净重
            txt_NetWeight.Value = MyCommFun.ObjToStr(ModelInfo.NetWeight);
            //价格
            txt_Price.Text = MyCommFun.ObjToStr(ModelInfo.Price);
            //金额
            txt_Amount.Value = MyCommFun.ObjToStr(ModelInfo.Amount);

            //备注
            this.txt_Remark.Text = ModelInfo.Remark;
        }
Ejemplo n.º 8
0
        private void ShowInfo(int _id)
        {
            litpwdtip.Text = "不填则不修改密码";
            BLL.manager   bll   = new BLL.manager();
            Model.manager model = bll.GetModel(_id);
            //ddlRoleId.SelectedValue = model.role_id.ToString();
            if (model.is_lock == 0)
            {
                cbIsLock.Checked = true;
            }
            else
            {
                cbIsLock.Checked = false;
            }
            txtUserName.Text     = model.user_name;
            txtUserName.ReadOnly = true;
            txtUserName.Attributes.Remove("ajaxurl");

            txtRealName.Text          = model.real_name;
            txtTelephone.Text         = model.telephone;
            txtEmail.Text             = model.email;
            ddlProvince.SelectedValue = model.province;
            ddlCity.SelectedValue     = model.city;
            txtArea.Text   = model.county;
            txtqq.Text     = model.qq;
            txtEmail.Text  = model.email;
            txtSortid.Text = MyCommFun.ObjToStr(model.sort_id);  // model.sort_id;
            txtRemark.Text = model.remark;

            //代理商信息
            Model.wx_agent_info agentinfo = aBll.GetAgentModel(_id);

            txtagentPrice.Text          = agentinfo.agentPrice.Value.ToString();
            txtsqJine.Text              = agentinfo.sqJine.Value.ToString();
            txtcompanyName.Text         = agentinfo.companyInfo;
            ddlagentType.SelectedValue  = agentinfo.agentType.Value.ToString();
            ddlagentLevel.SelectedValue = agentinfo.agentLevel;

            txtagentArea.Text = agentinfo.agentArea;
            txtindustry.Text  = agentinfo.industry;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 绑定页面的repeater活动列表
        /// </summary>
        /// <param name="currentPage"></param>
        public void BindRepeater(int currentPage)
        {
            int RecordCount = 0;

            // currentPage -= 1;
            DataSet hdDt = hdBll.GetPageList(" typeId  in (select id from  wx_product_type where wid=" + wid + "  and store_id=" + pid + ")", pageSize, currentPage, out RecordCount, " extInt asc,createdate desc");

            string showinfoStr = "";

            if (hdDt != null && hdDt.Tables.Count > 0 && hdDt.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                for (int i = 0; i < hdDt.Tables[0].Rows.Count; i++)
                {
                    dr          = hdDt.Tables[0].Rows[i];
                    showinfoStr = "";
                    if (dr["showDate"].ToString().ToLower() == "true")
                    {
                        showinfoStr += " <span class=\"list_span\">" + dateStr(dr["createDate"]) + "</span>";
                    }
                    if (dr["showPrice"].ToString().ToLower() == "true")
                    {
                        showinfoStr += "<span class=\"list_span span_money\">¥" + MyCommFun.ObjToStr(dr["price"]) + "</span>";
                    }
                    if (dr["showYuDing"].ToString().ToLower() == "true")
                    {
                        showinfoStr += " <a href='" + MyCommFun.urlAddOpenid(MyCommFun.ObjToStr(dr["url"]), openid) + "' class=\"a_yuding\">" + (MyCommFun.ObjToStr(dr["btnName"]) == null ? "预定" : MyCommFun.ObjToStr(dr["btnName"])) + "</a>";
                    }
                    if (showinfoStr != "")
                    {
                        dr["showInfo"] = " <div class=\"list_div\">" + showinfoStr + " </div>  ";
                    }
                }
            }

            rpAction.DataSource = hdDt;
            rpAction.DataBind();
            litCurrentPage.Text = currentPage.ToString();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 获得投票信息
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Model.wx_vote_base GetVoteBaseByWid(int wid, int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1");
            strSql.Append(" * ");
            strSql.Append(" from wx_vote_base  where   id=@id  and wId=@wId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",  SqlDbType.Int, 4),
                new SqlParameter("@wId", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;
            parameters[1].Value = wid;
            SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters);

            Model.wx_vote_base category = new Model.wx_vote_base();
            while (sr.Read())
            {
                category                = new Model.wx_vote_base();
                category.id             = MyCommFun.Obj2Int(sr["id"]);
                category.title          = MyCommFun.ObjToStr(sr["title"]);
                category.votepic        = MyCommFun.ObjToStr(sr["votepic"]);
                category.picdisplay     = MyCommFun.ObjBool(sr["picdisplay"]);
                category.votecontent    = MyCommFun.ObjToStr(sr["votecontent"]);
                category.isRadio        = MyCommFun.ObjBool(sr["isRadio"]);
                category.beginTime      = MyCommFun.Obj2DateTime(sr["beginTime"]);
                category.endTime        = MyCommFun.Obj2DateTime(sr["endTime"]);
                category.resultShowtype = MyCommFun.Obj2Int(sr["resultShowtype"]);
                category.actUrl         = MyCommFun.ObjToStr(sr["actUrl"]);
                category.voteType       = MyCommFun.Obj2Int(sr["voteType"]);
                category.sort_id        = MyCommFun.Obj2Int(sr["sort_id"]);
                category.creatDate      = MyCommFun.Obj2DateTime(sr["creatDate"]);
            }
            sr.Close();

            return(category);
        }
Ejemplo n.º 11
0
        private void ShowInfo(int id)
        {
            DataSet ds = rBll.GetRuleContent("id=" + id);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                txtreqKeywords.Text = MyCommFun.ObjToStr(dr["reqKeywords"]);
                if (MyCommFun.ObjToStr(dr["isLikeSearch"]) != "")
                {
                    if (dr["isLikeSearch"].ToString().ToLower() == "false")
                    {
                        rblisLikeSearch.SelectedValue = "0";
                    }
                    else
                    {
                        rblisLikeSearch.SelectedValue = "1";
                    }
                }

                txtrContent.Text = MyCommFun.ObjToStr(dr["rContent"]);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 取购物车里的商品信息
        /// </summary>
        /// <param name="openid"></param>
        /// <param name="wid"></param>
        /// <returns></returns>
        public List <Model.cartProduct> GetCartList(string openid, int wid)
        {
            DataSet ds = dal.GetCartList(openid, wid);
            List <Model.cartProduct> cartlist = new List <cartProduct>();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                int count = ds.Tables[0].Rows.Count;
                Model.cartProduct cproduct = new cartProduct();
                DataRow           dr;
                for (int i = 0; i < count; i++)
                {
                    dr                   = ds.Tables[0].Rows[i];
                    cproduct             = new cartProduct();
                    cproduct.id          = MyCommFun.Obj2Int(dr["id"]);
                    cproduct.openid      = MyCommFun.ObjToStr(dr["openid"]);
                    cproduct.productId   = MyCommFun.Obj2Int(dr["productId"]);
                    cproduct.productName = MyCommFun.ObjToStr(dr["productName"]);
                    cproduct.productNum  = MyCommFun.Obj2Int(dr["productNum"]);
                    cproduct.productPic  = MyCommFun.ObjToStr(dr["pic"]);
                    cproduct.skuId       = MyCommFun.Obj2Int(dr["skuId"]);
                    cproduct.skuInfo     = MyCommFun.ObjToStr(dr["skuInfo"]);
                    cproduct.totPrice    = MyCommFun.Str2Decimal(dr["totPrice"].ToString());
                    cproduct.totPrice100 = cproduct.totPrice * 100;
                    cproduct.avgPrice    = MyCommFun.decimalF2(cproduct.totPrice / (cproduct.productNum == 0?1:cproduct.productNum));
                    cproduct.avgPrice100 = cproduct.avgPrice * 100;
                    cproduct.createDate  = MyCommFun.Obj2DateTime(dr["createDate"]);
                    cproduct.wid         = MyCommFun.Obj2Int(dr["wid"]);
                    cproduct.stock       = MyCommFun.Obj2Int(dr["stock"]);
                    cproduct.productUrl  = "/shop/detail.aspx?wid=" + cproduct.wid + "&pid=" + cproduct.productId + "&openid=" + cproduct.openid;
                    cproduct.seq         = i;
                    cartlist.Add(cproduct);
                }
            }

            return(cartlist);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 获得该分类信息,使用wid仅仅作为限制条件
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public Model.article_category GetCategoryByWid(int wid, int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1");
            strSql.Append(" id,title,call_index,parent_id,class_layer,link_url,img_url,[content],ico_url,seo_title,seo_keywords,seo_description  ");
            strSql.Append(" from dt_article_category  where   id=@id  and wId=@wId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",  SqlDbType.Int, 4),
                new SqlParameter("@wId", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;
            parameters[1].Value = wid;
            SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters);

            Model.article_category category = new Model.article_category();
            while (sr.Read())
            {
                category                 = new Model.article_category();
                category.id              = MyCommFun.Obj2Int(sr["id"]);
                category.title           = MyCommFun.ObjToStr(sr["title"]);
                category.call_index      = MyCommFun.ObjToStr(sr["call_index"]);
                category.parent_id       = MyCommFun.Obj2Int(sr["parent_id"]);
                category.class_layer     = MyCommFun.Obj2Int(sr["class_layer"]);
                category.link_url        = MyCommFun.ObjToStr(sr["link_url"]);
                category.img_url         = MyCommFun.ObjToStr(sr["img_url"]);
                category.content         = MyCommFun.ObjToStr(sr["content"]);
                category.ico_url         = MyCommFun.ObjToStr(sr["ico_url"]);
                category.seo_title       = MyCommFun.ObjToStr(sr["seo_title"]);
                category.seo_keywords    = MyCommFun.ObjToStr(sr["seo_keywords"]);
                category.seo_description = MyCommFun.ObjToStr(sr["seo_description"]);
            }
            sr.Close();
            return(category);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 通过wid获得该微帐号的站点信息,(换成存储过程获得数据)
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="templateskin">模版的虚拟路劲</param>
        /// <returns></returns>
        public WeiXinPF.Model.wxcodeconfig GetModelByWid(int wid, string templateskin)
        {
            //StringBuilder strSql = new StringBuilder();
            //strSql.Append("select  top 1 ws.id,wId,wName,companyName,bgMusic,bgPic,bgDongHuaId,wCopyright,wBrief,ws.remark,phone,addr,addrUrl,email,seo_title,seo_keywords,seo_desc");
            //strSql.Append(",wxName,wxId,weixinCode,headerpic,wxprovince,wxcity,w.enddate ");
            //strSql.Append(" from wx_wsite_setting  ws,wx_userweixin  w ");
            //strSql.Append(" where ws.wId=w.id and  w.id=@wId  and w.isDelete=0 ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@wid", SqlDbType.Int, 4)
            };
            parameters[0].Value = wid;


            WeiXinPF.Model.wxcodeconfig config = new WeiXinPF.Model.wxcodeconfig();
            SqlDataReader sr = DbHelperSQL.RunProcedure("p_wcode_wsiteinfo", parameters);

            while (sr.Read())
            {
                config.wid = wid;
                #region 微信帐号的基本信息
                config.wxcode     = MyCommFun.ObjToStr(sr["weixinCode"]);
                config.wxname     = MyCommFun.ObjToStr(sr["wxName"]);
                config.wxphoto    = MyCommFun.ObjToStr(sr["headerpic"]);
                config.wxprovince = MyCommFun.ObjToStr(sr["wxprovince"]);
                config.wxcity     = MyCommFun.ObjToStr(sr["wxcity"]);
                if (DateTime.Parse(sr["enddate"].ToString()) < DateTime.Now)
                { //过期
                    config.wxstatus = 0;
                }
                else
                {
                    config.wxstatus = 1;
                }

                #endregion

                #region 微网站的基本信息
                config.templateskin = templateskin;
                config.sitename     = MyCommFun.ObjToStr(sr["wName"]);
                config.companyname  = MyCommFun.ObjToStr(sr["companyName"]);
                config.bgmusic      = MyCommFun.ObjToStr(sr["bgMusic"]);
                config.bgpic        = MyCommFun.ObjToStr(sr["bgPic"]);
                config.bgdonghuaid  = MyCommFun.Obj2Int(sr["bgDongHuaId"]);
                config.wcopyright   = MyCommFun.ObjToStr(sr["wCopyright"]);
                config.wbrief       = MyCommFun.ObjToStr(sr["wBrief"]);
                config.remark       = MyCommFun.ObjToStr(sr["remark"]);
                config.phone        = MyCommFun.ObjToStr(sr["phone"]);
                config.addr         = MyCommFun.ObjToStr(sr["addr"]);
                config.addrurl      = MyCommFun.ObjToStr(sr["addrUrl"]);

                config.email       = MyCommFun.ObjToStr(sr["email"]);
                config.seotitle    = MyCommFun.ObjToStr(sr["seo_title"]);
                config.seokeywords = MyCommFun.ObjToStr(sr["seo_keywords"]);
                config.seodesc     = MyCommFun.ObjToStr(sr["seo_desc"]);
                config.topht       = MyCommFun.ObjToStr(sr["topcolorHtml"]);
                config.bmenuTid    = MyCommFun.ObjToStr(sr["bmenuTid"]);
                #endregion
            }
            sr.Close();

            return(config);
        }
Ejemplo n.º 15
0
        private void bindData()
        {
            string jibie = "会员卡号";

            BLL.wx_ucard_cardinfo   cardBll  = new BLL.wx_ucard_cardinfo();
            Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelBySid(id);

            BLL.wx_ucard_users   userBll = new BLL.wx_ucard_users();
            Model.wx_ucard_users user    = userBll.GetStoreUserInfo(openid, id);
            bool hasLq = true;

            if (user == null || user.id <= 0)
            {
                //说明该用户还未领取这个会员卡
                hasLq = false;
                StringBuilder lqStr = new StringBuilder("");
                lqStr.Append(" <div class=\"msk\"><p class=\"explain2\">");
                lqStr.Append("<a id=\"showcard\" class=\"receive\" href=\"javascript:void(0)\">领取您的新会员卡</a><span>微时代会员卡,方便携带收藏,永不挂失</span>");
                lqStr.Append("</p></div>");
                litLQK.Text = lqStr.ToString();
            }
            else
            {
                jibie = BLL.wx_ucard_fun.userDegree(id, MyCommFun.Obj2Int(user.ttScore), jibie, out degreeNum);

                //已经领取了会员卡
                bindJiFen(user);  //展示积分
                bindNewInfo(user);
                QDInof(user);
            }
            if (cardinfo != null)
            {
                Page.Title = cardinfo.cardName;
                //卡版面设计
                StringBuilder sbStr = new StringBuilder("");
                string        bgPic = "";
                if (cardinfo.bgUrl == null || cardinfo.bgUrl.Trim().Length <= 0)
                {
                    bgPic = cardinfo.bgTypeUrl;
                }
                else
                {
                    bgPic = cardinfo.bgUrl;
                }
                sbStr.Append(" <img class=\"cardbg\" src=\"" + bgPic + "\">");
                sbStr.Append(" <img id=\"cardlogo\" class=\"logo\" src=\"" + cardinfo.logo + "\">");
                sbStr.Append(" <h1 style=\"color: " + cardinfo.cardNameColor + "\">" + cardinfo.cardName + "</h1>");
                if (hasLq)
                {
                    sbStr.Append(" <strong class=\"pdo verify\" style=\"color: " + cardinfo.cardNoColor + "\"><span id=\"cdnb\"><em>" + jibie + "</em>" + user.cardNo + "</span></strong>");
                }
                else
                {
                    sbStr.Append(" <strong class=\"pdo verify\" style=\"color: #A985FF\"><span id=\"cdnb\"><em>普通会员</em>00000000</span></strong>");
                }
                litCardInfo.Text = sbStr.ToString();
            }
            //店铺信息
            BLL.wx_ucard_store   storeBll = new BLL.wx_ucard_store();
            Model.wx_ucard_store store    = storeBll.GetModel(id);
            if (store != null)
            {
                litTel.Text  = MyCommFun.ObjToStr(store.tel);
                litAddr.Text = MyCommFun.ObjToStr(store.addr);
                aAddr.HRef   = "http://api.map.baidu.com/marker?location=" + store.yPoint + "," + store.xPoint + "&amp;title=" + store.addr + "&amp;content=" + store.cardBrief + "&amp;output=html";
                aTel.HRef    = "tel:" + store.tel;;
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 获得微帐号的分类信息
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="topNum">取前几条数据;若为-1,则不作筛选条件</param>
        /// <param name="parentId">若为-1,则不作筛选条件</param>
        /// <returns></returns>
        public IList <Model.article_category> GetCategoryListByWid(int wid, int topNum, int parentId, int class_layer)
        {
            IList <Model.article_category> categoryList = new List <Model.article_category>();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ");
            if (topNum >= 0)
            {
                strSql.Append(" top " + topNum + " ");
            }
            strSql.Append(" (select count(1) from dt_article_category sc where c.id=sc.parent_id) hasSun,id,title,call_index,parent_id,class_layer,link_url,img_url,[content],ico_url,seo_title,seo_keywords,seo_description from dt_article_category c where channel_id=1 ");
            if (parentId != -1)
            {
                strSql.Append(" and parent_id=" + parentId);
            }
            if (class_layer != -1)
            {
                strSql.Append(" and class_layer=" + class_layer);
            }

            strSql.Append(" and wId=@wId and cStatus=1 order by sort_id asc,id desc");
            SqlParameter[] parameters =
            {
                new SqlParameter("@wId", SqlDbType.Int, 4)
            };
            parameters[0].Value = wid;
            SqlDataReader sr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters);

            Model.article_category category = new Model.article_category();
            while (sr.Read())
            {
                category                 = new Model.article_category();
                category.id              = MyCommFun.Obj2Int(sr["id"]);
                category.title           = MyCommFun.ObjToStr(sr["title"]);
                category.call_index      = MyCommFun.ObjToStr(sr["call_index"]);
                category.parent_id       = MyCommFun.Obj2Int(sr["parent_id"]);
                category.class_layer     = MyCommFun.Obj2Int(sr["class_layer"]);
                category.link_url        = MyCommFun.ObjToStr(sr["link_url"]);
                category.img_url         = MyCommFun.ObjToStr(sr["img_url"]);
                category.content         = MyCommFun.ObjToStr(sr["content"]);
                category.ico_url         = MyCommFun.ObjToStr(sr["ico_url"]);
                category.seo_title       = MyCommFun.ObjToStr(sr["seo_title"]);
                category.seo_keywords    = MyCommFun.ObjToStr(sr["seo_keywords"]);
                category.seo_description = MyCommFun.ObjToStr(sr["seo_description"]);
                if (sr["hasSun"].ToString() == "0")
                {//无子分类
                    category.hasSun = false;
                }
                else
                {  //有子类
                    category.hasSun = true;
                }
                categoryList.Add(category);
            }
            sr.Close();



            return(categoryList);
        }
Ejemplo n.º 17
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            this.page = MXRequest.GetQueryInt("page", 1);

            this.txtKeywords.Text = this.keywords;
            //图表或列表显示
            BLL.wx_qp_base bll = new BLL.wx_qp_base();

            _strWhere = "wid=" + weixin.id + " and " + _strWhere;
            DataSet ds = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                int     cout = ds.Tables[0].Rows.Count;
                for (int i = 0; i < cout; i++)
                {
                    dr             = ds.Tables[0].Rows[i];
                    dr["link_url"] = "<a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/weixin/qiangpiao/index.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&aid=" + dr["id"].ToString() + "</a>";
                }
                ds.AcceptChanges();
            }
            this.rptList1.DataSource = ds;
            this.rptList1.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("action_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
        //数据绑定
        private void RptBind()
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetWCodeList(weixin.id, 0, this.channel_id);

            if (dt != null)
            {
                DataRow dr;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dr = dt.Rows[i];
                    if (dr["ico_url"] != null && dr["ico_url"].ToString().Trim() != "")
                    {
                        if (dr["ico_url"].ToString().Contains("."))
                        {
                            dr["ico_url"] = "<img  src=\"" + dr["ico_url"].ToString() + "\" class=\"imgico\" />";
                        }
                        else
                        {
                            dr["ico_url"] = "<span  class=\"" + dr["ico_url"].ToString() + "\" />";
                        }
                    }
                    //链接处理,待做
                    if (dr["link_url"] != null && dr["link_url"].ToString().Trim() != "")
                    {
                        dr["link_url"] = "<span class=\"lianjie_wai\">[外]</span>" + " <a href=\"javascript:;\" title=\"" + dr["link_url"].ToString() + "\">" + Utils.CutString(dr["link_url"].ToString(), 40) + "</a>";
                    }
                    else
                    {
                        dr["link_url"] = "<span class=\"lianjie_ben\">[本]</span>" + " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/list.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&cid=" + dr["id"] + "</a>";
                    }
                }
                dt.AcceptChanges();
            }

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Ejemplo n.º 19
0
        //数据绑定
        private void RptBind()
        {
            BLL.wx_product_sys  bll    = new BLL.wx_product_sys();
            Model.wx_userweixin weixin = GetWeiXinCode();
            DataTable           dt     = bll.GetWCodeList(weixin.id);

            if (dt != null)
            {
                DataRow dr;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dr = dt.Rows[i];
                    if (dr["banner"] != null && dr["banner"].ToString().Trim() != "")
                    {
                        if (dr["banner"].ToString().Contains("."))
                        {
                            dr["banner"] = "<img  src=\"" + dr["banner"].ToString() + "\" class=\"imgico\" />";
                        }
                        else
                        {
                            dr["banner"] = "<span  class=\"" + dr["banner"].ToString() + "\" />";
                        }
                    }
                    //链接处理,待做
                    if (dr["link_url"] != null && dr["link_url"].ToString().Trim() != "")
                    {
                        dr["link_url"] = "<span class=\"lianjie_wai\">[外]</span>" + " <a href=\"javascript:;\">" + dr["link_url"] + "</a>";
                    }
                    else
                    {
                        dr["link_url"] = "<span class=\"lianjie_ben\">[本]</span>" + " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/weixin/product/all.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&pid=" + dr["id"] + "</a>";
                    }
                }
            }

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Ejemplo n.º 20
0
        private void RptBind(int _category_id, string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            this.page = MXRequest.GetQueryInt("page", 1);
            if (this.category_id > 0)
            {
                this.ddlCategoryId.SelectedValue = _category_id.ToString();
            }

            this.txtKeywords.Text = this.keywords;
            //列表显示
            BLL.wx_product bll   = new BLL.wx_product();
            DataSet        artDs = bll.GetWCodeList(weixin.id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            //链接处理,待做
            if (artDs != null)
            {
                DataRow dr;
                for (int i = 0; i < artDs.Tables[0].Rows.Count; i++)
                {
                    dr        = artDs.Tables[0].Rows[i];
                    dr["url"] = " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/weixin/product/detail.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&id=" + dr["id"] + "</a>";
                }
            }

            this.rptList1.DataSource = artDs;
            this.rptList1.DataBind();


            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("product_list.aspx", "category_id={0}&keywords={1}&page={2}", ddlCategoryId.SelectedValue, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 21
0
        private void ShowInfo(int id)
        {
            hidid.Value = id.ToString();
            Model.wx_dzpActionInfo        dzpAction = dzpBll.GetModel(id);
            IList <Model.wx_dzpAwardItem> aItemlist = iBll.GetModelList("actId=" + id);

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

            if (dzpAction.beginPic != null && dzpAction.beginPic.Trim() != "/weixin/dzp/images/start.jpg")
            {
                txtImgUrl.Text       = dzpAction.beginPic;
                imgbeginPic.ImageUrl = dzpAction.beginPic;
            }
            txtactName.Text      = dzpAction.actName;
            txtcontractInfo.Text = dzpAction.contractInfo;
            txtbrief.Value       = dzpAction.brief;
            txtbeginDate.Text    = dzpAction.beginDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            txtendDate.Text      = dzpAction.endDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            txtactContent.Value  = dzpAction.actContent;
            txtcfcjhf.Text       = dzpAction.cfcjhf;
            this.txtdjPwd.Text   = dzpAction.djPwd;
            //结束
            if (dzpAction.endPic != null && dzpAction.endPic.Trim() != "/weixin/dzp/images/end.jpg")
            {
                txtEndPic.Text     = dzpAction.endPic;
                imgEndPic.ImageUrl = dzpAction.endPic;
            }
            txtendNotice.Text  = dzpAction.endNotice;
            txtendContent.Text = dzpAction.endContent;

            //奖项基本信息
            txtpersonNum.Text      = MyCommFun.ObjToStr(dzpAction.personNum);
            txtpersonMaxTimes.Text = MyCommFun.ObjToStr(dzpAction.personMaxTimes);
            txtdayMaxTimes.Text    = MyCommFun.ObjToStr(dzpAction.dayMaxTimes);


            //绑定奖项信息
            IList <Model.wx_dzpAwardItem> itemlist = iBll.GetModelList("actId=" + id + " order by sort_id asc");

            if (itemlist != null && itemlist.Count > 0)
            {
                int     count = itemlist.Count;
                TextBox txtJXName;
                TextBox txtJPName;
                TextBox txtNum;
                TextBox txtRealNum;
                Model.wx_dzpAwardItem itemEntity = new Model.wx_dzpAwardItem();
                for (int i = 1; i <= count; i++)
                {
                    itemEntity = itemlist[(i - 1)];
                    txtJXName  = this.FindControl("txt" + i + "JXName") as TextBox;
                    txtJPName  = this.FindControl("txt" + i + "JPName") as TextBox;
                    txtNum     = this.FindControl("txt" + i + "Num") as TextBox;
                    txtRealNum = this.FindControl("txt" + i + "RealNum") as TextBox;

                    txtJXName.Text  = itemEntity.jxName;
                    txtJPName.Text  = itemEntity.jpName;
                    txtNum.Text     = itemEntity.jpNum == null ? "0" : itemEntity.jpNum.Value.ToString();
                    txtRealNum.Text = itemEntity.jpRealNum == null ? "0" : itemEntity.jpRealNum.Value.ToString();
                }
            }
        }
Ejemplo n.º 22
0
        private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            this.page = MXRequest.GetQueryInt("page", 1);
            if (this.category_id > 0)
            {
                this.ddlCategoryId.SelectedValue = _category_id.ToString();
            }
            this.ddlProperty.SelectedValue = this.property;
            this.txtKeywords.Text          = this.keywords;
            //图表或列表显示
            BLL.article bll   = new BLL.article();
            DataSet     artDs = bll.GetWCodeList(weixin.id, _channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            //url链接地址处理
            if (artDs != null && artDs.Tables.Count > 0 && artDs.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                int     count = artDs.Tables[0].Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    dr = artDs.Tables[0].Rows[i];
                    string linkUrl = MyCommFun.ObjToStr(dr["link_url"]);

                    if (linkUrl.Length > 0)
                    {
                        //外链地址
                        dr["link_url"] = "<span class=\"lianjie_wai\">[外]</span>" + " <a href=\"javascript:;\">" + linkUrl + "</a>";
                    }
                    else
                    {
                        dr["link_url"] = "<span class=\"lianjie_ben\">[本]</span>" + " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/detail.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&aid=" + dr["id"] + "</a>";
                    }
                }
                artDs.AcceptChanges();
            }

            switch (this.prolistview)
            {
            case "Img":
                this.rptList1.Visible    = false;
                this.rptList2.DataSource = artDs;
                this.rptList2.DataBind();
                Utils.WriteCookie("wx_article_list_view", "Img", 14400);
                break;

            default:
                this.rptList2.Visible    = false;
                this.rptList1.DataSource = artDs;
                this.rptList1.DataBind();
                Utils.WriteCookie("wx_article_list_view", "Txt", 14400);
                break;
            }
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("wx_article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
                                              _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Ejemplo n.º 23
0
        //数据绑定
        private void RptBind()
        {
            BLL.wx_product_type bll    = new BLL.wx_product_type();
            Model.wx_userweixin weixin = GetWeiXinCode();
            string keywords            = MyCommFun.QueryString("keywords");
            int    pid      = MyCommFun.RequestInt("pid");
            string whereStr = "wid=" + weixin.id;

            if (keywords.Trim().Length > 0)
            {
                whereStr += " and tName like '%" + keywords.Trim() + "%'";
            }
            if (pid > 0)
            {
                whereStr += " and store_id=" + pid;
            }
            DataSet ds = bll.GetList(whereStr);

            if (ds == null || ds.Tables.Count <= 0)
            {
                return;
            }
            DataTable dt = ds.Tables[0];

            if (dt != null)
            {
                DataRow dr;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dr = dt.Rows[i];
                    if (dr["icoPic"] != null && dr["icoPic"].ToString().Trim() != "")
                    {
                        if (dr["icoPic"].ToString().Contains("."))
                        {
                            dr["icoPic"] = "<img  src=\"" + dr["icoPic"].ToString() + "\" class=\"imgico\" />";
                        }
                        else
                        {
                            dr["icoPic"] = "<span  class=\"" + dr["icoPic"].ToString() + "\" />";
                        }
                    }
                    //链接处理,待做
                    if (dr["tUrl"] != null && dr["tUrl"].ToString().Trim() != "")
                    {
                        dr["tUrl"] = "<span class=\"lianjie_wai\">[外]</span>" + " <a href=\"javascript:;\">" + dr["tUrl"] + "</a>";
                    }
                    else
                    {
                        dr["tUrl"] = "<span class=\"lianjie_ben\">[本]</span>" + " <a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/weixin/product/index.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&tid=" + dr["id"] + "</a>";
                    }
                }
            }

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }