using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.SqlClient; using CY.IDAL; using CY.Model; using AbstractFactory; using CY.IBaseDAL; using CY.Infrastructure.DESEncrypt; using CY.Infrastructure.Query; namespace CY.BLL { public class OA_StaffBLL { IOA_StaffDAL idal_IOA_StaffDAL = null; public OA_StaffBLL() { idal_IOA_StaffDAL = Factory.GetDALByInterfaceName(DALInterface.IOA_StaffDAL) as IOA_StaffDAL; } /// /// 添加 /// /// /// public bool InsertModel(Model.OA_Staff model) { return idal_IOA_StaffDAL.InserModel(model); } /// /// 更新 /// /// /// public bool UpdateModel(Model.OA_Staff model) { return idal_IOA_StaffDAL.UpdateModel(model); } /// /// 删除 /// /// /// public bool DeleteModel(Model.OA_Staff model) { return idal_IOA_StaffDAL.DeleteModel(model); } /// /// 根据编号获得信息 /// /// 编号 /// public OA_Staff GetModelByKeyid(int? Keyid) { return idal_IOA_StaffDAL.GetModelByKeyid(Keyid); } /// /// 分页查询 /// /// /// /// /// /// /// public IEnumerable SelectModelPage(Infrastructure.Query.Pagination pagination, int? DepartmentId, Guid MemberId, string MemberName, string Status) { var ssss = idal_IOA_StaffDAL.SelectModelPage(pagination, DepartmentId, MemberId, MemberName, Status); OA_FirmRoleBLL bll_OA_FirmRoleBLL = new OA_FirmRoleBLL(); foreach (var oA_Staff in ssss) { var sss = bll_OA_FirmRoleBLL.SelectOA_StaffRoleRel(oA_Staff.Keyid); if(sss != null) { var ssssss = bll_OA_FirmRoleBLL.SelectModel(sss.RoleId); if (ssssss != null) { oA_Staff.RoleName = ssssss.RoleName; } } } return ssss; } /// /// 更新员工信息 /// /// /// /// public bool UpdateStaff(OA_Staff m_OA_Staff, EC_MemberBasic m_EC_MemberBasic, OA_StaffRoleRel m_OA_StaffRoleRel) { return idal_IOA_StaffDAL.UpdateStaff(m_OA_Staff, m_EC_MemberBasic, m_OA_StaffRoleRel); } /// /// 添加员工信息 /// /// /// /// public bool AddStaff(OA_Staff m_OA_Staff, EC_MemberBasic m_EC_MemberBasic, OA_StaffRoleRel m_OA_StaffRoleRel) { return idal_IOA_StaffDAL.AddStaff(m_OA_Staff, m_EC_MemberBasic, m_OA_StaffRoleRel); } /// /// 根据员工会员编号获得信息 /// /// 编号 /// public OA_Staff GetModelByMemberId(Guid MemberId) { return idal_IOA_StaffDAL.GetModelByMemberId(MemberId); } /// /// 根据厂商编号获取员工列表 /// /// /// /// /// public IEnumerable SelectListByFirmId(Guid FirmId, bool? IsBusinessManager, bool? IsAccountManager) { return idal_IOA_StaffDAL.SelectListByFirmId(FirmId, IsBusinessManager, IsAccountManager); } /// /// 检测员工姓名是否重复 /// /// /// /// public int IsExitsName(string Name, Guid MemberId) { return idal_IOA_StaffDAL.IsExitsName(Name,MemberId); } /// /// 根据部门获取员工 /// /// public DataTable GetStaffByDep(Guid FirmId,string DepartmentId) { return idal_IOA_StaffDAL.GetStaffByDep(FirmId,DepartmentId); } /// /// 生日提醒 /// /// /// /// /// /// /// public IEnumerable BirthdayRemind(Infrastructure.Query.Pagination pagination, int? DepartmentId, Guid MemberId, string MemberName, string Status) { return idal_IOA_StaffDAL.BirthdayRemind(pagination, DepartmentId, MemberId, MemberName, Status); } } }