コード例 #1
0
 public static BackModel GetBackById(int BackID )
 {
     DataTable dt = BackModelSetDAL.GetDataTable("select *  from BackModel where AutoID=" + BackID); 
     List<BackModel> list = new List<BackModel>();
     foreach (DataRow dr in dt.Rows)
     {
         BackModel model = new BackModel();
         model.FillData(dr);
         list.Add(model);
     }
     return list.FirstOrDefault();
 }
コード例 #2
0
        public static List<BackModel> GetBackModel(int pageSize, int pageIndex, ref int totalCount, ref int pageCount,string sqlwhere="",bool asc=false)
        {
            string tablename = " BackModel a ";
            string sql = " 1=1 ";

            DataTable dt = CommonBusiness.GetPagerData(tablename, " a.* ", sql + sqlwhere, " a.WinFee ", pageSize, pageIndex, out totalCount, out pageCount, asc);
           List<BackModel> list = new List<BackModel>();
            foreach (DataRow dr in dt.Rows)
            {
                BackModel model = new BackModel();
                model.FillData(dr);
                list.Add(model);
            }
            return list;
        }