Пример #1
0
        private void ImportData(ImportType importType, string fileName)
        {
            switch (importType)
            {
            case ImportType.Employee:
                ImportEmployee(fileName);
                ImportEmployeeDetail(fileName);
                break;

            case ImportType.Absence:
                absenceRepository.Delete(Store.ActiveMonth, Store.ActiveYear);
                ImportAbsence(fileName);

                break;

            case ImportType.Overtime:
                overTimeRepository.Delete(Store.ActiveMonth, Store.ActiveYear);
                ImportOvertime(fileName);
                break;

            case ImportType.Incentive:
                incentiveRepository.Delete(Store.ActiveMonth, Store.ActiveYear);
                ImportIncentive(fileName);

                break;
            }
        }
Пример #2
0
        public async Task <IActionResult> DeleteConfirmed(long id)
        {
            //var overTime = await _context.OverTimes.FindAsync(id);
            //_context.OverTimes.Remove(overTime);
            //await _context.SaveChangesAsync
            var overTime = overTimeRepository.GetDeleteList(id);
            await overTimeRepository.Delete(overTime);

            return(RedirectToAction(nameof(Index)));
        }
Пример #3
0
        private void tsbDelete_Click(object sender, EventArgs e)
        {
            var userAccess = userAccessRepository.GetAll();

            bool isAllowed = userAccess.Exists(u => u.FullName == Store.ActiveUser &&
                                               u.ObjectName == "Lembur" && u.IsDelete);

            if (isAllowed == false && Store.IsAdministrator == false)
            {
                MessageBox.Show("Anda tidak dapat menghapus", "Perhatian", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (Store.IsPeriodClosed)
                {
                    MessageBox.Show("Tidak dapat menambah/ubah/hapus \n\n Periode : " + Store.GetMonthName(Store.ActiveMonth) + " " + Store.ActiveYear + "\n\n" + "Sudah Tutup Buku", "Perhatian",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (formMode == FormMode.View && overTimeRepository.IsIncludePayroll(Store.ActiveMonth, Store.ActiveYear))
                    {
                        MessageBox.Show("Tidak dapat menambah/ubah/hapus \n\n Periode : " + Store.GetMonthName(Store.ActiveMonth) + " " + Store.ActiveYear + "\n\n" + "Sudah termasuk gaji", "Perhatian",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        if (MessageBox.Show("Anda yakin ingin menghapus \n\n Nama : " + txtName.Text + " " + dtpDate.Value.ToString("dd/MM/yyyy") + "\n\n" + "Sudah Tutup Buku", "Perhatian",
                                            MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            overTimeRepository.Delete(new Guid(txtID.Text));
                            GetLastOverTime();
                            LoadOverTime();
                        }

                        if (lvwData.Items.Count == 0)
                        {
                            tsbEdit.Enabled       = false;
                            tsbDelete.Enabled     = false;
                            tsbRefresh.Enabled    = false;
                            tsbMenuFilter.Enabled = false;
                            txtSearch.Enabled     = false;
                            tsbFilter.Enabled     = false;

                            ClearForm();
                        }
                    }
                }
            }
        }