예제 #1
0
        public static List <T> Select <T>(string tbname, string FieldKey, int PageCurrent, int PageSize, string FieldShow, string FieldOrder, string Where, int pageSize)
        {
            List <SqlParameter> list = new List <SqlParameter>(8);

            list.Add(new SqlParameter("@tbname", tbname));
            list.Add(new SqlParameter("@FieldKey", FieldKey));
            list.Add(new SqlParameter("@PageCurrent", PageCurrent));
            list.Add(new SqlParameter("@PageSize", PageSize));
            list.Add(new SqlParameter("@FieldShow", FieldShow));
            list.Add(new SqlParameter("@FieldOrder", FieldOrder));
            list.Add(new SqlParameter("@Where", Where));
            list.Add(new SqlParameter("@PageCount", 10));
            using (DataSet set = DataBase.ExecuteDataset(CommandType.StoredProcedure, "sp_pageView", list.ToArray()))
            {
                if ((set.Tables.Count < 1) || (set.Tables[0].Rows.Count < 1))
                {
                    return(new List <T>(0));
                }
                return(DataBinding.LoadForList <T>(set.Tables[0].Rows));
            }
        }
예제 #2
0
 public static int Update(string cmdText, object dataObj)
 {
     return(DataBase.ExecuteNonQuery(CommandType.Text, cmdText, DataBinding.BuildParameter(cmdText, dataObj)));
 }
예제 #3
0
 public static void Insert(string cmdText, object dataObj)
 {
     DataBase.ExecuteNonQuery(CommandType.Text, cmdText, DataBinding.BuildParameter(cmdText, dataObj));
 }