系统分析与设计
(@yhId,@yhName,@yhSex,@yhTitle,@yhSpeciality,@yhContent,@yhPhone)\;
SqlParameter[] paras = new SqlParameter[]{ new SqlParameter(\,yh.Id), new SqlParameter(\,yh.Name), new SqlParameter(\,yh.Sex), new SqlParameter(\,yh.Title),
new SqlParameter(\,yh.Speciality), new SqlParameter(\,yh.Content), new SqlParameter(\,yh.Phone) }; int res = sqlhelper.ExecuteNonQuery(sql, paras,CommandType.Text); if (res > 0) {
flag = true; }
return flag; }
///
///
public bool Delete(string id) {
bool flag = false;
string sql = \; SqlParameter[] paras = new SqlParameter[]{ new SqlParameter(\,id) }; int res = sqlhelper.ExecuteNonQuery(sql, paras,CommandType.Text); if (res > 0) {
flag = true; }
return flag; } } }
2.2.3、 BLL层实现具体业务逻辑 /*
* 王溢文
21
系统分析与设计
* 招聘行业类别表的业务类 */
using System;
using System.Collections.Generic; using System.Linq; using System.Text; using DAL; using Model;
using System.Data;
using System.Data.SqlClient;
namespace BLL {
public class CategoryManager {
private CategoryDAO cdao = null; public CategoryManager() {
cdao = new CategoryDAO(); }
#region 取出当前所有行业分类
///
/// 取出当前所有行业分类 ///
///
public DataTable SelectAll() {
return cdao.SelectAll(); }
#endregion
#region 增加分类 ///
/// ///
public bool Insert(string caName) {
return cdao.Insert(caName);
22
系统分析与设计
}
#endregion
#region 删除分类 ///
/// 删除分类(连同其下招聘信息及询问一起删除) ///
///
public bool Delete(string id) {
return cdao.Delete(id); }
#endregion
#region 修改分类 ///
///
/// ///
public bool Update(Category ca) {
return cdao.Update(ca); }
#endregion
#region 判断该类别是否存在 ///
/// 判断该类别是否存在 ///
/// ///
public bool IsExists(string caName) {
return cdao.IsExists(caName); }
23
系统分析与设计
#endregion
} } /*
*招聘信息询问类别表的BLL层 *王溢文 */
using System;
using System.Collections.Generic; using System.Linq; using System.Text; using DAL; using Model;
using System.Data;
using System.Data.SqlClient;
namespace BLL {
public class CommentManager {
private CommentDAO codao = null; public CommentManager() {
codao = new CommentDAO(); }
#region 根据招聘信息ID取出所有针对该信息的询问记录 ///
/// 根据招聘信息ID取出所有针对该信息的询问记录 ///
/// ///
public DataTable SelectByNewsId(string newsId) {
return codao.SelectByNewsId(newsId); }
#endregion
#region 根据用户信息ID取出所有针对该用户的询问记录 ///
/// 根据用户信息ID取出所有针对该用户的询问记录
24
系统分析与设计
///
///
public DataTable SelectByUserId(string userId) {
return codao.SelectByUserId(userId); }
#endregion
#region 增加询问记录 ///
///
public bool Insert(Comment xw) {
return codao.Insert(xw); }
#endregion
#region 删除询问记录 ///
///
public bool Delete(string id) {
return codao.Delete(id); }
#endregion } } /*
*注册公司管理表的操作类BLL层 *王溢文 */
using System;
using System.Collections.Generic; using System.Linq; using System.Text; using DAL;
25