private void BindData() { XiHuan_UserGoodsSearchFilter f = new XiHuan_UserGoodsSearchFilter(); f.SelectFileds = " Id,Name,DefaultPhoto,GoodState,ViewCount,CreateDate,DetailUrl,IsChecked "; f.OwnerId = CurrentUserId; f.GoodsName = txtGoodName.Text; f.GoodsTypeId = CommonMethod.ConvertToInt(ddlGoodType.SelectedValue, int.MaxValue); f.GoodsSceondTypeId = CommonMethod.ConvertToInt(Request["ddlGoodChildType"], int.MaxValue); f.GoodsState = CommonMethod.ConvertToInt(ddlGoodState.SelectedValue, int.MaxValue); f.IsHavePhoto = CommonMethod.ConvertToInt(ddlImage.SelectedValue, int.MaxValue); if (!DateTime.TryParse(txtDateBegin.Value.Trim(), out f.CreateDateBegin)) { f.CreateDateBegin = DateTime.MinValue; } if (!DateTime.TryParse(txtDateEnd.Value.Trim(), out f.CreateDateEnd)) { f.CreateDateEnd = DateTime.MaxValue; } DataTable dt = XiHuan_UserGoodsFacade.SearchGoods(f); PagedDataSource pds = new PagedDataSource(); pds.AllowPaging = true; pds.PageSize = 10; pds.DataSource = dt.DefaultView; PageControl1.DataSource = pds; rptGoodsList.DataSource = pds; rptGoodsList.DataBind(); }
private void BindData() { XiHuan_UserGoodsSearchFilter f = new XiHuan_UserGoodsSearchFilter(); f.SelectFileds = @" g.Id,g.Name,g.DefaultPhoto,g.ViewCount,g.CreateDate,g.OwnerId,g.OwnerName, g.NewDeep,g.OnlyCityChange,g.OnlySchoolChange,g.HopeToChangeTypeId,g.HopeToChangeChildTypeId, g.HopeToChangeDesc,g.ProvinceName,g.CityName,g.AreaName,g.SchoolName,g.GoodState,g.DetailUrl,g.IsChecked"; f.GoodsName = txtGoodName.Text; f.GoodsTypeId = CommonMethod.ConvertToInt(ddlGoodType.SelectedValue, int.MaxValue); f.GoodsSceondTypeId = CommonMethod.ConvertToInt(ddlGoodChildType.SelectedValue, int.MaxValue); f.ProvinceId = CommonMethod.ConvertToInt(ddlProvince.SelectedValue, int.MaxValue); f.CityId = CommonMethod.ConvertToInt(ddlCity.SelectedValue, int.MaxValue); f.AreaId = CommonMethod.ConvertToInt(ddlArea.SelectedValue, int.MaxValue); f.SchooId = CommonMethod.ConvertToInt(ddlSchool.SelectedValue, int.MaxValue); f.NewDeep = CommonMethod.ConvertToInt(ddlNewOldDeep.SelectedValue, int.MaxValue); f.IsHavePhoto = chkHavePhoto.Checked ? 1 : int.MaxValue; string value = ddlTime.SelectedValue.Trim(); if (value.Trim().Length > 0) { DateTime dtbegin = DateTime.MinValue; if (value.Equals("0")) { dtbegin = DateTime.Now.AddDays(-7); } if (value.Equals("1")) { dtbegin = DateTime.Now.AddMonths(-1); } if (value.Equals("2")) { dtbegin = DateTime.Now.AddMonths(-3); } f.CreateDateBegin = dtbegin; f.CreateDateEnd = DateTime.Now; } f.IsChecked = 1; if (chkShow.Checked) { f.GoodsStateNotIn = XiHuan_UserGoodsFacade.GoodsState.交换中.ToString("d") + "," + XiHuan_UserGoodsFacade.GoodsState.交换成功.ToString("d"); } f.OrderByParam = ddlOrderBy.SelectedValue + "desc "; f.OwnerId = CommonMethod.ConvertToInt(Request["ownerid"], int.MaxValue); f.OwnerName = txtOwnerName.Text; f.PageIndex = PageBar1.PageIndex; int rowcount; DataTable dt = XiHuan_UserGoodsFacade.SearchGoods(f, out rowcount); rptGoodsList.DataSource = dt; rptGoodsList.DataBind(); PageBar1.RecordCount = rowcount; PageBar1.Draw(); }
protected override void Page_PreLoad() { Header.Title = GoodDetail.Name + "--" + SystemConfigFacade.Instance().WebSiteTitle; GenerateMeta("Content-Type", string.Empty, "text/html;charset=GB2312", 0); //开启IE8兼容模式 GenerateMeta("X-UA-Compatible", string.Empty, "IE=EmulateIE7", 1); GenerateMeta(string.Empty, "keywords", GoodDetail.Name + "," + XiHuan_UserGoodsFacade.GetTypeNameById(GoodDetail.TypeId.ToString()) + "," + XiHuan_UserGoodsFacade.GetSecondTypeNameById(GoodDetail.TypeId.ToString(), GoodDetail.ChildId.ToString()), 2); GenerateMeta(string.Empty, "description", GoodDetail.Name + "," + SystemConfigFacade.Instance().WebSiteDescription, 3); GenerateMeta(string.Empty, "Robots", "All", 4); GenerateMeta(string.Empty, "GOOGLEBOT", "All", 5); GenerateMeta(string.Empty, "verify-v1", "2WI+gttAG3Vgo7KoaYDT/7Fb1mXT6UGwvFpYYrVkUkU=", 6); GenerateMeta(string.Empty, "y_key", "f00a394915068b18", 7); HtmlLink maincss = new HtmlLink(); maincss.Attributes["type"] = "text/css"; maincss.Attributes["href"] = SrcRootPath + "App_Themes/Default/style.css"; maincss.Attributes["rel"] = "stylesheet"; Header.Controls.AddAt(8, maincss); HtmlLink ymcss = new HtmlLink(); ymcss.Attributes["type"] = "text/css"; ymcss.Attributes["href"] = SrcRootPath + "Js/ymPromot/skin/qq/ymPrompt.css"; ymcss.Attributes["rel"] = "stylesheet"; Header.Controls.AddAt(9, ymcss); int i = 9; if (GoodDetail.DefaultPhoto != null && GoodDetail.DefaultPhoto.Trim().Length > 0 && !GoodDetail.DefaultPhoto.Trim().Equals("images/none.jpg")) { HtmlLink highslidecss = new HtmlLink(); highslidecss.Attributes["type"] = "text/css"; highslidecss.Attributes["href"] = SrcRootPath + "Js/highslide/highslide.css"; highslidecss.Attributes["rel"] = "stylesheet"; Header.Controls.AddAt(10, highslidecss); i = 10; } GenerateScript(SrcRootPath + "Js/ymPromot/ymPrompt.js", i + 1); GenerateScript(SrcRootPath + "Js/common.js", i + 2); GenerateScript("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js", i + 3); HtmlLink favicon = new HtmlLink(); favicon.Attributes["rel"] = "shortcut icon'"; favicon.Attributes["href"] = SrcRootPath + "images/favicon.ico"; Header.Controls.AddAt(i + 4, favicon); }
protected void Page_Load(object sender, EventArgs e) { if (!IsUserAlreadyLogin) { MemberCenterPageRedirect("", "goodlist.aspx"); } if (!IsPostBack) { DataTable dt = XiHuan_GoodsTypeFacade.GetInstance().GetGoodsParentType(); CommonMethod.BindDrop(ddlGoodType, dt, "TypeName", "Id"); ddlGoodType.Items.Insert(0, new ListItem("不限", "")); CommonMethod.BindDrop(ddlGoodState, XiHuan_UserGoodsFacade.GetGoodsState(), "Text", "Value"); ddlGoodState.Items.Insert(0, new ListItem("不限", "")); BindData(); } }
private void BindGoods() { XiHuan_UserGoodsSearchFilter f = new XiHuan_UserGoodsSearchFilter(); int rowcount; f.SelectFileds = "g.Id,Name,OwnerName,OwnerId,DefaultPhoto,GoodState,ViewCount,CreateDate,DetailUrl,IsTJ,IsChecked "; if (txtGoodName.Text.Trim().Length > 0) { f.GoodsName = txtGoodName.Text; } f.PageIndex = PageBar1.PageIndex; f.IsChecked = chkOnlyShow.Checked ? 0 : int.MinValue; DataTable dt = XiHuan_UserGoodsFacade.SearchGoods(f, out rowcount); rptGoodsList.DataSource = dt; rptGoodsList.DataBind(); PageBar1.RecordCount = rowcount; PageBar1.Draw(); }
private void BindUserGoods() { XiHuan_UserGoodsSearchFilter f = new XiHuan_UserGoodsSearchFilter(); f.SelectFileds = " Id,DefaultPhoto,Name,GoodState,CreateDate,DetailUrl "; f.OwnerId = CurrentUserId; f.GoodsStates = XiHuan_UserGoodsFacade.GoodsState.新登记.ToString("d") + "," + XiHuan_UserGoodsFacade.GoodsState.考虑中.ToString("d"); f.IsChecked = 1; DataTable dt = XiHuan_UserGoodsFacade.SearchGoods(f); if (dt != null && dt.Rows.Count > 0) { rptGoodsList.DataSource = dt; rptGoodsList.DataBind(); } else { rbtMethodGoods.Enabled = false; rbtMethodMoney.Checked = true; rbtMethodGoods.ToolTip = "您目前还没有登记过换品,您可以去登记换品或选择用Money交换 ^_^!"; ExecStartupScript("reconfirm();"); } }