/// <summary>
        /// 同步薪酬体系
        /// </summary>
        public static void SychSalaryPlan()
        {
            //添加所有PS中存在的记录
            foreach (SalPlan sp in SalPlan.薪酬体系)
            {
                AddSalaryPlan(sp.集合, sp.英文名, sp.中文名, sp.状态);
            }
            //冲突处理:有VS无 / 有VS变 / 无VS有
            List <SalaryPlan> all = GetAll();

            foreach (SalaryPlan plan in all)
            {
                SalPlan sp = SalPlan.薪酬体系.Find(a => a.集合 == plan.集合 && a.英文名 == plan.英文名);
                if (sp == null)
                {
                    plan.Delete();
                }
            }
        }
Exemple #2
0
        //获取值列表
        public static List <SalPlan> GetAll()
        {
            List <SalPlan>  list = new List <SalPlan>();
            OleDbConnection conn = new OleDbConnection(MyHelper.GetPsConnectionString());

            using (conn)
            {
                OleDbDataReader rs = null;
                try
                {
                    conn.Open();
                    using (OleDbCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandText = "select setid, sal_admin_plan, descr, effdt, eff_status from SYSADM.PS_SAL_PLAN_TBL order by setid, sal_admin_plan";
                        rs = cmd.ExecuteReader();
                        while (rs.Read())
                        {
                            SalPlan salPlan = new SalPlan();
                            salPlan.集合  = (string)rs["setid"];
                            salPlan.英文名 = (string)rs["sal_admin_plan"];
                            salPlan.中文名 = (string)rs["descr"];
                            salPlan.状态  = ((string)rs["eff_status"]).Trim();
                            list.Add(salPlan);
                        }
                    }
                }
                finally
                {
                    if (rs != null)
                    {
                        rs.Close();
                    }
                    conn.Close();
                }
            }
            return(list);
        }