Example #1
0
        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 GetCommentList(HttpContext CurrentContext)
        {
            CommentBll bll    = new CommentBll();
            int        NewsID = Convert.ToInt32(CurrentContext.Request["nid"]);

            if (NewsID == 0)
            {
                CurrentContext.Response.Write(GetJsonResult(false, "参数错误!"));
                return;
            }

            DataTable dt = bll.GetList(AppType.News, NewsID);

            StringBuilder result = new StringBuilder();
            StringWriter  sw     = new StringWriter(result);
            JsonWriter    writer = new JsonWriter(sw);

            writer.Formatting = Formatting.Indented;
            writer.WriteStartArray();
            foreach (DataRow row in dt.Rows)
            {
                writer.WriteStartObject();

                WriteJsonKeyValue(writer, "userid", row["userid"].ToString());
                WriteJsonKeyValue(writer, "content", row["content"].ToString());
                WriteJsonKeyValue(writer, "createtime", Convert.ToDateTime(row["createtime"]).ToString("yyyy-MM-dd HH:mm:ss"));

                writer.WriteEndObject();
            }
            writer.WriteEndArray();
            writer.Close();

            CurrentContext.Response.Write("(" + result.ToString() + ")");
        }
        private void BindData(int PageIndex)
        {
            int RecordCount = 0;

            GridView1.DataSource = bll.GetList(PageIndex, AspNetPager.PageSize, "p.*", AppType.News, "inner join pdproduct p on c.targetid=p.productid", out RecordCount);
            GridView1.DataBind();

            AspNetPager.RecordCount = RecordCount;
        }
        private void BindData(int PageIndex)
        {
            int RecordCount = 0;

            GridView1.DataSource = bll.GetList(PageIndex, AspNetPager.PageSize, "p.rentname", AppType.MagicWorld, "inner join mwrentproduct p on c.targetid=p.rentid", out RecordCount);
            GridView1.DataBind();

            AspNetPager.RecordCount = RecordCount;
        }
        private void BindCommentData(int PageIndex)
        {
            DataTable dt = commentBll.GetList(AppType.Product, ProductID);

            Literal_CommentCount.Text = dt.Rows.Count.ToString();

            Repeater_Comments.DataSource = dt;
            Repeater_Comments.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();
        }
Example #7
0
        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 DataTable GetNewsComments(int NewsID)
        {
            CommentBll bll = new CommentBll();

            return(bll.GetList(AppType.News, NewsID));
        }