/// <summary> /// 实现IOccupationBLL接口 /// </summary> /// <param name="occupationName">需要保存的职位</param> /// <returns>返回是否成功的布尔值</returns> public bool SaveOccupationName(OccupationName occupationName) { //throw new System.NotImplementedException(); IOccupationNameDAL dAL = new OccupationNameDAL(); //检查是否有记录存在 if (dAL.QueryById(occupationName.Id) != null) { if (dAL.Update(occupationName) > 0) { return(true); } else { return(false); } } else { if (dAL.Add(occupationName) > 0) { return(true); } else { return(false); } } }
/// <summary> /// 通过职位类型的id获取所有职位 /// </summary> /// <param name="classId">职位类型的id</param> /// <returns>List类型,所有该类型下的职位</returns> public List <OccupationName> GetAllOccNameByClassId(int classId) { //throw new System.NotImplementedException(); IOccupationNameDAL dAL = new OccupationNameDAL(); return(dAL.GetAllOccNameByClassId(classId)); }
public OccupationName GetOccupationNameByNameAndClass(string name, int classId) { //throw new System.NotImplementedException(); OccpationClassName IOccupationNameDAL dAL = new OccupationNameDAL(); return(dAL.GetOccupationNameByNameAndClass(name, classId)); }
/// <summary> /// 实现IOccupationBLL接口 /// </summary> /// <param name="id">主键id</param> /// <returns>返回id对应的职位名称</returns> public OccupationName GetOccupationNameById(int id) { //throw new NotImplementedException(); IOccupationNameDAL dAL = new OccupationNameDAL(); return(dAL.QueryById(id)); }
/// <summary> /// 实现IOccupationBLL接口 /// </summary> /// <returns>返回所有职位名称,List类型</returns> public List <OccupationName> GetAllOccupationName() { //throw new NotImplementedException(); IOccupationNameDAL dAL = new OccupationNameDAL(); return(dAL.Query()); }
/// <summary> /// 实现IOccupationBLL接口,通过id删除职位 /// </summary> /// <param name="id">主键id</param> /// <returns>返回是否成功的布尔值</returns> public bool DeleteOccupationNameById(int id) { //throw new System.NotImplementedException(); IOccupationNameDAL dAL = new OccupationNameDAL(); if (dAL.Remove(id) > 0) { return(true); } else { return(false); } }