Esempio n. 1
0
        public int getCount(Model.ViewModel.OtherPageInfo model)
        {
            StringBuilder sbSI = new StringBuilder();

            sbSI.AppendFormat("select * from otherpage  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);
        }
Esempio n. 2
0
        public System.Data.DataTable getList(Model.ViewModel.OtherPageInfo model)
        {
            StringBuilder sbSI = new StringBuilder();

            sbSI.AppendFormat("select * from  otherpage  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 dtOtherPage = DBHelper.SearchSql(sbSI.ToString());

            return(dtOtherPage);
        }