/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(int CourseType, int CourseId) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from Course"); strSql.Append(" where CourseType=SQL2012CourseType and CourseId=SQL2012CourseId "); SqlParameter[] parameters = { new SqlParameter("SQL2012CourseType", SqlDbType.Int, 4), new SqlParameter("SQL2012CourseId", SqlDbType.Int, 4) }; parameters[0].Value = CourseType; parameters[1].Value = CourseId; return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
public bool Exists(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from tbClass"); strSql.Append(" where "); strSql.Append(" id = @id "); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = id; Util.MyUtil.PrintSql(strSql.ToString()); return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(string type, string user_name) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from " + databaseprefix + "user_code"); strSql.Append(" where status=0 and datediff(d,eff_time,getdate())<=0 and type=@type and user_name=@user_name"); SqlParameter[] parameters = { new SqlParameter("@type", SqlDbType.NVarChar, 20), new SqlParameter("@user_name", SqlDbType.NVarChar, 100) }; parameters[0].Value = type; parameters[1].Value = user_name; return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(Model.shop_log model) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from " + databaseprefix + "shop_order"); strSql.Append(" where shop_id=@shop_id "); strSql.Append(" and goods_id=@goods_id "); SqlParameter[] parameters = { new SqlParameter("@shop_id", SqlDbType.Int, 10), new SqlParameter("@goods_id", SqlDbType.Int, 10) }; parameters[0].Value = model.shop_id; parameters[1].Value = model.goods_id; return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
/* * /// <summary> * /// 分页获取数据列表 * /// </summary> * public DataSet GetList(int PageSize,int PageIndex,string strWhere) * { * SqlParameter[] parameters = { * new SqlParameter("@tblName", SqlDbType.VarChar, 255), * new SqlParameter("@fldName", SqlDbType.VarChar, 255), * new SqlParameter("@PageSize", SqlDbType.Int), * new SqlParameter("@PageIndex", SqlDbType.Int), * new SqlParameter("@IsReCount", SqlDbType.Bit), * new SqlParameter("@OrderType", SqlDbType.Bit), * new SqlParameter("@strWhere", SqlDbType.VarChar,1000), * }; * parameters[0].Value = "T_ClientType"; * parameters[1].Value = "CT_ID"; * parameters[2].Value = PageSize; * parameters[3].Value = PageIndex; * parameters[4].Value = 0; * parameters[5].Value = 0; * parameters[6].Value = strWhere; * return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); * }*/ #endregion BasicMethod #region ExtensionMethod /// <summary> /// 是否存在该记录 /// </summary> public bool Exists(string CT_Code, int CT_Enable) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from T_ClientType"); strSql.Append(" where CT_Code=@CT_Code and CT_Enable=@CT_Enable"); SqlParameter[] parameters = { new SqlParameter("@CT_Code", SqlDbType.VarChar, 512), new SqlParameter("@CT_Enable", SqlDbType.Int) }; parameters[0].Value = CT_Code; parameters[1].Value = CT_Enable; return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(string strUserName, string strPassWord) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from Admin"); strSql.Append(" where UserName=@UserName and PassWord=@PassWord"); SqlParameter[] parameters = { new SqlParameter("@UserName", SqlDbType.NVarChar, 50), new SqlParameter("@PassWord", SqlDbType.NVarChar, 50) }; parameters[0].Value = strUserName; parameters[1].Value = strPassWord; return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
public bool Exists(int ID, string dNum, string dName, string dType) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from [T_Dictionary]"); strSql.Append(" where "); strSql.Append(" ID = @ID and "); strSql.Append(" dNum = @dNum and "); strSql.Append(" dName = @dName and "); strSql.Append(" dType = @dType "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@dNum", SqlDbType.VarChar, 20), new SqlParameter("@dName", SqlDbType.VarChar, 100), new SqlParameter("@dType", SqlDbType.VarChar, 10) }; parameters[0].Value = ID; parameters[1].Value = dNum; parameters[2].Value = dName; parameters[3].Value = dType; return(DbHelperSQL.Exists(strSql.ToString(), parameters)); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(string sql) { return(DbHelperSQL.Exists(sql)); }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(string sql, Hashtable paramlist = null) { // SqlParameter[] cmdParms = BuildSqlParameters(paramlist); return(DbHelperSQL.Exists(sql, paramlist)); }