Ejemplo n.º 1
0
        public int getCount(Model.ViewModel.FootLinkViewModel model)
        {
            StringBuilder sbSI = new StringBuilder();

            sbSI.AppendFormat("select * from FootLink  Where 1=1 ");
            if (!string.IsNullOrEmpty(model.Name))
            {
                sbSI.AppendFormat(" and Name like '%{0}%'", model.Name);
            }
            DataTable dtBusiness = DBHelper.SearchSql(sbSI.ToString());

            return(dtBusiness.Rows.Count);
        }
Ejemplo n.º 2
0
        public System.Data.DataTable getList(Model.ViewModel.FootLinkViewModel model)
        {
            StringBuilder sbSI = new StringBuilder();

            sbSI.AppendFormat("select * from  FootLink  Where 1=1 ");
            if (!string.IsNullOrEmpty(model.Name))
            {
                sbSI.AppendFormat(" and Name like '%{0}%'", model.Name);
            }
            sbSI.Append(" ORDER BY CreateDate DESC");
            sbSI.AppendFormat(" limit {0},{1};", (model.page - 1) * model.rows, model.rows);
            DataTable dtFootLink = DBHelper.SearchSql(sbSI.ToString());

            return(dtFootLink);
        }