Пример #1
0
        /// <summary>
        /// 处理循环处理标签
        /// </summary>
        /// <param name="vipSearchInfo"></param>
        /// <returns></returns>
        public string SetTagsSqlAdd(VipSearchEntity vipSearchInfo)
        {
            string sql = string.Empty;

            sql  = " select * into #vip From ( select VIPID,VipCode,VipLevel,VipName,Phone,WeiXin,Integration,LastUpdateTime,PurchaseAmount,PurchaseCount,weiXinUserId,isDelete,VipSourceId,Status,Gender,ClientID  From vip  ";
            sql += " WHERE IsDelete = '0' and ClientID = '" + this.CurrentUserInfo.CurrentUser.customer_id + "' ) x ";
            if (vipSearchInfo == null || vipSearchInfo.Tags == null || vipSearchInfo.Tags.Length < 5)
            {
            }
            else
            {
                string[] tagsArr = vipSearchInfo.Tags.Split(';');
                foreach (string tag in tagsArr)
                {
                    if (!tag.Trim().Equals(""))
                    {
                        string[] tagArr      = tag.Split(',');
                        string   tagId       = tagArr[0];
                        string   strlinkType = tagArr[1];
                        if (!tagId.Equals(""))
                        {
                            JIT.CPOS.BS.DataAccess.TagsDAO server   = new TagsDAO(this.CurrentUserInfo);
                            JIT.CPOS.BS.Entity.TagsEntity  tagsInfo = new TagsEntity();
                            tagsInfo = server.GetByID(tagId);
                            if (tagsInfo != null && tagsInfo.TagsFormula != null && !tagsInfo.TagsFormula.Equals(""))
                            {
                                switch (strlinkType)
                                {
                                case "1":
                                    sql += " and " + tagsInfo.TagsFormula.ToString();
                                    break;

                                case "2":
                                    sql += " or " + tagsInfo.TagsFormula.ToString();
                                    break;

                                case "3":
                                    sql += " where " + tagsInfo.TagsFormula.ToString();
                                    break;

                                default:
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            //sql += " order by LastUpdateTime desc ";
            sql += "  ;";
            return(sql);
        }
Пример #2
0
        /// <summary>
        /// 处理循环处理标签
        /// </summary>
        /// <param name="vipSearchInfo"></param>
        /// <returns></returns>
        public string SetTagsSql(VipSearchEntity vipSearchInfo)
        {
            string sql = string.Empty;

            sql = " select * into #vip From vip  ";
            if (vipSearchInfo == null || vipSearchInfo.Tags == null || vipSearchInfo.Tags.Length < 5)
            {
            }
            else
            {
                string[] tagsArr = vipSearchInfo.Tags.Split(';');
                foreach (string tag in tagsArr)
                {
                    if (!tag.Trim().Equals(""))
                    {
                        string[] tagArr      = tag.Split(',');
                        string   tagId       = tagArr[0];
                        string   strlinkType = tagArr[1];
                        if (!tagId.Equals(""))
                        {
                            JIT.CPOS.BS.DataAccess.TagsDAO server   = new TagsDAO(this.CurrentUserInfo);
                            JIT.CPOS.BS.Entity.TagsEntity  tagsInfo = new TagsEntity();
                            tagsInfo = server.GetByID(tagId);
                            if (tagsInfo != null && tagsInfo.TagsFormula != null && !tagsInfo.TagsFormula.Equals(""))
                            {
                                switch (strlinkType)
                                {
                                case "1":
                                    sql += " and " + tagsInfo.TagsFormula.ToString();
                                    break;

                                case "2":
                                    sql += " or " + tagsInfo.TagsFormula.ToString();
                                    break;

                                case "3":
                                    sql += " where " + tagsInfo.TagsFormula.ToString();
                                    break;

                                default:
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            sql += " ;";
            return(sql);
        }