예제 #1
0
        public PayrollHistoryUI(PayrollUI frmPayroll)
        {
            payrollRepository = EntityContainer.GetType <IPayrollRepository>();
            this.frmPayroll   = frmPayroll;

            formActive = "PayrollUI";

            InitializeComponent();
        }
예제 #2
0
        private void tsbSalary_Click(object sender, EventArgs e)
        {
            if (Store.IsPeriodClosed == false)
            {
                Store.ActiveForm = "Payroll";

                var frmParamDate = new ParamDateUI();
                frmParamDate.MdiParent = this;
                frmParamDate.Text      = "Proses Gaji";

                frmParamDate.Show();
            }
            else
            {
                var frmPayrollUI = new PayrollUI();
                frmPayrollUI.MdiParent = this;
                frmPayrollUI.Show();
            }
        }
예제 #3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            switch (Store.ActiveForm)
            {
            case "Payroll":
                bool isIncentive    = false;
                bool isOverTime     = false;
                bool isEmployeeDebt = false;

                if (chkIsIncentive.Checked)
                {
                    isIncentive = true;
                }

                if (chkIsOverTime.Checked)
                {
                    isOverTime = true;
                }

                if (chkIsEmployeeDebt.Checked)
                {
                    isEmployeeDebt = true;
                }

                payrollRepository.CalculatePayroll(dtpDate.Value, isIncentive, isOverTime, isEmployeeDebt, Store.ActiveMonth, Store.ActiveYear);
                incentiveRepository.UpdateIsIncludePayroll(Store.ActiveMonth, Store.ActiveYear, isIncentive);
                overTimeRepository.UpdateIsIncludePayroll(Store.ActiveMonth, Store.ActiveYear, isOverTime);
                employeeDebtItemRepository.UpdateIsIncludePayroll(Store.ActiveMonth, Store.ActiveYear, isEmployeeDebt);

                var frmPayroll = new PayrollUI();
                frmPayroll.MdiParent = this.MdiParent;
                frmPayroll.Show();

                break;

            case "THR":
                string hariRaya = "";
                if (rbLebaran.Checked == true)
                {
                    hariRaya = "LEBARAN";
                }
                else
                {
                    hariRaya = "NATAL";
                }

                if (thrRepository.IsPaid(hariRaya, Store.ActiveYear))
                {
                    MessageBox.Show("Tidak dapat proses THR\n\n Periode : " + Store.ActiveYear + "\n\n" + "Sudah dibayarkan", "Perhatian",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    thrRepository.CalculateTHR(dtpDate.Value, hariRaya);
                }
                var frmTHR = new THRUI();
                frmTHR.MdiParent = this.MdiParent;
                frmTHR.Show();


                break;
            }


            this.Close();
        }