Пример #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();
            }
        }
Пример #2
0
    /// <summary>
    /// 加载文章 的所有评论,并绑定到Repeater_Comment控件上
    /// </summary>
    /// <param name="articleID"></param>
    private void LoadComment(int articleID)
    {
        DBHelper mdb = new DBHelper();

        mdb.Connect();
        Repeater_Comment.DataSource = CommentData.GetAllCommentByArticleID(articleID, mdb.GetConn);
        Repeater_Comment.DataBind();
        int Floor = CommentData.GetFloorByArticleId(articleID, mdb.GetConn);

        if (Floor > 0 && !IsPostBack)
        {
            LoadFloorList(Floor); // 加载可回复的楼层
            LMsg2.Visible = false;
        }
        else
        {
            LMsg2.Visible = true;
        }
        mdb.Disconnect();
    }
Пример #3
0
        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();
        }
Пример #5
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();
        }