コード例 #1
0
        public List <MemProduct> getMemProducts(string CompanyId)
        {
            List <MemProduct> list = null;

            try
            {
                IParameterMapper          ipmapper = new getMemProductsParameterMapper();
                DataAccessor <MemProduct> tableAccessor;
                string strSql = @"select p.ProductName ,p.Price,p.MemberPrice ,p.id ,cl.CodeTypeListName
                 from ProductMenu p ,S_CodeList cl where p.Price>p.MemberPrice and p.Status='1'
                    and cl.CodeTypeListValue=p.Unit and cl.CodeType='ProductUnit' and p.CompanyId =@CompanyId order by p.Price";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <MemProduct> .
                                                           MapAllProperties().Build());
                list = tableAccessor.Execute(new string[] { CompanyId }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }
コード例 #2
0
        public List <ProductMenu> getImageProductMenu(string id)
        {
            List <ProductMenu> list = null;

            try
            {
                IParameterMapper           ipmapper = new getMemProductsParameterMapper();
                DataAccessor <ProductMenu> tableAccessor;
                string strSql = @"select b.ThumbImage
      from ProductMenu b where 1=1 and b.Status=1 and b.Id=@CompanyId";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <ProductMenu> .MapAllProperties()

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

                                                           .Build());
                list = tableAccessor.Execute(new string[] { id }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }
コード例 #3
0
ファイル: ProductModel.cs プロジェクト: WPT-KL/Kongliang
           public List<ProductMenu> getImageProductMenu(string id)
           {
               List<ProductMenu> list = null;
               try
               {
                   IParameterMapper ipmapper = new getMemProductsParameterMapper();
                   DataAccessor<ProductMenu> tableAccessor;
                   string strSql = @"select b.ThumbImage
      from ProductMenu b where 1=1 and b.Status=1 and b.Id=@CompanyId";
                   tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<ProductMenu>.MapAllProperties()

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

                     .Build());
                   list = tableAccessor.Execute(new string[] { id }).ToList();
                   return list;
               }
               catch (Exception ex)
               {
                   Logger.Log(ex);
                   return null;
               }
           }
コード例 #4
0
ファイル: ProductModel.cs プロジェクト: WPT-KL/Kongliang
    public List<MemProduct> getMemProducts(string CompanyId)
 {
     List<MemProduct> list = null;
     try
     {
         IParameterMapper ipmapper = new getMemProductsParameterMapper();
         DataAccessor<MemProduct> tableAccessor;
         string strSql = @"select p.ProductName ,p.Price,p.MemberPrice ,p.id ,cl.CodeTypeListName
          from ProductMenu p ,S_CodeList cl where p.Price>p.MemberPrice and p.Status='1'
             and cl.CodeTypeListValue=p.Unit and cl.CodeType='ProductUnit' and p.CompanyId =@CompanyId order by p.Price";
         tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<MemProduct>.
             MapAllProperties().Build());
         list = tableAccessor.Execute(new string[] { CompanyId }).ToList();
         return list;
     }
     catch (Exception ex)
     {
         Logger.Log(ex);
         return null;
     }
 }