private void BindData() { PawnProductModel model = bll.GetModel(PawnProductID); MemberInfo user = MemberInfo.GetFullInfo(model.UserID); if (model.Status != (int)PawnProductStatus.冻结) { Image_Medium.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.MediumImage); Image_Small.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.SmallImage); Literal_ProductName.Text = model.PawnProductName; Literal_Price.Text = model.SellingPrice.ToString("0.00"); Literal_UserID.Text = model.UserID; Literal_Brief.Text = model.Brief; Literal_UserID2.Text = user.UserId; string UserPhone = String.Empty, Address = String.Empty; switch (user.UserType) { case MemberType.Personal: PersonMemberInfo puser = (PersonMemberInfo)user; UserPhone = puser.Mobile == String.Empty ? puser.Telephone : puser.Mobile; Address = String.Empty; break; case MemberType.Famly: FamlyMemberInfo fuser = (FamlyMemberInfo)user; UserPhone = fuser.Mobile == String.Empty ? fuser.Telephone : fuser.Mobile; Address = fuser.Address; break; case MemberType.Company: CompanyMemberInfo cuser = (CompanyMemberInfo)user; UserPhone = cuser.Mobile == String.Empty ? cuser.Telephone : cuser.Mobile; Address = cuser.Address; break; case MemberType.School: SchoolMemberInfo suser = (SchoolMemberInfo)user; UserPhone = suser.Mobile == String.Empty ? suser.Telephone : suser.Mobile; Address = suser.Address; break; default: UserPhone = String.Empty; Address = String.Empty; break; } Literal_Phone.Text = UserPhone; Literal_Address.Text = Address; Repeater_Comment.DataSource = CmtBll.GetList(AppType.MagicWorld, PawnProductID); Repeater_Comment.DataBind(); } else { Response.End(); } }
private void BindData(int PageIndex) { DataTable dt = new DataTable(); int RecordCount = 0; if (CategoryID == 0) { dt = bll.GetList(PageIndex, AspNetPager.PageSize, " and starttime>getdate() and status=" + (int)AuctionProductStatus.审核通过, " auctionid desc", out RecordCount); } else { MagicCategoryModel cate = new MagicCategoryBll().GetModel(CategoryID); if (cate != null) { dt = bll.GetList(PageIndex, AspNetPager.PageSize, " and starttime>getdate() and catepath+'/' like '" + cate.CategoryPath + "/%' and status=" + (int)AuctionProductStatus.审核通过, " auctionid desc", out RecordCount); } else { Response.End(); } } foreach (DataRow row in dt.Rows) { row["mediumimage"] = MagicWorldImageRule.GetMainImageUrl(row["mediumimage"].ToString()); } Repeater_ProductList.DataSource = dt; Repeater_ProductList.DataBind(); AspNetPager.RecordCount = RecordCount; }
private void BindData() { PawnProductModel model = bll.GetModel(PawnProductID); TextBox_ProductName.Text = model.PawnProductName; TextBox_PawnPrice.Text = model.PawnPrice.ToString(); TextBox_SellingPrice.Text = model.SellingPrice.ToString(); TextBox_Brief.Text = model.Brief; TextBox_Count.Text = model.Stock.ToString(); //TextBox_Keyword.Text = model.Keywords; Image_ProductImage.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.MediumImage); }
private void BindData(int PageIndex) { int RecordCount = 0; DataTable dt = bll.GetList(PageIndex, AspNetPager_Sales.PageSize, " and status=" + (int)PawnProductStatus.已收当, out RecordCount); foreach (DataRow row in dt.Rows) { row["mediumimage"] = MagicWorldImageRule.GetMainImageUrl(Convert.ToString(row["mediumimage"])); row["smallimage"] = MagicWorldImageRule.GetMainImageUrl(Convert.ToString(row["smallimage"])); } Repeater_PawnProduct.DataSource = dt; Repeater_PawnProduct.DataBind(); AspNetPager_Sales.RecordCount = RecordCount; }
private void BindData() { RentProductModel rent = bll.GetModel(RentID); if (CategoryID == -1) { CategoryID = rent.CategoryID; } MagicCategoryModel Cate = new MagicCategoryBll().GetModel(CategoryID); Label_Category.Text = Cate.CategoryName; Hidden_CategoryPath.Value = Cate.CategoryPath; TextBox_RentName.Text = rent.RentName; TextBox_RentPrice.Text = rent.RentPrice.ToString(); TextBox_MaxRentDays.Text = rent.MaxRentTime.ToString(); TextBox_Stock.Text = rent.Stock.ToString(); TextBox_Keywords.Text = rent.Keywords; TextBox_Brief.Text = rent.Brief; Image_MainImage.ImageUrl = MagicWorldImageRule.GetMainImageUrl(rent.SmallImage); }
private void BindData() { RentProductModel model = bll.GetModel(RentID); if (model == null) { Response.End(); } MagicCategoryModel cate = new MagicCategoryBll().GetModel(model.CategoryID); Image_Big.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.MediumImage); Image_Small.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.SmallImage); Literal_ProductName.Text = model.RentName; Literal_Category.Text = cate.CategoryName; Literal_RentPrice.Text = model.RentPrice.ToString("0.00"); Literal_Pledge.Text = model.CashPledge.ToString("0.00"); Literal_Brief.Text = model.Brief; Repeater_Comment.DataSource = new CommentBll().GetList(AppType.MagicWorld, RentID); Repeater_Comment.DataBind(); }
private void BindData() { DemandProductModel model = bll.GetModel(DemandID); MemberInfo user = MemberInfo.GetFullInfo(model.UserID); Image_Small.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.SmallImage); Image_Medium.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.MediumImage); Literal_ProductName.Text = model.DemandName; Literal_Count.Text = model.Count.ToString(); Literal_Price.Text = model.Price.ToString("0.00"); Literal_UsageCondition.Text = Enum.GetName(typeof(SecondhandProductUsageCondition), model.UsageCondition); Literal_Brief.Text = model.Brief; Literal_UserID.Text = user.UserId; Literal_Level.Text = user.UserLevel.ToString(); Literal_Phone.Text = String.IsNullOrEmpty(model.Phone) ? model.CellPhone : model.Phone; Literal_Region.Text = String.IsNullOrEmpty(model.Region) ? String.Empty : model.Region.Split(' ')[0]; Repeater_Comment.DataSource = CmtBll.GetList(AppType.MagicWorld, DemandID); Repeater_Comment.DataBind(); }
public XmlDocument GetData(NameValueCollection TagParameter) { XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?><tag />"); XmlNode rootNode = xdoc.SelectSingleNode("/tag"); XmlNode PawnNode = XmlUtility.AddNewNode(rootNode, "pawn", null); DataTable dt1 = new PawnProductBll().GetNewestList(2, PawnProductStatus.已收当); foreach (DataRow row in dt1.Rows) { XmlNode PawnProductNode = XmlUtility.AddNewNode(PawnNode, "pawnproduct", null); XmlUtility.AddNewNode(PawnProductNode, "pid", row["pawnproductid"].ToString()); XmlUtility.AddNewNode(PawnProductNode, "productname", row["pawnproductname"].ToString()); XmlUtility.AddNewNode(PawnProductNode, "image", MagicWorldImageRule.GetMainImageUrl(row["smallimage"].ToString())); XmlUtility.AddNewNode(PawnProductNode, "price", row["sellingprice"].ToString()); XmlUtility.AddNewNode(PawnProductNode, "deadtime", Convert.ToDateTime(row["deadtime"]).ToString("yyyy-MM-dd")); } XmlNode RentNode = XmlUtility.AddNewNode(rootNode, "rent", null); DataTable dt2 = new RentProductBll().GetNewestList(10); foreach (DataRow row in dt2.Rows) { XmlNode RentProductNode = XmlUtility.AddNewNode(RentNode, "rentlist", null); XmlUtility.AddNewNode(RentProductNode, "rentid", row["rentid"].ToString()); XmlUtility.AddNewNode(RentProductNode, "rentname", row["rentname"].ToString()); XmlUtility.AddNewNode(RentProductNode, "createtime", Convert.ToDateTime(row["createtime"]).ToString("yyyy年MM月dd日")); } return(xdoc); }
private void BindData() { AuctionProductModel model = bll.GetModel(AuctionID); DataTable dt = new DataTable(); dt.Columns.Add("price"); foreach (string s in model.AddPrices.Split(',')) { DataRow row = dt.NewRow(); row["price"] = decimal.Parse(s); dt.Rows.Add(row); } dt.DefaultView.Sort = "price asc"; Repeater_AddPrices.DataSource = dt; Repeater_AddPrices.DataBind(); Image_Large.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.MediumImage); Image_Medium.ImageUrl = MagicWorldImageRule.GetMainImageUrl(model.SmallImage); Literal_ProductName.Text = model.ProductName; Literal_StartPrice.Text = model.StartPrice.ToString("0.00"); Literal_CurrentPrice.Text = model.CurPrice.ToString("0.00");; Literal_MinAddPrice.Text = dt.Rows[0]["price"].ToString(); Literal_MaxAddPrice.Text = dt.Rows[dt.Rows.Count - 1]["price"].ToString(); Literal_StartTime.Text = model.StartTime.ToString("yyyy-MM-dd"); Literal_EndTime.Text = model.EndTime.ToString("yyyy-MM-dd"); Literal_Description.Text = model.Brief; Repeater_BidList.DataSource = LogBll.GetList("auctionid=" + AuctionID + " order by auctiontime desc"); Repeater_BidList.DataBind(); Repeater_Comment.DataSource = CmtBll.GetList(AppType.MagicWorld, AuctionID); Repeater_Comment.DataBind(); Repeater_Other.DataSource = bll.GetRelatedProductList(model.CategoryID); Repeater_Other.DataBind(); }
public XmlDocument GetData(NameValueCollection TagParameter) { XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?><tag />"); XmlNode rootNode = xdoc.SelectSingleNode("/tag"); DataTable dt = new SecondhandProductBll().GetNewestList(9); foreach (DataRow row in dt.Rows) { XmlNode DealProductNode = XmlUtility.AddNewNode(rootNode, "deal", null); XmlUtility.AddNewNode(DealProductNode, "pid", row["pid"].ToString()); XmlUtility.AddNewNode(DealProductNode, "pname", row["pname"].ToString()); XmlUtility.AddNewNode(DealProductNode, "price", row["price"].ToString()); XmlUtility.AddNewNode(DealProductNode, "ptype", row["ptype"].ToString()); XmlUtility.AddNewNode(DealProductNode, "mediumimage", MagicWorldImageRule.GetMainImageUrl(row["mediumimage"].ToString())); XmlUtility.AddNewNode(DealProductNode, "inserttime", Convert.ToDateTime(row["inserttime"]).ToString("yyyy-MM-dd")); } return(xdoc); }
private void BindData(int PageIndex) { int RecordCount = 0; DataTable newRents = bll.GetList(1, 5, "", " createtime desc", out RecordCount); DataTable rentings = bll.GetList(PageIndex, AspNetPager.PageSize, " and status=" + (int)RentProductStatus.申请中, " createtime desc", out RecordCount); foreach (DataRow row in newRents.Rows) { row["smallimage"] = MagicWorldImageRule.GetMainImageUrl(row["smallimage"].ToString()); row["mediumimage"] = MagicWorldImageRule.GetMainImageUrl(row["mediumimage"].ToString()); } foreach (DataRow row in rentings.Rows) { row["smallimage"] = MagicWorldImageRule.GetMainImageUrl(row["smallimage"].ToString()); row["mediumimage"] = MagicWorldImageRule.GetMainImageUrl(row["mediumimage"].ToString()); } Repeater_NewRents.DataSource = newRents; Repeater_NewRents.DataBind(); Repeater_Rentings.DataSource = rentings; Repeater_Rentings.DataBind(); AspNetPager.RecordCount = RecordCount; }