public PageingModel <Good> GetPageing(int PageIndex, int PageSize)
        {
            PageingModel <Good> data = new PageingModel <Good>();

            data.PageIndex = PageIndex;
            data.PageSize  = PageSize;
            data.Order     = "Id";

            GoodBLL.GetPagingList(data, new SEARCH_CONDITION());
            return(data);
        }
        public void ExportFile()
        {
            APIFileHelp helper = new APIFileHelp();
            var         list   = GoodBLL.GetAllList().ToList();
            //我们在做导出,,所以,这里应该是字段在前,标题在后
            var dic = new Dictionary <string, string>()
            {
                { "Id", "编号" },
                { "Typeid", "类型编号" },
                { "Name", "名称" },
                { "Price", "单价" },
                { "Productaddr", "产地" },
                { "Remark", "备注" }
            };

            helper.ExportExcel <Good>("a.xls", list, dic);
        }
        public Good Get()
        {
            HttpContextBase context        = (HttpContextBase)Request.Properties["MS_HttpContext"];
            HttpRequestBase request        = context.Request;
            Authentication  authentication = new Authentication(request);
            string          GoodID         = request["GoodID"];
            int             goodID         = Convert.ToInt32(GoodID);

            var v = new GoodBLL().GetGood(goodID).Select(good => new Good()
            {
                GoodID        = good.GoodID,
                Title         = good.Title,
                SubTitle      = good.SubTitle,
                BidPrice      = good.BidPrice,
                RealPrice     = good.RealPrice,
                Detail        = good.Detail.Replace("***xing*fen*xiang*img*src***", ConfigurationManager.AppSettings["UploadUrl"]),
                ImageList     = XFXExt.imgList(good.ImageList, ConfigurationManager.AppSettings["UploadUrl"], false),
                SalesVolume   = good.SalesVolume,
                EvaluateNum   = good.EvaluateNum,
                EvaluateValue = good.EvaluateValue,
                GoodChild     = good.GoodChild.Where(goodChild => goodChild.State == 1).OrderByDescending(o => o.OrderBy).Select(goodChild => new GoodChild()
                {
                    GoodChildID   = goodChild.GoodChildID,
                    Specification = goodChild.Specification,
                    AddPrice      = goodChild.AddPrice,
                    Image         = ConfigurationManager.AppSettings["UploadUrl"] + goodChild.Image,
                    Repertory     = (goodChild.Repertory > 10 ? 10 : goodChild.Repertory)
                }).ToList()
            }).FirstOrDefault();

            using (Entity entity = new Entity())
            {
                v.GoodCollection = (string.IsNullOrEmpty(authentication.state) ?
                                    (entity.GoodCollection.Where(o => o.GoodID == v.GoodID && o.UserID == authentication.userID).ToList().Select(goodCollection => new GoodCollection()
                {
                    State = goodCollection.State
                }).ToList()) : null);
            }
            return(v);
        }