Ejemplo n.º 1
0
        /// <summary>
        /// 获取个人信息
        /// </summary>
        /// <param name="userNo">人员编号</param>
        /// <returns>个人信息Port_Emp表里的所有字段信息。</returns>
        public static Hashtable GetEmpInfo(string userNo)
        {
            //设置用户ID
            Set_Port_Emp_SID(userNo);
            //查询出来个人信息。
            CCPortal.DA.Paras ps = new DA.Paras();
            ps.SQL = "SELECT * FROM Port_Emp WHERE No =" + SystemConfig.AppCenterDBVarStr + "No";
            ps.Add("No", userNo);
            DataTable dt = CCPortal.DA.DBAccess.RunSQLReturnTable(ps);

            //把数据放在ht里面。
            Hashtable ht = new Hashtable();

            if (dt != null && dt.Rows.Count > 0)
            {
                //调用查询日志

                foreach (DataColumn item in dt.Columns)
                {
                    ht.Add(item.ColumnName, dt.Rows[0][item.ColumnName]);
                }

                //查询用户的职务级别
                ps     = new DA.Paras();
                ps.SQL = "SELECT * FROM Port_DeptEmp WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp order by DutyLevel";
                ps.Add("FK_Emp", userNo);
                DataTable dt_Duty = CCPortal.DA.DBAccess.RunSQLReturnTable(ps);
                //判断数据是否存在
                if (dt_Duty != null && dt_Duty.Rows.Count > 0)
                {
                    ht.Add("DutyLevel", dt_Duty.Rows[0]["DutyLevel"].ToString());
                }
            }
            return(ht);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 根据部门编号获取部门下的人员
 /// </summary>
 /// <param name="deptNo"></param>
 /// <returns></returns>
 public static DataTable GetEmpOfDataTableByDeptNo(string deptNo)
 {
     CCPortal.DA.Paras ps = new DA.Paras();
     ps.SQL = "SELECT a.* FROM Port_Emp a,Port_DeptEmp b WHERE a.No=b.FK_Emp AND b.FK_Dept=" + SystemConfig.AppCenterDBVarStr + "FK_Dept";
     ps.Add("FK_Dept", deptNo);
     return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 按datatable的方式,返回用户的岗位
 /// </summary>
 /// <param name="userNo">用户编号</param>
 /// <returns>菜单:它的列与GPM数据库中的表Port_Station一致.</returns>
 public static DataTable GetUserStationsOfDatatable(string userNo)
 {
     CCPortal.DA.Paras ps = new DA.Paras();
     ps.SQL = "SELECT * FROM Port_Station WHERE No IN (SELECT FK_Station FROM Port_DeptEmpStation WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp)";
     ps.Add("FK_Emp", userNo);
     return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 根据部门编号获取部门信息
 /// </summary>
 /// <returns></returns>
 public static DataTable GetDeptOfDataTableByNo(string deptNo)
 {
     CCPortal.DA.Paras ps = new DA.Paras();
     ps.SQL = "SELECT * FROM Port_Dept WHERE No=" + SystemConfig.AppCenterDBVarStr + "No";
     ps.Add("No", deptNo);
     return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 按datatable的方式,返回用户菜单
 /// 根据这个菜单结构,形成自己的菜单树。
 /// </summary>
 /// <param name="userNo">用户编号</param>
 /// <returns>菜单:它的列与GPM数据库中的表GPM_EmpMenu一致.</returns>
 public static DataTable GetUserMenuOfDatatable(string userNo)
 {
     CCPortal.DA.Paras ps = new DA.Paras();
     ps.SQL = "SELECT * FROM V_GPM_EmpMenu WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr
              + "FK_Emp AND FK_App=" + SystemConfig.AppCenterDBVarStr + "FK_App ORDER BY Idx";
     ps.Add("FK_Emp", userNo);
     ps.Add("FK_App", API.CurrApp.No);
     return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据配置文件中的 FK_Dept_No 部门编号获取子部门
        /// </summary>
        /// <returns></returns>
        public static DataTable GetDeptOfDataTable()
        {
            string fk_Dept = SystemConfig.AppSettings["CCPortal.FK_Dept_No"];

            CCPortal.DA.Paras ps = new DA.Paras();
            ps.SQL = "SELECT * FROM Port_Dept WHERE ParentNo=" + SystemConfig.AppCenterDBVarStr + "ParentNo ORDER BY Idx";
            ps.Add("ParentNo", fk_Dept);
            return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 根据部门编号获取子级部门
        /// </summary>
        /// <returns></returns>
        public static DataTable GetChildDeptOfDataTableByParentNo(string deptNo)
        {
            if (string.IsNullOrEmpty(deptNo))
            {
                return(null);
            }

            CCPortal.DA.Paras ps = new DA.Paras();
            ps.SQL = "SELECT * FROM Port_Dept WHERE ParentNo=" + SystemConfig.AppCenterDBVarStr + "ParentNo ORDER BY Idx";
            ps.Add("ParentNo", deptNo);
            return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 检查是否可以使用该权限
        /// </summary>
        /// <param name="userNo">用户编号</param>
        /// <param name="funcNo">功能编号</param>
        /// <returns>返回是否可以使用该权限</returns>
        public static bool IsCanUseFunc(string userNo, string funcNo)
        {
            CCPortal.DA.Paras ps = new DA.Paras();
            ps.SQL = "SELECT * FROM V_GPM_EmpMenu WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp AND FK_App=" + SystemConfig.AppCenterDBVarStr + "FK_App AND FK_Menu=" + SystemConfig.AppCenterDBVarStr + "FK_Menu ";
            ps.Add("FK_Emp", userNo);
            ps.Add("FK_App", API.CurrApp.No);
            ps.Add("FK_Menu", funcNo);
            DataTable dt = CCPortal.DA.DBAccess.RunSQLReturnTable(ps);

            if (dt.Rows.Count == 0)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 根据用户编号、菜单父编号和是否显示功能点获取菜单项
 /// </summary>
 /// <param name="userNo">用户账号</param>
 /// <param name="menuNO">菜单编号</param>
 /// <param name="isVisibleFunPoint">是否显示功能点;true 显示,false 不显示</param>
 /// <returns></returns>
 public static DataTable GetMenu_ChildNode_Datatable_ByMenuNo(string userNo, string menuNO, bool isVisibleFunPoint)
 {
     CCPortal.DA.Paras ps = new DA.Paras();
     ps.SQL = "SELECT * FROM V_GPM_EmpMenu WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp AND ParentNo=" + SystemConfig.AppCenterDBVarStr
              + "ParentNo AND FK_App=" + SystemConfig.AppCenterDBVarStr + "FK_App ORDER BY Idx";
     //不显示功能点
     if (!isVisibleFunPoint)
     {
         ps.SQL = "SELECT * FROM V_GPM_EmpMenu WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp AND ParentNo=" + SystemConfig.AppCenterDBVarStr
                  + "ParentNo AND FK_App=" + SystemConfig.AppCenterDBVarStr + "FK_App AND MenuType <> 5 ORDER BY Idx";
     }
     ps.Add("FK_Emp", userNo);
     ps.Add("FK_App", API.CurrApp.No);
     ps.Add("ParentNo", menuNO);
     return(CCPortal.DA.DBAccess.RunSQLReturnTable(ps));
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 查询该系统
        /// </summary>
        /// <returns></returns>
        public int QueryIt()
        {
            string appNo = CCPortal.SystemConfig.AppSettings["CCPortal.AppNo"];

            CCPortal.DA.Paras ps = new DA.Paras();
            ps.SQL = "SELECT * FROM GPM_App WHERE No=" + SystemConfig.AppCenterDBVarStr + "No";
            ps.Add("No", appNo);
            DataTable dt = CCPortal.DA.DBAccess.RunSQLReturnTable(ps);

            if (dt.Rows.Count == 0)
            {
                throw new Exception("@配置的系统编号(" + appNo + ")在GPM中不存在.");
            }

            //把数据赋值.
            this.Row = new Hashtable();
            foreach (DataColumn dc in dt.Columns)
            {
                this.Row.Add(dc.ColumnName.ToUpper(), dt.Rows[0][dc.ColumnName]);
            }
            return(1);
        }