Exemplo n.º 1
0
        public List<RestaurantAbstract> getImageRst(string id)
        {
            List<RestaurantAbstract> list = null;
            try
            {
                IParameterMapper ipmapper = new getRestaurantListInfoDataParameterMapper();
                DataAccessor<RestaurantAbstract> tableAccessor;
                string strSql = @"select ro.photo
             from  ReceiveOrder   ro
             where ro.RstId=@SourceAccountId";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<RestaurantAbstract>.MapAllProperties()
                     .DoNotMap(t => t.Id)
                     .DoNotMap(t => t.isAcceptOrder)
                     .DoNotMap(t => t.MapUrl)
                     .DoNotMap(t => t.MaxTime)
                    //.DoNotMap(t => t.TypeId)
                     .DoNotMap(t => t.Name)
                     .DoNotMap(t => t.RstType)
                     .DoNotMap(t => t.VirtualUrl)
                     .DoNotMap(t => t.Address)
                     .DoNotMap(t => t.BusinessEndtDate)
                     .DoNotMap(t => t.BusinessStartDate)
                     .DoNotMap(t => t.ContactPhone)
                     .DoNotMap(t=>t.name)

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

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

            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return null;
            }
        }
//        public List<Restaurant> getRestaurantListInfoData(string companyid)
//        {
//            List<Restaurant> list = null;
//            try
//            {
//                DataAccessor<Restaurant> tableAccessor;
//                string strSql = @"select a.Id
//      ,a.Name
//      ,a.CompanyId
//      ,a.Address
//      ,a.ContactPhone
//      ,a.Description
//      ,a.BankId
//      ,a.BankAccount
//      ,a.OpenDate
//      ,a.BusinessStartDate
//      ,a.BusinessEndtDate
//      ,a.RegSN
//      ,a.ReserveModel
//      ,a.UseState
//      ,a.PublicKey
//      ,a.PrivateKey from Restaurant a where a.CompanyId='"+companyid+"'";
//                tableAccessor = db.CreateSqlStringAccessor(strSql, MapBuilder<Restaurant>.MapAllProperties()
//                     .Map(t => t.Id).ToColumn("Id")
//                     .Map(t => t.Name).ToColumn("Name")
//                     .Map(t => t.CompanyId).ToColumn("CompanyId")
//                     .Map(t => t.Address).ToColumn("Address")
//                     .Map(t => t.ContactPhone).ToColumn("ContactPhone")
//                     .Map(t => t.Description).ToColumn("Description")
//                     .Map(t => t.BankId).ToColumn("BankId")
//                     .Map(t => t.BankAccount).ToColumn("BankAccount")
//                     .Map(t => t.OpenDate).ToColumn("OpenDate")
//                     .Map(t => t.BusinessStartDate).ToColumn("BusinessStartDate")
//                     .Map(t => t.BusinessEndtDate).ToColumn("BusinessEndtDate")
//                     .Map(t => t.RegSN).ToColumn("RegSN")
//                     .Map(t => t.ReserveModel).ToColumn("ReserveModel")
//                     .Map(t => t.UseState).ToColumn("UseState")
//                     .Map(t => t.PublicKey).ToColumn("PublicKey")
//                     .Map(t => t.PrivateKey).ToColumn("PrivateKey")

//                    .Build());
//                list = tableAccessor.Execute().ToList();
//                return list;

//            }
//            catch (Exception ex)
//            {
//                return null;
//            }
//        }
        #endregion
        #region getImageRst

        public List <RestaurantAbstract> getImageRst(string id)
        {
            List <RestaurantAbstract> list = null;

            try
            {
                IParameterMapper ipmapper = new getRestaurantListInfoDataParameterMapper();
                DataAccessor <RestaurantAbstract> tableAccessor;
                string strSql = @"select ro.photo
 from  ReceiveOrder   ro
 where ro.RstId=@SourceAccountId";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <RestaurantAbstract> .MapAllProperties()
                                                           .DoNotMap(t => t.Id)
                                                           .DoNotMap(t => t.isAcceptOrder)
                                                           .DoNotMap(t => t.MapUrl)
                                                           .DoNotMap(t => t.MaxTime)
                                                           //.DoNotMap(t => t.TypeId)
                                                           .DoNotMap(t => t.Name)
                                                           .DoNotMap(t => t.RstType)
                                                           .DoNotMap(t => t.VirtualUrl)
                                                           .DoNotMap(t => t.Address)
                                                           .DoNotMap(t => t.BusinessEndtDate)
                                                           .DoNotMap(t => t.BusinessStartDate)
                                                           .DoNotMap(t => t.ContactPhone)
                                                           .DoNotMap(t => t.name)

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

                                                           .Build());
                list = tableAccessor.Execute(new string[] { id }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }