- using System;
- using System.Data;
- using System.Data.SqlClient;
- using qminoa.Common.Data;
- using qminoa.DA;
- namespace qminoa.BLL
- {
- public class EmpSystem
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="conID"></param>
- /// <returns></returns>
- public DataTable GetEmpConTB_By_ConID(int conID)
- {
- DataTable conTB ;
- using(MrBaseInf empAccess = new MrBaseInf())
- {
- conTB = empAccess.GetEmpConData_By_ConID(conID).Tables[0];
- }
- return conTB;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateMrContact(EmpConData empData)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateMrContact(empData);
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool InsertMrContact(EmpConData empData)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.InsertMrContact(empData);
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="conID"></param>
- /// <returns></returns>
- public bool DeleteMrContact(int conID)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.DeleteMrContact(conID);
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="empID"></param>
- /// <returns></returns>
- public DataTable GetEmpConTB(int empID)
- {
- DataTable table ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- table = EmpAccess.GetEmpConData(empID).Tables[0];
- }
- return table;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool InsertMrArchive(EmpArcData empData)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.InsertMrArchive(empData);
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateMrArchive(EmpArcData empData)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateMrArchive(empData);
- }
- return result;
- }
- /// <summary>
- /// 获得指定用户的指定的档案信息
- /// </summary>
- /// <param name="arcID"></param>
- /// <returns></returns>
- public DataTable GetEmpArcTB_By_ArcID(int arcID)
- {
- DataTable table;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- table = EmpAccess.GetEmpArcData_By_ArcID(arcID).Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 删除指定用户的档案
- /// </summary>
- /// <param name="arcID"></param>
- /// <returns></returns>
- public bool DeleteMrArchive(int arcID)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.DeleteMrArchive(arcID);
- }
- return result;
- }
- /// <summary>
- /// 更新指定的用户的履历
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateMrVita(EmpVisaData empData)
- {
- bool result ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateMrVita(empData);
- }
- return result;
- }
- /// 添加新的履历给指定的用户
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool InsertMrVita(EmpVisaData empData)
- {
- bool result ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.InsertMrVita(empData);
- }
- return result;
- }
- /// <summary>
- /// 删除指定的用户的履历
- /// </summary>
- /// <param name="visaID"></param>
- /// <returns></returns>
- public bool DeleteMrVita(int visaID)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.DeleteMrVita(visaID);
- }
- return result;
- }
- /// <summary>
- /// 获取指定用户的档案列表
- /// </summary>
- /// <param name="empID"></param>
- /// <returns></returns>
- public DataTable GetEmpArcTB(int empID)
- {
- DataTable table ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- table = EmpAccess.GetEmpArcData(empID).Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 更新指定用户的学历信息
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateEmpEduInf(EmpBaseData empData)
- {
- bool result ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateEmpEduInf(empData);
- }
- return result ;
- }
- /// <summary>
- /// 获取指定用户的指定的履历信息
- /// </summary>
- /// <param name="visaID"></param>
- /// <returns></returns>
- public DataTable GetEmpVisaTB_By_VisaID(int visaID)
- {
- DataTable table ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- table = EmpAccess.GetEmpVisaData_By_VisaID(visaID).Tables[0];
- }
- return table;
- }
- /// <summary>
- /// 获取指定用户的履历列表
- /// </summary>
- /// <param name="empID"></param>
- /// <returns></returns>
- public DataTable GetEmpVisaTB(int empID)
- {
- DataTable empTB;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- empTB = EmpAccess.GetEmpVisaData(empID).Tables[0];
- }
- return empTB;
- }
- /// <summary>
- /// 获取所有被停用账号的用户的信息
- /// </summary>
- /// <returns></returns>
- public DataTable GetEmpTBStoped()
- {
- DataTable empTB;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- empTB = EmpAccess.GetEmpDataStoped().Tables[0];
- }
- return empTB;
- }
- /// <summary>
- /// 更新用户的个人信息
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateEmpPersInf(EmpBaseData empData)
- {
- bool result ;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateEmpPersInf(empData);
- }
- return result;
- }
- /// <summary>
- /// 更新用户的福利信息信息
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateEmpWelInf(EmpBaseData empData)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateEmpWelInf(empData);
- }
- return result;
- }
- /// <summary>
- /// 获取符合条件的用户的照片信息
- /// </summary>
- /// <param name="branchID"></param>
- /// <param name="depID"></param>
- /// <param name="empName"></param>
- /// <returns></returns>
- public DataTable GetEmpPhotoTB_By_QueryStr(string branchID,string depID,string empName)
- {
- //读取人员信息数据
- DataTable empTB = GetEmpTB_By_QueryStr(branchID,depID,empName);
- //创建数据结构表
- DataTable photoTB = (new EmpPhotoData()).Tables[EmpPhotoData.EMPPHOTO_TABLE_NAME];
- DataRowCollection empRows = empTB.Rows;
- DataRow photoRow = null;
- //此变量控件列序号
- int j = 0;
- //循环读取人员照片信息
- for(int i=0;i<empRows.Count;i++)
- {
- //判断行是否结束
- if(j%5==0)
- {
- //判断是否是第一次循环
- if(j>0)
- {
- photoTB.Rows.Add(photoRow);
- }
- photoRow = photoTB.NewRow();
- //行结束,列序号重置为0
- j = 0;
- }
- //将数据库中的照片数据进行转换,并在每张照片加上到人员详细信息的页面超链接
- if(empRows[i][EmpBaseData.PHOTO_SIZE_FIELD]!=DBNull.Value)
- {
- photoRow[j] = "<a href=empbase.aspx?empid="+empRows[i][EmpBaseData.EMPID_FIELD].ToString()+" title=显示人员详细信息><img src=emppicdown.aspx?EmpID="+empRows[i][EmpBaseData.EMPID_FIELD].ToString()+" border=0 ></a><br><a href=empbase.aspx?empid="+empRows[i][EmpBaseData.EMPID_FIELD].ToString()+" title=显示人员详细信息>"+empRows[i][EmpBaseData.EMPNAME_FIELD].ToString()+"</a>";
- }
- //如果数据库在照片数据为空时,显示缺省图片
- else
- {
- photoRow[j] = "<a href=empbase.aspx?empid="+empRows[i][EmpBaseData.EMPID_FIELD].ToString()+" title=显示人员详细信息><img src=../img/logo2.jpg border=0 ></a><br><a href=empbase.aspx?empid="+empRows[i][EmpBaseData.EMPID_FIELD].ToString()+" title=显示人员详细信息>"+empRows[i][EmpBaseData.EMPNAME_FIELD].ToString()+"</a>";
- }
- //列序号加1
- j++;
- //如果最后一行不满5,直接显示
- if(i==empRows.Count-1)
- {
- photoTB.Rows.Add(photoRow);
- }
- }
- //返回处理后的照片数据表
- return photoTB;
- }
- /// <summary>
- /// 获取符合条件的用户的信息
- /// </summary>
- /// <param name="branchID">机构ID号</param>
- /// <param name="depID">部门ID号</param>
- /// <param name="empName">用户姓名</param>
- /// <returns></returns>
- public DataTable GetEmpTB_By_QueryStr(string branchID,string depID,string empName)
- {
- DataTable empTB;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- empTB = EmpAccess.GetEmpData_By_QueryStr(branchID,depID,empName).Tables[0];
- }
- return empTB;
- }
- /// <summary>
- /// 获取指定ID的用户的信息
- /// </summary>
- /// <param name="empID"></param>
- /// <returns></returns>
- public DataTable GetEmpTB_By_EmpID(int empID)
- {
- DataTable empTB ;
- using(MrBaseInf empAccess = new MrBaseInf())
- {
- empTB = empAccess.GetEmpBaseData_By_EmpID(empID).Tables[0];
- }
- return empTB;
- }
- /// <summary>
- /// 更新用户的信息
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public bool UpdateEmp(EmpBaseData empData)
- {
- bool result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.UpdateMrBaseInf(empData);
- }
- return result ;
- }
- /// <summary>
- /// 建立一个新的用户
- /// </summary>
- /// <param name="empData"></param>
- /// <returns></returns>
- public int CreateEmp(EmpBaseData empData)
- {
- int result;
- using(MrBaseInf EmpAccess = new MrBaseInf())
- {
- result = EmpAccess.InsertMrBaseInf(empData);
- }
- return result ;
- }
- /// <summary>
- /// 获得指定用户的照片
- /// </summary>
- /// <param name="empID"></param>
- /// <returns></returns>
- public DataTable GetEmpPicTB(int empID)
- {
- DataTable table;
- using(MrBaseInf PhotoAccess = new MrBaseInf())
- {
- table = PhotoAccess.GetEmpPicData(empID).Tables[0];
- }
- return table;
- }
- public EmpSystem()
- {
- }
- }
- }