Пример #1
0
 public List<CrmMemberScore> SelCrmMemberScoreInfo(string Uid)
 {
     List<CrmMemberScore> list = null;
     try
     {
         IParameterMapper ipmapper = new SelCrmMemberScoreInfoParameterMapper();
         DataAccessor<CrmMemberScore> tableAccessor;
         string strSql = @"select  * from CrmMemberScore n
             where n.Uid=@Uid";
         tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<CrmMemberScore>.MapAllProperties()
            // .Map(t => t.Uid).ToColumn("Uid")
             .Map(t => t.TotalScore).ToColumn("TotalScore")
             .Map(t => t.LastScore).ToColumn("LastScore")
             .Map(t => t.LastScoredDate).ToColumn("LastScoredDate")
             .Map(t => t.Score).ToColumn("Score")
             .Map(t => t.UseMoney).ToColumn("UseMoney")
             .Map(t => t.UseScore).ToColumn("UseScore")
             .Build());
         list = tableAccessor.Execute(new string[] { Uid }).ToList();
         return list;
     }
     catch (Exception ex)
     {
         Logger.Log(ex);
         return null;
     }
 }
        public List <CrmMemberScore> SelCrmMemberScoreInfo(string Uid)
        {
            List <CrmMemberScore> list = null;

            try
            {
                IParameterMapper ipmapper = new SelCrmMemberScoreInfoParameterMapper();
                DataAccessor <CrmMemberScore> tableAccessor;
                string strSql = @"select  * from CrmMemberScore n
                    where n.Uid=@Uid";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <CrmMemberScore> .MapAllProperties()
                                                           // .Map(t => t.Uid).ToColumn("Uid")
                                                           .Map(t => t.TotalScore).ToColumn("TotalScore")
                                                           .Map(t => t.LastScore).ToColumn("LastScore")
                                                           .Map(t => t.LastScoredDate).ToColumn("LastScoredDate")
                                                           .Map(t => t.Score).ToColumn("Score")
                                                           .Map(t => t.UseMoney).ToColumn("UseMoney")
                                                           .Map(t => t.UseScore).ToColumn("UseScore")
                                                           .Build());
                list = tableAccessor.Execute(new string[] { Uid }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }