Пример #1
0
        public List <ProductMenuType> getProductMenuType(string RstId)
        {
            List <ProductMenuType> list = null;

            try
            {
                IParameterMapper ipmapper = new SelTableInfoParameterMapper();
                DataAccessor <ProductMenuType> tableAccessor;
                string strSql = @"select  p.CompanyId,p.IsServiceType,p.OrderNo,p.ParentType,p.PrintId,p.TypeId,p.TypeName 
from ProductMenuType p where IsServiceType='0' order by p.OrderNo ";
                //  tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<ProductMenuType>.MapAllProperties()
                tableAccessor = db.CreateSqlStringAccessor(strSql, MapBuilder <ProductMenuType> .MapAllProperties()

                                                           .Map(t => t.CompanyId).ToColumn("CompanyId")
                                                           .Map(t => t.IsServiceType).ToColumn("IsServiceType")
                                                           .Map(t => t.OrderNo).ToColumn("OrderNo")
                                                           .Map(t => t.ParentType).ToColumn("ParentType")
                                                           .Map(t => t.PrintId).ToColumn("PrintId")
                                                           .Map(t => t.TypeId).ToColumn("TypeId")
                                                           .Map(t => t.TypeName).ToColumn("TypeName")
                                                           .Build());
                // list = tableAccessor.Execute(new string[] { RstId }).ToList();
                list = tableAccessor.Execute().ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }
Пример #2
0
 public List<SelTableCount> SelTableInfo(string RstId)
 {
     List<SelTableCount> list = null;
     try
     {
         IParameterMapper ipmapper = new SelTableInfoParameterMapper();
         DataAccessor<SelTableCount> tableAccessor;
         string strSql = @"select s.RstId,
     (s.TableCount*s.MaxTime*(cast(s.Rnoon as int)+cast(s.Reven as int))-(select SUM(isnull(o.TableCount,0))
      from Orders o
     left join OrderStatus os on os.OrderId = o.Id
      where
     (os.OrderStatus='Paid' or os.OrderStatus='Confirmed')
     and o.RstId=s.RstId)) as total from ReceiveOrder s
      where s.RstId=@RstId";
         tableAccessor = db.CreateSqlStringAccessor(strSql,ipmapper, MapBuilder<SelTableCount>.MapAllProperties()
              .Map(t => t.RstId).ToColumn("RstId")
              .Map(t => t.total).ToColumn("total")
              //.Map(t => t.MaxTime).ToColumn("MaxTime")
              //.Map(t => t.Reven).ToColumn("Reven")
              //.Map(t => t.Rnoon).ToColumn("Rnoon")
              //.Map(t => t.Status).ToColumn("Status")
              //.Map(t => t.TableCount).ToColumn("TableCount")
             .Build());
         list = tableAccessor.Execute(new string[] { RstId }).ToList();
         return list;
     }
     catch (Exception ex)
     {
         Logger.Log(ex);
         return null;
     }
 }
Пример #3
0
 public List<SelTableInfo> getTableInfo(string RstId)
 {
     List<SelTableInfo> list = null;
     try
     {
         IParameterMapper ipmapper = new SelTableInfoParameterMapper();
         DataAccessor<SelTableInfo> tableAccessor;
         string strSql = @"exec TableConfing @RstId=@RstId";
         tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<SelTableInfo>.MapAllProperties()
              .Map(t => t.RstName).ToColumn("RstName")
              .Map(t => t.Times).ToColumn("Times")
             .Map(t => t.Counts).ToColumn("Counts")
             .Map(t => t.DiningDate).ToColumn("DiningDate")
             //.Map(t => t.Rnoon).ToColumn("Rnoon")
             //.Map(t => t.Status).ToColumn("Status")
             //.Map(t => t.TableCount).ToColumn("TableCount")
             .Build());
         list = tableAccessor.Execute(new string[] { RstId }).ToList();
         return list;
     }
     catch (Exception ex)
     {
         Logger.Log(ex);
         return null;
     }
 }
Пример #4
0
        public List<ProductMenuType> getProductMenuType(string RstId)
        {
            List<ProductMenuType> list = null;
            try
            {
                IParameterMapper ipmapper = new SelTableInfoParameterMapper();
                DataAccessor<ProductMenuType> tableAccessor;
                string strSql = @"select  p.CompanyId,p.IsServiceType,p.OrderNo,p.ParentType,p.PrintId,p.TypeId,p.TypeName
            from ProductMenuType p where IsServiceType='0' order by p.OrderNo ";
              //  tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<ProductMenuType>.MapAllProperties()
                tableAccessor = db.CreateSqlStringAccessor(strSql, MapBuilder<ProductMenuType>.MapAllProperties()

                     .Map(t => t.CompanyId).ToColumn("CompanyId")
                     .Map(t => t.IsServiceType).ToColumn("IsServiceType")
                    .Map(t => t.OrderNo).ToColumn("OrderNo")
                    .Map(t => t.ParentType).ToColumn("ParentType")
                    .Map(t => t.PrintId).ToColumn("PrintId")
                    .Map(t => t.TypeId).ToColumn("TypeId")
                    .Map(t => t.TypeName).ToColumn("TypeName")
                    .Build());
               // list = tableAccessor.Execute(new string[] { RstId }).ToList();
                list = tableAccessor.Execute().ToList();
                return list;
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return null;
            }
        }
        public List <SelTableInfo> getTableInfo(string RstId)
        {
            List <SelTableInfo> list = null;

            try
            {
                IParameterMapper            ipmapper = new SelTableInfoParameterMapper();
                DataAccessor <SelTableInfo> tableAccessor;
                string strSql = @"exec TableConfing @RstId=@RstId";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <SelTableInfo> .MapAllProperties()
                                                           .Map(t => t.RstName).ToColumn("RstName")
                                                           .Map(t => t.Times).ToColumn("Times")
                                                           .Map(t => t.Counts).ToColumn("Counts")
                                                           .Map(t => t.DiningDate).ToColumn("DiningDate")
                                                           //.Map(t => t.Rnoon).ToColumn("Rnoon")
                                                           //.Map(t => t.Status).ToColumn("Status")
                                                           //.Map(t => t.TableCount).ToColumn("TableCount")
                                                           .Build());
                list = tableAccessor.Execute(new string[] { RstId }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }
        public List <SelTableCount> SelTableInfo(string RstId)
        {
            List <SelTableCount> list = null;

            try
            {
                IParameterMapper             ipmapper = new SelTableInfoParameterMapper();
                DataAccessor <SelTableCount> tableAccessor;
                string strSql = @"select s.RstId,
(s.TableCount*s.MaxTime*(cast(s.Rnoon as int)+cast(s.Reven as int))-(select SUM(isnull(o.TableCount,0))
 from Orders o 
left join OrderStatus os on os.OrderId = o.Id
 where 
(os.OrderStatus='Paid' or os.OrderStatus='Confirmed')
and o.RstId=s.RstId)) as total from ReceiveOrder s 
 where s.RstId=@RstId";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <SelTableCount> .MapAllProperties()
                                                           .Map(t => t.RstId).ToColumn("RstId")
                                                           .Map(t => t.total).ToColumn("total")
                                                           //.Map(t => t.MaxTime).ToColumn("MaxTime")
                                                           //.Map(t => t.Reven).ToColumn("Reven")
                                                           //.Map(t => t.Rnoon).ToColumn("Rnoon")
                                                           //.Map(t => t.Status).ToColumn("Status")
                                                           //.Map(t => t.TableCount).ToColumn("TableCount")
                                                           .Build());
                list = tableAccessor.Execute(new string[] { RstId }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }