コード例 #1
0
ファイル: ClosingPeriodUI.cs プロジェクト: neonerdy/paycare
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Anda yakin ingin menutup Periode : " + Store.GetMonthName(Store.ActiveMonth) + " " + Store.ActiveYear + "'", "Perhatian",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                Application.UseWaitCursor = true;

                if (rbPayroll.Checked == true)
                {
                    workCalendarRepository.UpdateIsPeriod(Store.ActiveMonth, Store.ActiveYear, true);
                    incentiveRepository.UpdateIsPaid(Store.ActiveMonth, Store.ActiveYear, true);
                    payrollRepository.UpdateIsPaid(Store.ActiveMonth, Store.ActiveYear, true);
                    overTimeRepository.UpdateIsPaid(Store.ActiveMonth, Store.ActiveYear, true);
                    employeeDebtItemRepository.UpdateIsPaid(Store.ActiveMonth, Store.ActiveYear, true);

                    Application.UseWaitCursor = false;
                    MessageBox.Show("Proses Tutup Buku \n\n Periode : " + Store.GetMonthName(Store.ActiveMonth) + " " + Store.ActiveYear + "' \n\n Sukses", "Sukses",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    workCalendarRepository.UpdateIsThr(Store.ActiveYear, true);
                    thrRepository.UpdateIsPaid(Store.ActiveYear, true);

                    Application.UseWaitCursor = false;
                    MessageBox.Show("Proses Tutup Buku THR \n\n Periode : " + Store.ActiveYear + "' \n\n Sukses", "Sukses",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }



                this.Close();
            }
        }