⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cuser.cs

📁 数据操作WEBSERVER,支持代码直接访问数据库和传输数据
💻 CS
📖 第 1 页 / 共 2 页
字号:
				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 + -