示例#1
0
        protected void SetDegree()
        {
            BLL.wx_ucard_udegree   dBll  = new wx_ucard_udegree();
            Model.wx_ucard_udegree model = new Model.wx_ucard_udegree();
            dBll.DeleteStoreDegree(sid);
            TextBox txtLevelName;
            TextBox txtLevelMin;
            TextBox txtLevelMax;
            int     dNum = 1;

            for (int i = 1; i <= 8; i++)
            {
                txtLevelName = this.FindControl("txtLevel" + i + "Name") as TextBox;
                txtLevelMin  = this.FindControl("txtLevel" + i + "Min") as TextBox;
                txtLevelMax  = this.FindControl("txtLevel" + i + "Max") as TextBox;
                if (isNullOrEmoty(txtLevelName) && txtNumRight(txtLevelMin) && txtNumRight(txtLevelMax))
                {
                    model.sId       = sid;
                    model.degreeNum = dNum;
                    model.callName  = txtLevelName.Text.Trim();
                    model.score_min = int.Parse(txtLevelMin.Text);
                    model.score_max = int.Parse(txtLevelMax.Text);
                    dBll.Add(model);
                    dNum++;
                }
            }
        }
示例#2
0
 protected void SetDegree()
 {
     BLL.wx_ucard_udegree dBll = new wx_ucard_udegree();
     Model.wx_ucard_udegree model= new Model.wx_ucard_udegree();
     dBll.DeleteStoreDegree(sid);
     TextBox txtLevelName;
     TextBox txtLevelMin;
     TextBox txtLevelMax;
     int dNum = 1;
     for (int i = 1; i <= 8; i++)
     {
         txtLevelName = this.FindControl("txtLevel" + i + "Name") as TextBox;
         txtLevelMin = this.FindControl("txtLevel" + i + "Min") as TextBox;
         txtLevelMax = this.FindControl("txtLevel" + i + "Max") as TextBox;
         if (isNullOrEmoty(txtLevelName) && txtNumRight(txtLevelMin) && txtNumRight(txtLevelMax))
         {
             model.sId = sid;
             model.degreeNum = dNum;
             model.callName = txtLevelName.Text.Trim();
             model.score_min = int.Parse(txtLevelMin.Text);
             model.score_max = int.Parse(txtLevelMax.Text);
             dBll.Add(model);
             dNum++;
         }
     }
 }
        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();
                   
                }

            }

        }
示例#4
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 + ")");
                }
            }

        }
示例#5
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();
                }
            }
        }