예제 #1
0
        protected string QueryCondition()
        {
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" 1=1  ");
            if (strMemShopID != "")
            {
                string str = PubFunction.GetMemListShopAuthority(int.Parse(strMemShopID), "DrawShopID", strSql.ToString());
                strSql.AppendFormat(" and {0} ", str);
            }
            else
            {
                string str = PubFunction.GetMemListShopAuthority(this._UserShopID, "DrawShopID", strSql.ToString());
                strSql.AppendFormat(" and {0} ", str);
            }
            if (this.txtShopSmsAccount.Value.Trim() != "")
            {
                strSql.AppendFormat(" and DrawAccount='{0}'", this.txtShopSmsAccount.Value.Trim());
            }
            if (this.sltCzlx.Value != "")
            {
                strSql.AppendFormat(" and DrawStatus = '{0}'", this.sltCzlx.Value);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat(" and DrawCreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat(" and DrawCreateTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #2
0
        private void GetSysUserList(string strSql)
        {
            SysGroup group  = new SysGroup();
            SysUser  user   = new SysUser();
            int      Counts = this.NetPagerParameter.RecordCount;

            strSql += " and SysShop.ShopType=3  and SysUser.UserShopID = SysShop.ShopID and SysUser.UserGroupID = SysGroup.GroupID ";
            switch (PubFunction.curParameter.istry)
            {
            case 0:
                strSql += "and SysUser.UserID>1";
                break;

            case 2:
                strSql += "and SysUser.UserID>1";
                break;
            }
            if (this._UserGroupID != 1)
            {
                object obj = strSql;
                strSql = string.Concat(new object[]
                {
                    obj,
                    " and ((sysUser.UserID=",
                    this._UserID,
                    ") or (UserGroupID in (select GroupID from SysGroup where ParentGroupID=0 or ParentIDStr like '%/",
                    int.Parse(this.txtUserType.Value),
                    "/%')))"
                });
            }
            else
            {
                object obj = strSql;
                strSql = string.Concat(new object[]
                {
                    obj,
                    " and UserGroupID in (select GroupID from SysGroup where  ParentGroupID=0 or ParentIDStr like '%/",
                    int.Parse(this.txtUserType.Value),
                    "/%' or GroupID=",
                    int.Parse(this.txtUserType.Value),
                    ")"
                });
            }
            DataTable db = user.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[]
            {
                PubFunction.GetMemListShopAuthority(this._UserShopID, "UserShopID", strSql)
            }).Tables[0];

            this.NetPagerParameter.RecordCount    = Counts;
            this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[]
            {
                this.NetPagerParameter.CurrentPageIndex,
                this.NetPagerParameter.PageCount,
                this.NetPagerParameter.RecordCount,
                this.NetPagerParameter.PageSize
            });
            this.gvSysUserList.DataSource = db;
            this.gvSysUserList.DataBind();
            PageBase.BindSerialRepeater(this.gvSysUserList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
        }
예제 #3
0
        private void GetSpecialList()
        {
            Special blls   = new Special();
            string  strSql = string.Empty;

            strSql += "1=1";
            strSql += " and  Special.SpecialUser = SysUser.UserID ";
            strSql  = strSql + "and  SpecialUser="******"SpecialID", strSql)
            }).Tables[0];

            this.NetPagerParameter.RecordCount    = Counts;
            this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[]
            {
                this.NetPagerParameter.CurrentPageIndex,
                this.NetPagerParameter.PageCount,
                this.NetPagerParameter.RecordCount,
                this.NetPagerParameter.PageSize
            });
            this.gvSpecialList.DataSource = dtMem;
            this.gvSpecialList.DataBind();
            PageBase.BindSerialRepeater(this.gvSpecialList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
        }
예제 #4
0
        private void GetMemList(string strSql)
        {
            Chain.BLL.Mem member = new Chain.BLL.Mem();
            int           Counts = this.NetPagerParameter.RecordCount;

            strSql += " and Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID = SysUser.UserID ";
            strSql += " and Mem.MemShopID =SysShopMemLevel.ShopID and SysShopMemLevel.MemLevelID=MemLevel.LevelID ";
            DataTable dtMem = member.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[]
            {
                PubFunction.GetMemListShopAuthority(this._UserShopID, "MemShopID", strSql)
            }).Tables[0];

            this.NetPagerParameter.RecordCount    = Counts;
            this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[]
            {
                this.NetPagerParameter.CurrentPageIndex,
                this.NetPagerParameter.PageCount,
                this.NetPagerParameter.RecordCount,
                this.NetPagerParameter.PageSize
            });
            this.gvMemList.DataSource = dtMem;
            this.gvMemList.DataBind();
            PageBase.BindSerialRepeater(this.gvMemList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
            Chain.BLL.MemCustomField          bllCustom = new Chain.BLL.MemCustomField();
            List <Chain.Model.MemCustomField> fieldlist = bllCustom.GetModelList("CustomType=1 and CustomFieldIsShow=1");

            if (fieldlist.Count > 0)
            {
                StringBuilder strHeader = new StringBuilder();
                StringBuilder strHtml   = new StringBuilder();
                for (int i = 0; i < this.gvMemList.Items.Count; i++)
                {
                    Literal   ltlMemID = (Literal)this.gvMemList.Items[i].FindControl("ltlMemID");
                    Literal   ltlHtml  = (Literal)this.gvMemList.Items[i].FindControl("ltlHtml");
                    int       MemID    = Convert.ToInt32(ltlMemID.Text);
                    DataRow[] drMem    = dtMem.Select(string.Format(" MemID = {0}", MemID));
                    strHtml.Length = 0;
                    foreach (Chain.Model.MemCustomField mdCustomField in fieldlist)
                    {
                        if (i == 0)
                        {
                            strHeader.AppendFormat("<th>{0}</th>", mdCustomField.CustomFieldName);
                        }
                        strHtml.AppendFormat("<td>{0}</td>", drMem[0][mdCustomField.CustomField]);
                    }
                    ltlHtml.Text = strHtml.ToString();
                }
                this.ltlHeader.Text = strHeader.ToString();
            }
        }
예제 #5
0
        protected string QueryCondition()
        {
            string strWhere  = " 1=1 ";
            string strShopID = this.sltShop.Value;

            if (strShopID != "1")
            {
                strWhere += string.Format(" and TemplateShopID in ({0})", this._UserShopID);
            }
            else
            {
                strWhere = strWhere + "and " + PubFunction.GetMemListShopAuthority(this._UserShopID, "TemplateShopID", strWhere);
            }
            return(strWhere);
        }
예제 #6
0
        protected void BtnMemExcel_Click(object sender, EventArgs e)
        {
            Chain.BLL.Mem bllMember = new Chain.BLL.Mem();
            int           Counts    = this.NetPagerParameter.RecordCount;
            string        strSql    = this.QueryCondition();

            strSql += "and Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID = SysUser.UserID";
            strSql += " and Mem.MemShopID =SysShopMemLevel.ShopID and SysShopMemLevel.MemLevelID=MemLevel.LevelID ";
            DataTable db = bllMember.GetListSP(100000, 1, out Counts, new string[]
            {
                PubFunction.GetMemListShopAuthority(this._UserShopID, "MemShopID", strSql)
            }).Tables[0];

            DataExcelInfo.MemReportExcel(db, this._UserName);
        }
예제 #7
0
        protected string QueryCondition()
        {
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" SysShop.ShopID>0 and SysShop.ShopState=0 and SysShop.ShopType=3 ");
            if (strMemShopID != "")
            {
                string strwhere = PubFunction.GetMemListShopAuthority(int.Parse(strMemShopID), "SysShop.ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", strwhere);
            }
            else
            {
                string strwhere = PubFunction.GetMemListShopAuthority(this._UserShopID, "SysShop.ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", strwhere);
            }
            return(strSql.ToString());
        }
예제 #8
0
        protected string QueryCondition()
        {
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" ShopID>1 and ShopType=3 ");
            if (this._UserShopID != 1)
            {
                string str = PubFunction.GetMemListShopAuthority(this._UserShopID, "ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", str);
            }
            else
            {
                string str = PubFunction.GetMemListShopAuthority(this._UserShopID, "ShopID", " 1=1 ");
                strSql.AppendFormat(" and {0} ", str);
            }
            return(strSql.ToString());
        }
예제 #9
0
        protected string QueryCondition()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("1=1  and SysShop.ShopType=3 ");
            if (this.sltIsFinish.Value != "")
            {
                strSql.AppendFormat(" and IsFinish = {0}", this.sltIsFinish.Value);
            }
            if (this.sltShop.Value != "")
            {
                Chain.Model.SysShop shop = new Chain.BLL.SysShop().GetModel(Convert.ToInt32(this.sltShop.Value));
                if (shop.ShopID == 1)
                {
                    strSql.Append("");
                }
                else if (shop.IsAllianceProgram)
                {
                    strSql.AppendFormat(" AND OutShopID IN (SELECT ShopID FROM SysShop WHERE FatherShopID = {0} or ShopID = {1} )", this.sltShop.Value, this.sltShop.Value);
                }
                else
                {
                    strSql.AppendFormat(" and OutShopID = '{0}'", this.sltShop.Value);
                }
            }
            else if (this._UserShopID == 1)
            {
                string str = " and " + PubFunction.GetMemListShopAuthority(this._UserShopID, "OutShopID", strSql.ToString());
                strSql.Append(str);
            }
            else
            {
                strSql.AppendFormat(" AND OutShopID IN (SELECT ShopID FROM SysShop WHERE FatherShopID = {0} or ShopID = {1} )", this._UserShopID, this._UserShopID);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and StartTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and EndTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #10
0
        protected string QueryCondition()
        {
            string        strQueryMem     = this.txtQueryMem.Value;
            string        strMemLevelID   = this.sltMemLevelID.Value;
            string        strMemShopID    = this.sltShop.Value;
            string        strPointSymbols = this.sltPoint.Value;
            string        strPoint        = (this.txtPoint.Value.Trim() != "") ? this.txtPoint.Value.Trim() : "0";
            decimal       intPoint        = decimal.Parse(strPoint);
            StringBuilder strSql          = new StringBuilder();

            strSql.Append("1=1");
            if (strQueryMem != "")
            {
                strSql.AppendFormat("and (MemCard = '{0}' or MemName like '%{0}%' or MemMobile = '{0}' or MemCardNumber = '{0}' )", strQueryMem);
            }
            if (strMemLevelID != "")
            {
                strSql.AppendFormat("and Mem.MemLevelID={0}", int.Parse(strMemLevelID));
            }
            if (strMemShopID != "")
            {
                string strwhere = PubFunction.GetMemListShopAuthority(int.Parse(strMemShopID), "PointShopID", " 1=1 ");
                strSql.AppendFormat(" and {0}", strwhere);
            }
            else
            {
                string strwhere = PubFunction.GetMemListShopAuthority(this._UserShopID, "PointShopID", " 1=1 ");
                strSql.AppendFormat(" and {0}", strwhere);
            }
            if (intPoint != 0m)
            {
                strSql.AppendFormat("and PointNumber" + strPointSymbols + "{0}", intPoint);
            }
            if (this.txtStartTime.Value != "")
            {
                strSql.AppendFormat("and PointCreateTime>='{0}' ", this.txtStartTime.Value);
            }
            if (this.txtEndTime.Value != "")
            {
                strSql.AppendFormat("and PointCreateTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            return(strSql.ToString());
        }
예제 #11
0
        public void CouponGetList()
        {
            Coupon coupon   = new Coupon();
            int    Counts   = this.NetPagerParameter.RecordCount;
            string strWhere = " 1=1 ";

            if (this._UserShopID != 1)
            {
                strWhere = strWhere + " and " + PubFunction.GetMemListShopAuthority(this._UserShopID, "CouponShopID", strWhere);
            }
            DataTable db = coupon.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[]
            {
                strWhere
            }).Tables[0];

            this.NetPagerParameter.RecordCount = Counts;
            this.gvCouponList.DataSource       = db;
            this.gvCouponList.DataBind();
            PageBase.BindSerialRepeater(this.gvCouponList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
        }
예제 #12
0
        private void BindMemExpenseMoney()
        {
            OrderLog bllOrder = new OrderLog();
            string   sbWhere  = this.QueryCondition();

            sbWhere += " and OrderLog.OrderMemID=Mem.MemID";
            if (this.txtStartTime.Value != "")
            {
                this.timeStart = DateTime.Parse(this.txtStartTime.Value);
            }
            object obj = sbWhere;

            sbWhere = string.Concat(new object[]
            {
                obj,
                " and OrderLog.OrderCreateTime>='",
                this.timeStart,
                "'"
            });
            if (this.txtEndTime.Value != "")
            {
                this.timeEnd = Convert.ToDateTime(PubFunction.TimeEndDay(this.txtEndTime.Value));
            }
            obj     = sbWhere;
            sbWhere = string.Concat(new object[]
            {
                obj,
                " and OrderLog.OrderCreateTime<='",
                this.timeEnd,
                "'"
            });
            if (this._UserShopID != 1)
            {
                sbWhere = PubFunction.GetMemListShopAuthority(this._UserShopID, "MemShopID", sbWhere);
            }
            DataTable dtMem = bllOrder.GetMemExpenseMoney(sbWhere).Tables[0];

            this.lblTotalNumber.Text = dtMem.Rows[0]["TotalNumber"].ToString();
            this.lblTotalMoney.Text  = decimal.Parse(dtMem.Rows[0]["TotalMoney"].ToString()).ToString("0.00");
        }
예제 #13
0
        protected string QueryCondition()
        {
            string        strQueryMem  = this.txtQueryMem.Value;
            string        strMemShopID = this.sltShop.Value;
            StringBuilder strSql       = new StringBuilder();

            strSql.Append(" 1=1 and MemID>0 and Mem.MemConsumeCount>0");
            if (strQueryMem != "")
            {
                strSql.AppendFormat(" and (MemCard ='{0}' or MemName like '%{0}%' or MemMobile='{0}' or MemCardNumber = '{0}' )", strQueryMem);
            }
            if (strMemShopID != "")
            {
                string strwhere = PubFunction.GetMemListShopAuthority(int.Parse(strMemShopID), "MemShopID", " 1=1 ");
                strSql.AppendFormat(" and {0}", strwhere);
            }
            else
            {
                string strwhere = PubFunction.GetMemListShopAuthority(this._UserShopID, "MemShopID", " 1=1 ");
                strSql.AppendFormat(" and {0}", strwhere);
            }
            return(strSql.ToString());
        }