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;
        }
Esempio n. 2
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 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);
        }
        protected void Button_OK_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (TextBox_ProductName.Text == "")
            {
                strErr += "拍品名称为空!\\n";
            }
            if (TextBox_Count.Text == "" || !PageValidate.IsNumber(TextBox_Count.Text))
            {
                strErr += "拍品数量为空或者不是数字!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }

            PawnProductModel model = bll.GetModel(PawnProductID);

            if (FileUpload_ProductImage.FileName != "")
            {
                string[] ProductImages;
                if (MagicWorldImageRule.SaveProductMainImage(PawnProductID, FileUpload_ProductImage.PostedFile, out ProductImages))
                {
                    model.SmallImage  = ProductImages[0];
                    model.MediumImage = ProductImages[1];
                    //model.LargeImage = ProductImages[2];
                }
                else
                {
                    MessageBox.Show(this, "图片上传失败");
                    return;
                }
            }


            model.PawnProductName = TextBox_ProductName.Text;
            model.PawnPrice       = Convert.ToDecimal(TextBox_PawnPrice.Text);
            model.SellingPrice    = Convert.ToDecimal(TextBox_SellingPrice.Text);
            model.Brief           = TextBox_Brief.Text;
            //model.Keywords = TextBox_Keyword.Text;
            model.Stock      = Convert.ToInt32(TextBox_Count.Text);
            model.ChangeTime = DateTime.Now;
            model.Status     = (int)PawnProductStatus.已收当;

            bll.Update(model);
            Response.Redirect("List.aspx");
        }
        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);
        }
Esempio n. 7
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();
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
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();
        }
Esempio n. 11
0
        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);
        }
Esempio n. 12
0
        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;
        }
Esempio n. 13
0
        protected void Button_Add_Click(object sender, EventArgs e)
        {
            string ErrorMessage = String.Empty;

            if (String.IsNullOrEmpty(TextBox_RentName.Text))
            {
                ErrorMessage += "商品名称不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Stock.Text) || !PageValidate.IsNumber(TextBox_Stock.Text))
            {
                ErrorMessage += "商品数量不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Keywords.Text))
            {
                ErrorMessage += "关键词不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_RentPrice.Text) || !PageValidate.IsDecimal(TextBox_RentPrice.Text))
            {
                ErrorMessage += "出租价格不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_CashPledge.Text) || !PageValidate.IsDecimal(TextBox_CashPledge.Text))
            {
                ErrorMessage += "出租押金不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_MaxRentDays.Text) || !PageValidate.IsNumber(TextBox_MaxRentDays.Text))
            {
                ErrorMessage += "最大出租时间不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Brief.Text))
            {
                ErrorMessage += "商品简介不能为空\\n";
            }
            if (String.IsNullOrEmpty(FileUpload_MainImage.FileName))
            {
                ErrorMessage += "商品图片不能为空\\n";
            }

            if (!String.IsNullOrEmpty(ErrorMessage))
            {
                MessageBox.Show(this, ErrorMessage);
                return;
            }

            int RentID = CommDataHelper.GetNewSerialNum(AppType.MagicWorld);

            string[] ProductImages;
            if (MagicWorldImageRule.SaveProductMainImage(RentID, FileUpload_MainImage.PostedFile, out ProductImages))
            {
                RentProductModel model = new RentProductModel();

                model.RentID      = RentID;
                model.RentName    = TextBox_RentName.Text;
                model.Stock       = Convert.ToInt32(TextBox_Stock.Text);
                model.Keywords    = TextBox_Keywords.Text.Replace(",", ",");
                model.CashPledge  = Convert.ToDecimal(TextBox_CashPledge.Text);
                model.RentPrice   = Convert.ToDecimal(TextBox_RentPrice.Text);
                model.MaxRentTime = Convert.ToInt32(TextBox_MaxRentDays.Text);
                model.Brief       = TextBox_Brief.Text;
                model.SmallImage  = ProductImages[0];
                model.MediumImage = ProductImages[1];

                model.CategoryID   = CategoryID;
                model.CategoryPath = Hidden_CategoryPath.Value;
                model.CreateTime   = DateTime.Now;
                model.UpdateTime   = DateTime.Now;
                model.Status       = (int)RentProductStatus.申请中;

                new RentProductBll().Add(model);

                PageControler.Publish(7, true);

                Response.Redirect("List.aspx");
            }
            else
            {
                MessageBox.Show(this, "图片上传失败!");
            }
        }
        protected void Button_Edit_Click(object sender, EventArgs e)
        {
            string ErrorMessage = String.Empty;

            if (String.IsNullOrEmpty(TextBox_RentName.Text))
            {
                ErrorMessage += "商品名称不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Stock.Text) || !PageValidate.IsNumber(TextBox_Stock.Text))
            {
                ErrorMessage += "商品数量不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Keywords.Text))
            {
                ErrorMessage += "关键词不能为空\\n";
            }
            if (String.IsNullOrEmpty(TextBox_RentPrice.Text) || !PageValidate.IsDecimal(TextBox_RentPrice.Text))
            {
                ErrorMessage += "出租价格不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_MaxRentDays.Text) || !PageValidate.IsNumber(TextBox_MaxRentDays.Text))
            {
                ErrorMessage += "最大出租天数不正确\\n";
            }
            if (String.IsNullOrEmpty(TextBox_Brief.Text))
            {
                ErrorMessage += "商品简介不能为空\\n";
            }

            if (!String.IsNullOrEmpty(ErrorMessage))
            {
                MessageBox.Show(this, ErrorMessage);
                return;
            }

            RentProductModel rent = bll.GetModel(RentID);

            if (!String.IsNullOrEmpty(FileUpload_MainImage.FileName))
            {
                string[] ProductImages;

                if (MagicWorldImageRule.SaveProductMainImage(rent.RentID, FileUpload_MainImage.PostedFile, out ProductImages))
                {
                    rent.SmallImage  = ProductImages[0];
                    rent.MediumImage = ProductImages[1];
                }
                else
                {
                    MessageBox.Show(this, "图片上传失败");
                    return;
                }
            }

            rent.RentName    = TextBox_RentName.Text;
            rent.RentPrice   = Convert.ToDecimal(TextBox_RentPrice.Text);
            rent.MaxRentTime = Convert.ToInt32(TextBox_MaxRentDays.Text);
            rent.Stock       = Convert.ToInt32(TextBox_Stock.Text);
            rent.Keywords    = TextBox_Keywords.Text;
            rent.Brief       = TextBox_Brief.Text;

            bll.Update(rent);

            PageControler.Publish(7, true);
            Response.Redirect("List.aspx");
        }