?? cuser.cs
字號:
string strSql = "select S_PERMNAME from P$PERMISSION_DICT where c_PermCode='" + moduleCode + "'";
object obj = DB.ExecuteScalar(strSql);
canOperator = obj.ToString();
//判斷是否為空
if (canOperator.Length == 0)
{
canOperator = "''";
}
}
catch
{
}
finally
{
DB.Close();
}
return canOperator;
}
#endregion
#region 獲取模塊名稱列表
/// <summary>
/// <獲取模塊的名稱>
/// GetModuleNames()
/// </獲取模塊的名稱>
/// </summary>
/// <param name="moduleCode">模塊編號</param>
/// <returns>模塊名稱列表</returns>
public static string GetModuleNames(string moduleCode)
{
string moduleName = "";
IDataAccess DB = null;
DataTable dt = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select S_MODULENAME from P$SYS_MODULE_DICT where C_MODULECODE IN(" + moduleCode + ")";
dt = DB.GetDataTableBySQL(strSql);
if (dt != null)
{
foreach (DataRow row in dt.Rows)
{
string name = row["S_MODULENAME"].ToString();
if (moduleName.Length == 0)
{
moduleName = name;
}
else
{
moduleName +="," + name;
}
//table.Add(code, name); //將各個模塊的操作權限裝到HasTable中
}
}
}
catch
{
}
finally
{
DB.Close();
}
return moduleName;
}
#endregion
private static string _Department = string.Empty;
/// <summary>
/// 部門編號,返回員工上級領導編號的同時,返回部門編號
/// Author:wxl
/// Date:2007-04-16
/// </summary>
public static string Department
{
get
{
return _Department;
}
set
{
_Department = value;
}
}
private static string _employeeCode = string.Empty;
/// <summary>
/// 員工編號
/// </summary>
public static string EmployeeCode
{
get
{
return _employeeCode;
}
}
#region 職工的上一級領導編號 GetStuffID
/// <summary>
/// 返回職工的上一級領導
/// </summary>
/// <param name="stuffCode">職工編號</param>
/// <returns>上級領導編號</returns>
public static string GetStuffID(string stuffCode)
{
string leaderID = "";
DataTable dt = null;
IDataAccess DB = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select S_Stuffcode,S_LEADERCODE,S_DEPT,s_cardid,s_branchcode " +
"from p$stuff_dict t where S_STUFFCODE='" + stuffCode + "'";
//object obj = DB.ExecuteScalar(strSql);
dt = DB.GetDataTableBySQL(strSql);
if(dt.Rows.Count !=0)
{
leaderID = dt.Rows[0]["S_LEADERCODE"].ToString();
//_Department = dt.Rows[0]["S_DEPT"].ToString();
_employeeCode = dt.Rows[0]["S_Stuffcode"].ToString();
m_CardID = dt.Rows[0]["s_cardid"].ToString();
//m_FiliationDept = dt.Rows[0]["s_branchcode"].ToString();
}
// leaderID = obj.ToString();
//判斷是否為空
if (leaderID.Length == 0)
{
leaderID = "''";
}
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
DB.Close();
}
return leaderID;
}
/// <summary>
/// 得到部門及分支部門信息
/// </summary>
/// <param name="stuffCode"></param>
public static void GetDepartInfomation(string stuffCode)
{
DataTable dt = null;
IDataAccess DB = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select * from p$sys_user_dict t " +
"where s_stuffcode ='" + stuffCode + "'";
dt = DB.GetDataTableBySQL(strSql);
if(dt.Rows.Count !=0)
{
_Department = dt.Rows[0]["s_deptcode"].ToString();
m_FiliationDept = dt.Rows[0]["s_branchcode"].ToString();
}
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
DB.Close();
}
}
#endregion
/// <summary>
/// 獲取職務ID
/// </summary>
/// <param name="stuffCode">職工編號</param>
/// <returns></returns>
public static string DutyID(string stuffCode)
{
string dutyID = "";
DataTable dt = null;
IDataAccess DB = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select S_DUTY from p$stuff_dict t where S_STUFFCODE='" + stuffCode + "'";
dt = DB.GetDataTableBySQL(strSql);
if(dt.Rows.Count !=0)
{
dutyID = dt.Rows[0]["S_DUTY"].ToString();
}
//判斷是否為空
if (dutyID.Length == 0)
{
dutyID = "''";
}
}
catch { }
finally
{
DB.Close();
}
return dutyID;
}
/// <summary>
/// 顯示職務名稱
/// </summary>
/// <param name="dutyID"></param>
/// <returns></returns>
public static string DutyName(string dutyID)
{
string dutyName = "";
DataTable dt = null;
IDataAccess DB = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select C_DUTYCODE,S_DUTYNAME from B_DUTY_DICT t where C_DUTYCODE='" + dutyID + "'";
//object obj = DB.ExecuteScalar(strSql);
dt = DB.GetDataTableBySQL(strSql);
if(dt.Rows.Count !=0)
{
dutyName = dt.Rows[0]["S_DUTYNAME"].ToString();
}
//判斷是否為空
if (dutyName.Length == 0)
{
dutyName = "''";
}
}
catch { }
finally
{
DB.Close();
}
return dutyName;
}
/// <summary>
/// 通過部門編碼獲得部門名稱
/// </summary>
/// <param name="p_DeptID">部門編碼</param>
/// <returns>部門名稱</returns>
public static string GetDeptName(string p_DeptID)
{
DataTable dt = null;
IDataAccess DB = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select * from p$dept_dict where s_deptcode = '" + p_DeptID + "'";
dt = DB.GetDataTableBySQL(strSql);
if(dt.Rows.Count !=0)
{
m_DeptName = dt.Rows[0]["s_deptname"].ToString();
}
}
catch { }
finally
{
DB.Close();
}
return m_DeptName;
}
/// <summary>
/// 分支部門名稱
/// </summary>
/// <param name="p_FiliationID"></param>
/// <returns></returns>
public static string GetFiliationDept(string p_FiliationID)
{
//p$dept_branch_dict
DataTable dt = null;
IDataAccess DB = null;
try
{
DB = StaticAccess.GetAccess();
DB.Open();
string strSql = "select * from p$dept_branch_dict where s_branchcode = '" + p_FiliationID + "'";
dt = DB.GetDataTableBySQL(strSql);
if(dt.Rows.Count !=0)
{
m_FiliationDeptName = dt.Rows[0]["s_branchdesc"].ToString();
}
}
catch { }
finally
{
DB.Close();
}
return m_FiliationDeptName;
}
/// <summary>
/// 返回職工名稱
/// </summary>
/// <param name="stuffCode">職工編號</param>
/// <returns>職工名稱</returns>
public static string GetEmployeeName(string stuffID)
{
string _StuffName = "";
DataTable dt = null;
try
{
string strSql = "select S_Stuffcode,S_STUFFNAME from p$stuff_dict t where S_STUFFCODE='" + stuffID + "'";
dt = StaticAccess.ReadTable(strSql);
if(dt.Rows.Count !=0)
{
_StuffName = dt.Rows[0]["S_STUFFNAME"].ToString();
}
if (_StuffName.Length == 0)
{
_StuffName = "''";
}
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}
return _StuffName;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -