Пример #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            GoodsVideoType vt = (GoodsVideoType)value;

            if (vt == GoodsVideoType.VIDEO)
            {
                return(VideoIcon);
            }
            return(null);
        }
Пример #2
0
        public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
        {
            Dictionary <string, object> para = new Dictionary <string, object>();

            para["shopId"]    = shopId;
            para["state"]     = state;
            para["timeType"]  = timeType;
            para["start"]     = start;
            para["end"]       = end;
            para["vendor"]    = vendor;
            para["number"]    = number;
            para["type"]      = type;
            para["comment"]   = comment;
            para["flag"]      = flag;
            para["videoType"] = videoType;
            para["order"]     = order;
            para["vendorAdd"] = vendorAdd;
            para["shipper"]   = shipper;
            para["pageIndex"] = pageIndex;
            para["pageSize"]  = pageSize;
            return(DoPost <DataCollectionResponse <Goods> >(para));
        }
Пример #3
0
 public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
 {
     try
     {
         return(this.dao.GetByAll(shopId, state, timeType, start, end, vendor, number, type, comment, flag, videoType, order, vendorAdd, shipper, pageIndex, pageSize));
     }
     catch (Exception ex)
     {
         throw new WebFaultException <ResponseBase>(new ResponseBase(ex.Message), System.Net.HttpStatusCode.OK);
     }
 }
Пример #4
0
        public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
        {
            List <object> para           = new List <object>();
            string        dataHsqlHeader = " select distinct  G  from " + this.GetEntiyName() + " as  G left join fetch G.Vendor as V left join  G.Shops as GS ";
            //对于count统计sql语句left join 不能使用 fetch,不然会产生错误的sql语句,!!!!!
            string countHsqlHeader = " select count( distinct G.Id)  from " + this.GetEntiyName() + " as  G left join G.Vendor as V left join G.Shops as GS  ";

            string where = "";

            //店铺查询条件
            if (shopId <= -1)
            {
                where += "  G.Id not in (select distinct GoodsId from GS group by GoodsId having count(GoodsId) >=1 ) and ";
            }
            else if (shopId > 0)
            {
                where += " GS.ShopId=" + shopId + " and ";
            }
            where += this.MakeQuery("GS.State", (int)state, (int)GoodsState.NONE);
            where += this.MakeQuery("G.Type", (int)type, (int)GoodsType.GOODS_SHOES_NONE);
            if (timeType <= 0)
            {
                where += this.MakeQuery("G." + TIME_TYPES[timeType], start, true);
                where += this.MakeQuery("G." + TIME_TYPES[timeType], end, false);
            }
            else
            {
                where += this.MakeQuery("GS." + TIME_TYPES[timeType], start, true);
                where += this.MakeQuery("GS." + TIME_TYPES[timeType], end, false);
            }

            if (string.IsNullOrWhiteSpace(vendor) == false)
            {
                where += " (V.Name like ? or V.PingyingName like ?) and ";
                para.Add('%' + vendor + '%');
                para.Add('%' + vendor + '%');
            }
            where += this.MakeQueryLike("V.MarketAddress", vendorAdd, para);
            where += this.MakeQueryLike("G.Number", number, para);
            where += this.MakeQueryLike("G.Comment", comment, para);
            where += this.MakeQuery("G.Flag", (int)flag, (int)ColorFlag.None);
            where += this.MakeQuery("G.VideoType", (int)videoType, (int)GoodsVideoType.NONE);
            where += this.MakeQueryLike("G.Shipper", shipper, para);
            string dataHsql = dataHsqlHeader + this.TrimHSql("where " + where) + " order by ";

            if (string.IsNullOrWhiteSpace(order))
            {
                dataHsql += " G.Id desc ";
            }
            else if (order.Contains("State"))
            {
                dataHsql += " GS.State " + (order.Contains("asc") ? "asc " : "desc");
            }
            else if (order.Contains("UploadTime"))
            {
                dataHsql += " GS.UploadTime " + (order.Contains("asc") ? "asc " : "desc");
            }
            else if (order.Contains("Vendor"))
            {
                dataHsql += order.Contains("Vendor") ? (" V.Name " + (order.Contains("asc") ? "asc " : "desc")) : ("G." + order);
            }
            else
            {
                dataHsql += "G." + order;
            }
            return(this.GetPageEx(dataHsql, this.TrimHSql(countHsqlHeader + " where " + where), pageIndex, pageSize, para.ToArray()));
        }