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(); } }
private void GetGoodsList(string strSql) { Chain.BLL.Goods bllGoods = new Chain.BLL.Goods(); int Counts = this.NetPagerParameter.RecordCount; strSql = strSql + " and Goods.GoodsClassID = GoodsClass.ClassID and Goods.GoodsID = GoodsNumber.GoodsID and GoodsNumber.ShopID=" + this.sltShop.Value; DataTable dtGoods = bllGoods.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[] { 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.gvGoodsList.DataSource = dtGoods; this.gvGoodsList.DataBind(); PageBase.BindSerialRepeater(this.gvGoodsList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1)); Chain.BLL.MemCustomField bllCustom = new Chain.BLL.MemCustomField(); List <Chain.Model.MemCustomField> fieldlist = bllCustom.GetModelList("CustomType=2 and CustomFieldIsShow=1"); if (fieldlist.Count > 0) { StringBuilder strHeader = new StringBuilder(); StringBuilder strHtml = new StringBuilder(); for (int i = 0; i < this.gvGoodsList.Items.Count; i++) { Literal ltlGoodsID = (Literal)this.gvGoodsList.Items[i].FindControl("ltlGoodsID"); Literal ltlHtml = (Literal)this.gvGoodsList.Items[i].FindControl("ltlHtml"); int GoodsID = Convert.ToInt32(ltlGoodsID.Text); DataRow[] drGoods = dtGoods.Select(string.Format(" GoodsID = {0}", GoodsID)); 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>", drGoods[0][mdCustomField.CustomField]); } ltlHtml.Text = strHtml.ToString(); } this.ltlHeader.Text = strHeader.ToString(); } }
private void Get_ParameterList(DataTable dtMem) { try { Chain.BLL.MemCustomField bllCustom = new Chain.BLL.MemCustomField(); List <Chain.Model.MemCustomField> fieldlist = bllCustom.GetModelList(" CustomType=1 "); this.GetCustomFields(fieldlist); this.gvErrorMem.DataSource = dtMem; this.gvErrorMem.DataBind(); } catch { base.OutputWarn("Excel表中数据格式有严重错误,请改正数据再验证。"); } }
private void Get_ParameterList(DataTable dtGoods) { try { Chain.BLL.MemCustomField bllCustom = new Chain.BLL.MemCustomField(); List <Chain.Model.MemCustomField> fieldlist = bllCustom.GetModelList(" CustomType=2 "); this.GetCustomFields(fieldlist); if (this.GridView1.Visible) { this.GridView1.DataSource = dtGoods; this.GridView1.DataBind(); } else { this.gvErrorGoods.DataSource = dtGoods; this.gvErrorGoods.DataBind(); } } catch { base.OutputWarn("Excel表中数据格式有严重错误,请改正数据再验证。"); } }