Ejemplo n.º 1
0
        private void btnCreateSalarySheet_Click(object sender, RoutedEventArgs e)
        {
            int  year   = (int)cmbYear.SelectedItem;
            int  month  = (int)cmbMonth.SelectedItem;
            Guid DeptId = (Guid)cmbDept.SelectedValue;

            if (SalarySheetDAL.IsExist(year, month, DeptId))
            {
                if (MessageBox.Show("工资表已存在,是否重新生成?", "提示",
                                    MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    SalarySheetDAL.DeleteSalarySheet(year, month, DeptId);
                }
                SalarySheetDAL.Build(year, month, DeptId);
                //MessageBox.Show("生成成功!");
                colEmployee.ItemsSource         = EmployeeDAL.GetEmployeeByDept(DeptId);
                dataGridSalaryItems.ItemsSource = SalarySheetDAL.GetSalarySheetItem(year, month, DeptId);
            }
        }
Ejemplo n.º 2
0
        private void btnCreateSalarySheet_Click(object sender, RoutedEventArgs e)
        {
            int            year   = (int)cmbYear.SelectedValue;
            int            month  = (int)cmbMonth.SelectedValue;
            Guid           deptId = (Guid)cmbDept.SelectedValue;
            SalarySheetDAL dal    = new SalarySheetDAL();

            if (dal.IsExists(year, month, deptId))
            {
                if (MessageBox.Show("工资单已经生成,是否重新生成?",
                                    "提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    dal.Clear(year, month, deptId);
                }
            }
            dal.Build(year, month, deptId);

            colEmployee.ItemsSource = new EmployeeDAL().ListByDepment(deptId);

            datagridItems.ItemsSource = new SalarySheetDAL().GetSalarySheetItems(
                year, month, deptId);
        }