Beispiel #1
0
        public static string GetGrade1(SalaryResult sr)
        {
            //有二级分类的职务等级
            string JOB_HAS_SECONDARY = "主任|副主任|工程师|班长|";

            try
            {
                if (sr.职等名称 == null)
                {
                    return(null);
                }

                //职等默认等于职务等级
                string grade = GetGrade(sr.职等名称);

                if (JOB_HAS_SECONDARY.IndexOf(grade + "|") == -1)
                {
                    return(grade);
                }
                else
                {
                    DeptInfo dept = sr.所在机构.部门;
                    //如果找不到部门
                    if (dept == null)
                    {
                        return(grade);
                    }

                    //获取部门板块属性
                    string fun = dept.职能类型;

                    //获取班长岗位级别
                    string level = "";
                    if (sr.所在机构.车间 != null)
                    {
                        MonitorLevel mv = MonitorLevel.Get(sr.所在机构.车间.部门编号, sr.职务代码);
                        if (mv != null)
                        {
                            level = mv.级别名称;
                        }
                    }

                    if (level == "")
                    {
                        return(fun + grade);
                    }
                    else
                    {
                        return(level + grade);
                    }
                }
            }
            catch (Exception err)
            {
                Common.WriteLog(Environment.CurrentDirectory + "\\LogFiles\\Error.log", err.ToString());
            }
            return(null);
        }
        //获取值列表
        public static List <MonitorLevel> GetAll()
        {
            List <MonitorLevel> list = new List <MonitorLevel>();
            OleDbConnection     conn = new OleDbConnection(MyHelper.GetPsConnectionString());

            using (conn)
            {
                OleDbDataReader rs = null;
                try
                {
                    conn.Open();
                    using (OleDbCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandText = "SELECT COMPANY, DEPTID, JOBCODE, C_MONITOR_LVL FROM SYSADM.PS_C_MNT_LVL_TBL A WHERE A.EFFDT=(SELECT MAX(B.EFFDT) FROM SYSADM.PS_C_MNT_LVL_TBL B WHERE A.COMPANY=B.COMPANY AND A.DEPTID=B.DEPTID AND A.JOBCODE=B.JOBCODE AND B.EFFDT<=SYSDATE )AND A.C_SIGN_TIMES=2";
                        rs = cmd.ExecuteReader();
                        while (rs.Read())
                        {
                            MonitorLevel dept = new MonitorLevel();

                            dept.公司编号 = (string)rs["COMPANY"];
                            dept.部门编号 = (string)rs["DEPTID"];
                            dept.职务代码 = (string)rs["JOBCODE"];
                            dept.级别编号 = (string)rs["C_MONITOR_LVL"];
                            dept.级别名称 = PsHelper.GetMonitorLevelName(dept.级别编号);

                            list.Add(dept);
                        }
                        rs.Close();
                    }
                }
                finally
                {
                    if (rs != null)
                    {
                        rs.Close();
                    }
                    conn.Close();
                }
            }
            return(list);
        }