Example #1
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();
            }
        }
Example #2
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);
        }
Example #3
0
        private void BindMemInfo(int MemID)
        {
            Chain.BLL.Mem bllMem = new Chain.BLL.Mem();
            int           counts = 0;
            string        strSql = " Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID=SysUser.UserID and Mem.MemID=" + MemID;
            DataTable     dtMem  = bllMem.GetListSP(1, 1, out counts, new string[]
            {
                strSql.ToString()
            }).Tables[0];

            if (dtMem.Rows.Count > 0)
            {
                this.spMemCard.InnerHtml       = dtMem.Rows[0]["MemCard"].ToString();
                this.spMemMoney.InnerHtml      = decimal.Parse(dtMem.Rows[0]["MemMoney"].ToString()).ToString("#0.00");
                this.spMemPoint.InnerHtml      = decimal.Parse(dtMem.Rows[0]["MemPoint"].ToString()).ToString("#0");
                this.spLevelName.InnerHtml     = dtMem.Rows[0]["LevelName"].ToString();
                this.spMemName.InnerHtml       = ((dtMem.Rows[0]["MemName"].ToString() == "") ? "&nbsp;" : dtMem.Rows[0]["MemName"].ToString());
                this.spMemStatus.InnerHtml     = this.GetMemState(int.Parse(dtMem.Rows[0]["MemState"].ToString()));
                this.spShopName.InnerHtml      = dtMem.Rows[0]["ShopName"].ToString();
                this.spIdentityCard.InnerHtml  = ((dtMem.Rows[0]["MemIdentityCard"].ToString() == "") ? "无" : dtMem.Rows[0]["MemIdentityCard"].ToString());
                this.spEmail.InnerHtml         = ((dtMem.Rows[0]["MemEmail"].ToString() == "") ? "无" : dtMem.Rows[0]["MemEmail"].ToString());
                this.spAddress.InnerHtml       = this.GetMemAddress(dtMem.Rows[0]["MemProvinceName"].ToString(), dtMem.Rows[0]["MemCityName"].ToString(), dtMem.Rows[0]["MemCountyName"].ToString(), dtMem.Rows[0]["MemVillageName"].ToString(), dtMem.Rows[0]["MemAddress"].ToString());
                this.spMobile.InnerHtml        = dtMem.Rows[0]["MemMobile"].ToString();
                this.spBirthday.InnerHtml      = DateTime.Parse(dtMem.Rows[0]["MemBirthday"].ToString()).ToString("yyyy-MM-dd");
                this.spCardNumber.InnerHtml    = ((dtMem.Rows[0]["MemCardNumber"].ToString() == "") ? "无" : dtMem.Rows[0]["MemCardNumber"].ToString());
                this.spUserName.InnerHtml      = dtMem.Rows[0]["UserName"].ToString();
                this.spRecommendCard.InnerHtml = ((dtMem.Rows[0]["MemRecommendID"].ToString() != "0") ? this.GetRecommendCard(int.Parse(dtMem.Rows[0]["MemRecommendID"].ToString())) : "无");
                this.spCreateTime.InnerHtml    = DateTime.Parse(dtMem.Rows[0]["MemCreateTime"].ToString()).ToString("yyyy-MM-dd");
                this.spPastTime.InnerHtml      = DateTime.Parse(dtMem.Rows[0]["MemPastTime"].ToString()).ToString("yyyy-MM-dd");
                if (dtMem.Rows[0]["MemPhoto"].ToString() != "")
                {
                    this.imgPhoto.Src = dtMem.Rows[0]["MemPhoto"].ToString();
                }
                else
                {
                    this.imgPhoto.Src = "images/headimg.jpg";
                }
            }
        }