DemoDAL/tb_deptclass.cs

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System; 
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic; 
using System.Data;
using Maticsoft.DBUtility;
namespace Maticsoft.DAL  
{
	 	//tb_deptclass
		public partial class tb_deptclass
	{
   		     
		public bool Exists(int id)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from tb_deptclass");
			strSql.Append(" where ");
			                                       strSql.Append(" id = @id  ");
                            			SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
			parameters[0].Value = id;

			return DbHelperSQL.Exists(strSql.ToString(),parameters);
		}
		
				
		
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(Maticsoft.Model.tb_deptclass model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into tb_deptclass(");			
            strSql.Append("deptclaID,deptclaGrade,deptclaName,deptclaPro");
			strSql.Append(") values (");
            strSql.Append("@deptclaID,@deptclaGrade,@deptclaName,@deptclaPro");            
            strSql.Append(") ");            
            strSql.Append(";select @@IDENTITY");		
			SqlParameter[] parameters = {
			            new SqlParameter("@deptclaID", SqlDbType.NVarChar,50) ,            
                        new SqlParameter("@deptclaGrade", SqlDbType.NVarChar,50) ,            
                        new SqlParameter("@deptclaName", SqlDbType.NVarChar,50) ,            
                        new SqlParameter("@deptclaPro", SqlDbType.NVarChar,50)             
              
            };
			            
            parameters[0].Value = model.deptclaID;                        
            parameters[1].Value = model.deptclaGrade;                        
            parameters[2].Value = model.deptclaName;                        
            parameters[3].Value = model.deptclaPro;                        
			   
			object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);			
			if (obj == null)
			{
				return 0;
			}
			else
			{
后面还有 173 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。