示例#1
0
        static void Main(string[] args)
        {
            //连接数据库
            SqlConnection conn = MyHelper.GetConnection();

            DevExpress.Xpo.XpoDefault.DataLayer = CreateThreadSafeDataLayer(conn);
            DevExpress.Xpo.Session.DefaultSession.Connection = conn;

            Console.WriteLine("正在同步薪酬体系....");
            SalaryPlan.SychSalaryPlan();

            Console.WriteLine("正在同步薪等....");
            SalaryGrade.SychSalaryGrade();

            Console.WriteLine("正在同步薪级....");
            SalaryStep.SychSalaryStep();

            Console.WriteLine("正在同步员工基本信息....");
            EmployeeInfo.SychEmployeeInfo();

            Console.WriteLine("正在同步工资表....");
            SalaryResult.SychSalaryResult();

            Console.WriteLine("正在清理无效的月薪记录....");
            MonthlySalary.ClearInvalidRecord();

            Console.WriteLine("正在同步绩效考核结果....");
            KpiItem.SychKpiItem();

            Console.WriteLine("同步完毕!");
            //Console.WriteLine("按任意键退出...");
            //Console.ReadKey(true);
        }
示例#2
0
        public async Task <IActionResult> EditSalaryStep(SalaryStep item)
        {
            var model = await _context.SalarySteps.SingleOrDefaultAsync(b => b.Id == item.Id);

            await TryUpdateModelAsync(model);

            await _context.SaveChangesAsync();

            return(RedirectToAction("SalaryStepsList"));
        }
示例#3
0
        public async Task <IActionResult> AddSalaryStep(SalaryStep item)
        {
            int cnt = await _context.SalarySteps.CountAsync();

            item.Code      = "s" + cnt.ToString();
            item.SortOrder = (cnt + 1) * 10;
            _context.SalarySteps.Add(item);
            await _context.SaveChangesAsync();

            return(RedirectToAction("SalaryStepsList"));
        }
        private void SalaryPlanTree_Load(object sender, EventArgs e)
        {
            CreateWaitDialog("正在加载数据...", "请稍等");

            List <SalaryPlan>  allPlan   = SalaryPlan.薪酬体系表;
            List <SalaryGrade> allGrades = SalaryGrade.当前薪等表;
            List <SalaryStep>  allSteps  = SalaryStep.GetEffectedSteps(DateTime.Today, allGrades);

            var setids = from p in allPlan
                         group p by p.集合 into setid
                         select setid;

            CreateWaitDialog("正在创建薪酬体系树...", "请稍等");

            //生成集合点
            foreach (var setid in setids)
            {
                treeView1.Nodes.Add(setid.Key);
            }

            //生成薪酬体系节点
            foreach (TreeNode node in treeView1.Nodes)
            {
                List <SalaryPlan> salPlans = allPlan.FindAll(a => a.集合 == node.Text);
                foreach (SalaryPlan plan in salPlans)
                {
                    TreeNode planNode = node.Nodes.Add(plan.英文名, plan.中文名);
                    //生成薪等
                    List <SalaryGrade> myGrades = allGrades.FindAll(a => a.集合 == node.Text && a.薪酬体系 == plan.英文名);
                    foreach (SalaryGrade grade in myGrades)
                    {
                        TreeNode gradeNode = planNode.Nodes.Add(grade.薪等编号, grade.薪等名称);
                        //生成薪级
                        List <SalaryStep> mySteps = allSteps.FindAll(a => a.集合 == node.Text && a.薪酬体系 == plan.英文名 && a.薪等编号 == grade.薪等编号);
                        foreach (SalaryStep step in mySteps)
                        {
                            TreeNode stepNode = gradeNode.Nodes.Add(step.薪级编号.ToString(), step.薪级名称);
                        }
                    }
                }
            }

            CloseWaitDialog();

            treeView1.ExpandAll();
        }
        private void btn同步员工信息_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("同步需要几分钟甚至更长,过程中请不可进行其他操作,确实要立即同步吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes)
            {
                CreateWaitDialog("正在同步薪酬体系....", "请稍等");
                SalaryPlan.SychSalaryPlan();

                CreateWaitDialog("正在同步薪等....", "请稍等");
                SalaryGrade.SychSalaryGrade();

                CreateWaitDialog("正在同步薪级....", "请稍等");
                SalaryStep.SychSalaryStep();

                CreateWaitDialog("正在同步员工基本信息....", "请耐心等待");
                EmployeeInfo.SychEmployeeInfo();

                CloseWaitDialog();
            }
        }