Exemplo n.º 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);
        }
        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();
            }
        }