📄 employee.cs
字号:
using System;
using System.Data;
namespace PMS.Components
{
/// <summary>
/// Employee 的摘要说明。
/// </summary>
public class Employee
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public DataTable GetEmployee()
{
try
{
PMS.Common.DataAccess DataAs = new PMS.Common.DataAccess() ;
DataTable DT = DataAs.CreateDataTable("select * from [Employee]") ;
return(DT) ;
}
catch(Exception ex)
{
PMS.Common.SystemError.SystemLog(ex.Message) ;
throw new Exception(ex.Message,ex) ;
}
}
/// <summary>
///
/// </summary>
/// <param name="EmployeeID"></param>
/// <returns></returns>
public DataTable GetEmployee(string EmployeeID)
{
try
{
PMS.Common.DataAccess DataAs = new PMS.Common.DataAccess() ;
DataTable DT = DataAs.CreateDataTable("select * from [Employee] where EmployeeID='"+EmployeeID+"'") ;
return(DT) ;
}
catch(Exception ex)
{
PMS.Common.SystemError.SystemLog(ex.Message) ;
throw new Exception(ex.Message,ex) ;
}
}
/// <summary>
///
/// </summary>
/// <param name="strSql"></param>
/// <returns></returns>
public bool AddEmployee(string strSql)
{
try
{
PMS.Common.DataAccess DataAs = new PMS.Common.DataAccess() ;
bool bResult = DataAs.ExecSql(strSql) ;
return(bResult) ;
}
catch(Exception ex)
{
PMS.Common.SystemError.SystemLog(ex.Message) ;
throw new Exception(ex.Message,ex) ;
}
}
/// <summary>
///
/// </summary>
/// <param name="EmployeeID"></param>
/// <returns></returns>
public bool DeleteEmployee(string EmployeeID)
{
try
{
PMS.Common.DataAccess DataAs = new PMS.Common.DataAccess() ;
bool bResult = DataAs.ExecSql("delete from [Employee] where EmployeeID = '"+EmployeeID+"'") ;
return(bResult) ;
}
catch(Exception ex)
{
PMS.Common.SystemError.SystemLog(ex.Message) ;
throw new Exception(ex.Message,ex) ;
}
}
/// <summary>
///
/// </summary>
/// <param name="UserID"></param>
/// <param name="sPwd"></param>
/// <returns></returns>
public bool UpdateEmployee(string strSql)
{
try
{
PMS.Common.DataAccess DataAs = new PMS.Common.DataAccess() ;
bool bResult = DataAs.ExecSql(strSql) ;
return(bResult) ;
}
catch(Exception ex)
{
PMS.Common.SystemError.SystemLog(ex.Message) ;
throw new Exception(ex.Message,ex) ;
}
}
/// <summary>
///
/// </summary>
/// <param name="DepartID"></param>
/// <returns></returns>
public bool IsUnique(string EmployID)
{
DataTable DT = GetEmployee(EmployID);
if(DT.Rows.Count == 0)
{
return true ;
}
else
{
return false ;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -