/// <summary> /// 取记录列表(返回记录数) /// </summary> /// <param name="pageListModel"></param> /// <param name="rowCount"></param> /// <returns></returns> public DataSet GetList(PageListModel pageListModel, ref int rowCount) { SqlParameter[] parameters = { new SqlParameter("@select_list", SqlDbType.VarChar, 1000), new SqlParameter("@table_name", SqlDbType.VarChar, 3000), new SqlParameter("@where", SqlDbType.VarChar, 8000), new SqlParameter("@primary_key", SqlDbType.VarChar, 100), new SqlParameter("@order_by", SqlDbType.VarChar, 100), new SqlParameter("@page_size", SqlDbType.Int), new SqlParameter("@page_index", SqlDbType.Int), new SqlParameter("@bl_page", SqlDbType.Int), new SqlParameter("@flag", SqlDbType.Int), new SqlParameter("@return_Value", SqlDbType.Int), }; parameters[0].Value = pageListModel.SelectList; parameters[1].Value = pageListModel.Tables; parameters[2].Value = pageListModel.StrWhere; parameters[3].Value = pageListModel.PriKey; parameters[4].Value = pageListModel.OrderByField; parameters[5].Value = pageListModel.PageSize; parameters[6].Value = pageListModel.PageIndex; parameters[7].Value = pageListModel.BlPage; parameters[8].Value = pageListModel.Flag; parameters[9].Direction = ParameterDirection.ReturnValue; return(Itemsql.RunProcedure("UP_Common_PageList", parameters, "ds", out rowCount)); }
/// <summary> /// 更新所有的视图 /// </summary> public void UpdateAllView() { int rowsAffected; SqlParameter[] parameters = { }; Itemsql.RunProcedure("UP_UpdateAllView", parameters, out rowsAffected); }
/// <summary> /// 执行存储过程SP_PlanKC /// </summary> /// <param name="PlanID"></param> /// <param name="KcID"></param> /// <param name="Other"></param> /// <param name="OtherID"></param> public void RunPlanKc(string PlanID, string KcID, string Other, string OtherID) { SqlParameter[] parameters = { new SqlParameter("@PlanID", PlanID), new SqlParameter("@KcID", KcID), new SqlParameter("@Other", Other), new SqlParameter("@OtherID", OtherID), }; Itemsql.RunProcedureVoid("SP_PlanKC", parameters); }
/// <summary> /// 取记录的最大ID /// </summary> /// <param name="FieldName">自增长主键ID字段名</param> /// <param name="TableName">表名</param> /// <returns></returns> public static string GetMaxID(string FieldName, string TableName) { string strsql = "select max(" + FieldName + ")+1 from " + TableName; object obj = Itemsql.GetSingle(strsql); if (obj == null) { return("1"); } else { return(obj.ToString()); } }
/// <summary> /// 判断记录是否存在(带参数SQL语句) /// </summary> /// <param name="strSql">SQL语句</param> /// <param name="cmdParms">参数</param> /// <returns></returns> public static bool Exists(string strSql, params SqlParameter[] cmdParms) { object obj = Itemsql.GetSingle(strSql, cmdParms); int cmdresult; if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value))) { cmdresult = 0; } else { cmdresult = int.Parse(obj.ToString()); } if (cmdresult == 0) { return(false); } else { return(true); } }