/// <summary> /// 更新一条Usersupplier记录 /// </summary> /// <param name="usersupplier">Usersupplier对象</param> /// <param name="whLoginID">要查询的仓库的前缀</param> /// <returns>执行更新对数据库影响的行数</returns> public int UpdateUsersupplier(UsersupplierInfo usersupplierInfo) { return usersupplierDA.UpdateUsersupplier(usersupplierInfo); }
/// <summary> /// 新增一条Usersupplier记录 /// </summary> /// <param name="usersupplier">Usersupplier对象</param> /// <param name="whLoginID">要查询的仓库的前缀</param> /// <returns>执行新增对数据库影响的行数</returns> public int InsertUsersupplier(UsersupplierInfo usersupplierInfo) { return usersupplierDA.InsertUsersupplier(usersupplierInfo); }
/// <summary> /// 设置SQL参数表 /// </summary> /// <param name="Usersupplier">Usersupplier对象</param> /// <returns>Usersupplier参数数组</returns> private SqlParameter[] Set_Usersupplier_Parameters(UsersupplierInfo usersupplierInfo) { SqlParameter[] paramArray = new SqlParameter[] {new SqlParameter("@Indx",usersupplierInfo.Indx), new SqlParameter("@UserID",usersupplierInfo.UserID), new SqlParameter("@SupplierID",usersupplierInfo.SupplierID), new SqlParameter("@CreatedBy",string.IsNullOrEmpty(usersupplierInfo.CreatedBy)?"":usersupplierInfo.CreatedBy) }; return paramArray; }
/// <summary> /// 初始化UsersupplierInfo /// </summary> private UsersupplierInfo InitUsersupplierInfoByDataReader(UsersupplierInfo usersupplierInfo, IDataReader reader) { usersupplierInfo = new UsersupplierInfo(reader["Indx"].ToString() != "" ? Int32.Parse(reader["Indx"].ToString()) : 0, reader["UserID"].ToString() != "" ? Int32.Parse(reader["UserID"].ToString()) : 0, reader["SupplierID"].ToString() != "" ? Int32.Parse(reader["SupplierID"].ToString()) : 0, reader["CreatedBy"].ToString(), reader["CreatedDate"].ToString() != "" ? DateTime.Parse(reader["CreatedDate"].ToString()) : new DateTime()); return usersupplierInfo; }
/// <summary> /// 更新一条Usersupplier记录 /// </summary> /// <param name="db">DataBase对象</param> /// <param name="tran">一个有效的DbTransaction</param> /// <param name="usersupplier">Usersupplier对象</param> /// <param name="whLoginID">要查询的仓库的前缀</param> /// <returns>执行更新对数据库影响的行数</returns> public int UpdateUsersupplier(Database db, DbTransaction tran, UsersupplierInfo usersupplierInfo) { int result = 0; SqlParameter[] paras = Set_Usersupplier_Parameters(usersupplierInfo); if (paras != null) { result += DBHelper.ExecuteNonQuery(db, tran, CommandType.Text, SQL_UPDATE_USERSUPPLIER, paras); } return result; }
/// <summary> /// 新增一条Usersupplier记录 /// </summary> /// <param name="usersupplier">Usersupplier对象</param> /// <param name="whLoginID">要查询的仓库的前缀</param> /// <returns>执行新增对数据库影响的行数</returns> public int InsertUsersupplier(UsersupplierInfo usersupplierInfo) { int result = 0; SqlParameter[] paras = Set_Usersupplier_Parameters(usersupplierInfo); if (paras != null) { result = DBHelper.ExecuteNonQuery(CommandType.Text, SQL_INSERT_USERSUPPLIER, paras); } return result; }