Пример #1
0
        public List<Product> getOrginalImageProductListInfoData(string id)
        {
            List<Product> list = null;
            try
            {
                IParameterMapper ipmapper = new getImageProductListInfoDataParameterMapper();
                DataAccessor<Product> tableAccessor;
                string strSql = @"select b.OriginalImage
              from Product b where 1=1 and b.Status=1 and b.Id=@Id";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<Product>.MapAllProperties()
                     .DoNotMap(t => t.ProductTypeName1)
                     .DoNotMap(t => t.ProductTypeName2)
                     .DoNotMap(t => t.OrderNo)
                     .DoNotMap(t => t.Id)
                    //.DoNotMap(t => t.TypeId)
                     .DoNotMap(t => t.ProductName)
                     .DoNotMap(t => t.ProductType)
                     .DoNotMap(t => t.Code)
                     .DoNotMap(t => t.PinYin)
                     .DoNotMap(t => t.Unit)
                     .DoNotMap(t => t.MinUnit)
                     .DoNotMap(t => t.MinCount)
                     .DoNotMap(t => t.Price)
                     .Map(t => t.OriginalImage).ToColumn("OriginalImage")
                     .DoNotMap(t => t.ThumbImage)
                     .DoNotMap(t => t.BarCode)
                     .DoNotMap(t => t.Status)
                     .DoNotMap(t => t.RestaurantId)
                     .DoNotMap(t => t.Type)
                     .DoNotMap(t => t.MaterialId)
                     .DoNotMap(t => t.IsDiscount)
                     .DoNotMap(t => t.IsServiceType)
                     .DoNotMap(t => t.OrderCount)
                     .DoNotMap(t => t.FavCount)
                    .Build());
                list = tableAccessor.Execute(new object[] { Guid.Parse(id) }).ToList();
                return list;

            }
            catch (Exception ex)
            {
                Logger.Log("ID: " + id + "\r\n" + ex);
                return null;
            }
        }
Пример #2
0
        public List <Product> getThumbImageProductListInfoData(string id)
        {
            List <Product> list = null;

            try
            {
                IParameterMapper       ipmapper = new getImageProductListInfoDataParameterMapper();
                DataAccessor <Product> tableAccessor;
                string strSql = @"select b.ThumbImage
      from Product b where 1=1 and b.Status=1 and b.Id=@Id";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <Product> .MapAllProperties()
                                                           .DoNotMap(t => t.ProductTypeName1)
                                                           .DoNotMap(t => t.ProductTypeName2)
                                                           .DoNotMap(t => t.OrderNo)
                                                           .DoNotMap(t => t.Id)
                                                           //.DoNotMap(t => t.TypeId)
                                                           .DoNotMap(t => t.ProductName)
                                                           .DoNotMap(t => t.ProductType)
                                                           .DoNotMap(t => t.Code)
                                                           .DoNotMap(t => t.PinYin)
                                                           .DoNotMap(t => t.Unit)
                                                           .DoNotMap(t => t.MinUnit)
                                                           .DoNotMap(t => t.MinCount)
                                                           .DoNotMap(t => t.Price)
                                                           .Map(t => t.ThumbImage).ToColumn("ThumbImage")
                                                           .DoNotMap(t => t.OriginalImage)
                                                           .DoNotMap(t => t.BarCode)
                                                           .DoNotMap(t => t.Status)
                                                           .DoNotMap(t => t.RestaurantId)
                                                           .DoNotMap(t => t.Type)
                                                           .DoNotMap(t => t.MaterialId)
                                                           .DoNotMap(t => t.IsDiscount)
                                                           .DoNotMap(t => t.IsServiceType)
                                                           .DoNotMap(t => t.OrderCount)
                                                           .DoNotMap(t => t.FavCount)
                                                           .Build());
                list = tableAccessor.Execute(new object[] { Guid.Parse(id) }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log("ID: " + id + "\r\n" + ex);
                return(null);
            }
        }
Пример #3
0
        public List<ReceiveOrder1> getDefauleImage(string id)
        {
            List<ReceiveOrder1> list = null;
            try
            {
                IParameterMapper ipmapper = new getImageProductListInfoDataParameterMapper();
                DataAccessor<ReceiveOrder1> tableAccessor;
                string strSql = @"select ro.DefaultImg from Product p ,
            ReceiveOrder ro where p.RestaurantId=ro.RstId  and p.Id=@Id";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<ReceiveOrder1>.MapAllProperties()

                     .Map(t => t.DefaultImg).ToColumn("DefaultImg")

                    .Build());
                list = tableAccessor.Execute(new object[] { Guid.Parse(id) }).ToList();
                return list;

            }
            catch (Exception ex)
            {
                Logger.Log("ID: " + id + "\r\n" + ex);
                return null;
            }
        }
Пример #4
0
        public List <ReceiveOrder1> getDefauleImage(string id)
        {
            List <ReceiveOrder1> list = null;

            try
            {
                IParameterMapper             ipmapper = new getImageProductListInfoDataParameterMapper();
                DataAccessor <ReceiveOrder1> tableAccessor;
                string strSql = @"select ro.DefaultImg from Product p , 
        ReceiveOrder ro where p.RestaurantId=ro.RstId  and p.Id=@Id";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <ReceiveOrder1> .MapAllProperties()

                                                           .Map(t => t.DefaultImg).ToColumn("DefaultImg")

                                                           .Build());
                list = tableAccessor.Execute(new object[] { Guid.Parse(id) }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log("ID: " + id + "\r\n" + ex);
                return(null);
            }
        }