예제 #1
0
 private void BindUserDegree(int sid)
 {
     BLL.wx_ucard_udegree degreeBll = new wx_ucard_udegree();
     IList<Model.wx_ucard_udegree> degreelist = degreeBll.GetModelList("sid="+sid);
     cbluserDegree.DataValueField = "degreeNum";
     cbluserDegree.DataTextField = "callName";
     cbluserDegree.DataSource = degreelist;
     cbluserDegree.DataBind();
     cbluserDegree.Items.Insert(0,new ListItem("全部会员","0"));
 }
예제 #2
0
        private void ShowInfo(int id)
        {
            hidid.Value = id.ToString();
            Model.wx_ucard_users user = uBll.GetModel(id);
            txtrealName.Text = user.realName;
            lblcardNo.Text = user.cardNo;
            lblopenid.Text = user.openid;
            //等级
            BLL.wx_ucard_udegree degreeBll = new wx_ucard_udegree();
            IList<Model.wx_ucard_udegree> degreelist = degreeBll.GetModelList("sid=" + sid);

            int degreeNum = 0;
            string jibie = "";
            jibie = BLL.wx_ucard_fun.userDegree(id, MyCommFun.Obj2Int(user.ttScore), jibie, out degreeNum);

            lblDegree.Text = jibie;

            rblSex.SelectedValue = user.sex == null ? "3" : user.sex.Value.ToString();
            txtwxName.Text = user.wxName;
            txtage.Text = user.age==null?"0":user.age.ToString();
            txtttScore.Text = MyCommFun.ObjToStr(user.ttScore);
            txtqdScore.Text = MyCommFun.ObjToStr(user.qdScore);
            txtconsumeScore.Text = MyCommFun.ObjToStr(user.consumeScore);
            txtconsumeMoney.Text = MyCommFun.ObjToStr(user.consumeMoney);
            txtregTime.Text = MyCommFun.Obj2DateTime(user.regTime).ToString("yyyy-MM-dd HH:mm:ss");
            txtendDate.Text = MyCommFun.Obj2DateTime(user.endDate).ToString("yyyy-MM-dd HH:mm:ss");
            txtmobile.Text = MyCommFun.ObjToStr(user.mobile);
            txtaddr.Text = MyCommFun.ObjToStr(user.addr);
        }
예제 #3
0
        /// <summary>
        /// 新增时候,优惠券立即发放(后台不需要做,在微信用户进去优惠券时候再取数据)
        /// </summary>
        /// <param name="userType"></param>
        private void AddPersonYqh(int userType)
        {
            BLL.wx_ucard_users userBll = new wx_ucard_users();
            IList<Model.wx_ucard_users> userlist = new List<Model.wx_ucard_users>();
            if (userType == 0)
            { //全部人员
                userlist = userBll.GetModelList("sid=" + sid);
            }
            else if (userType > 0 && userType < 1000)
            { //按照等级来取人员
                BLL.wx_ucard_udegree degreeBll = new wx_ucard_udegree();
                IList<Model.wx_ucard_udegree> degreelist = degreeBll.GetModelList("degreeNum=" + userType+" and sid="+sid);
                if (degreelist == null || degreelist.Count <= 0)
                {
                    return;
                }
                Model.wx_ucard_udegree degree = degreelist[0];
                userlist = userBll.GetModelList("ttScore<=" + degree.score_max + "  and ttScore>=" + degree.score_min+" and sid="+sid);
            }
            else if (userType > 1000 && userType < 2000)
            {
                //按照开卡和消费情况来取人员

            }
            else if (userType > 2000)
            {
                //按照消费情况来取人员
                BLL.wx_ucard_users_consumeinfo cBll = new wx_ucard_users_consumeinfo();
                IList<Model.wx_ucard_users_consumeinfo> conlist = new List<Model.wx_ucard_users_consumeinfo>();
                if (userType == 2001)
                {  //单次消费超过x元
                    float dcje = MyCommFun.Str2Float(txtdcje.Text);
                    userlist = userBll.GetModelList("sid=" + sid + " and id in (select distinct uid from  wx_ucard_users_consumeinfo where sId=" + sid + " and consumeMoney>=" + dcje + ")");
                }
                else if (userType == 2002)
                {
                    //累计消费超过x元
                    float ljje = MyCommFun.Str2Float(txtljje.Text);
                    userlist = userBll.GetModelList("sid=" + sid + " and id in (select uid from wx_ucard_users_consumeinfo   group by uid having sum(consumeMoney)>" + ljje + ")");
                }
            }
        }
예제 #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();

                }

            }
        }