public SalaryStandardController() { _salaryStandardService = new SalaryStandardService(new SalaryStandardRepository(), new SalaryStandardValidator()); _titleInfoService = new TitleInfoService(new TitleInfoRepository(), new TitleInfoValidator()); _salaryStandardDetailService = new SalaryStandardDetailService(new SalaryStandardDetailRepository(), new SalaryStandardDetailValidator()); _salaryItemService = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator()); }
public SalarySlipController() { _salarySlipService = new SalarySlipService(new SalarySlipRepository(), new SalarySlipValidator()); _formulaService = new FormulaService(new FormulaRepository(), new FormulaValidator()); _salarySlipDetailService = new SalarySlipDetailService(new SalarySlipDetailRepository(), new SalarySlipDetailValidator()); _salaryItemService = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator()); }
public THRController() { _thrService = new THRService(new THRRepository(), new THRValidator()); _employeeService = new EmployeeService(new EmployeeRepository(), new EmployeeValidator()); _salaryItemService = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator()); _thrDetailService = new THRDetailService(new THRDetailRepository(), new THRDetailValidator()); }
public THR UpdateObject(THR thr, ISalaryItemService _salaryItemService) { if (_validator.ValidUpdateObject(thr, this)) { SalaryItem salaryItem = _salaryItemService.GetObjectById(thr.SalaryItemId.GetValueOrDefault()); if (salaryItem == null) { salaryItem = _salaryItemService.CreateObject(thr.Code, thr.Name, (int)Constant.SalarySign.Income, (int)Constant.SalaryItemType.SalarySlip, (int)Constant.SalaryItemStatus.Monthly, thr.IsMainSalary, thr.IsDetailSalary, false); thr.SalaryItemId = salaryItem.Id; } else { salaryItem.Code = thr.Code; salaryItem.Name = thr.Name; _salaryItemService.UpdateObject(salaryItem); if (salaryItem.Errors.Any()) { thr.Errors.Clear(); thr.Errors.Add("Code", "Tidak dapat mengubah SalaryItem dengan Code ini"); } } _repository.UpdateObject(thr); } return(thr); }
public SalarySlip CreateObject(SalarySlip salarySlip, ISalaryItemService _salaryItemService) { salarySlip.Errors = new Dictionary <String, String>(); SalaryItem salaryItem = _salaryItemService.GetObjectById(salarySlip.SalaryItemId.GetValueOrDefault()); if (salaryItem == null) { salaryItem = _salaryItemService.GetObjectByCode(salarySlip.Code); if (salaryItem != null) { salarySlip.Errors = new Dictionary <string, string>(); salarySlip.Errors.Add("Code", "SalaryItem dengan Code ini sudah ada"); return(salarySlip); } salaryItem = _salaryItemService.CreateObject(salarySlip.Code, salarySlip.Name, salarySlip.SalarySign, (int)Constant.SalaryItemType.SalarySlip, (int)Constant.SalaryItemStatus.Monthly, salarySlip.IsMainSalary, salarySlip.IsDetailSalary, false); if (salaryItem == null) { salarySlip.Errors = new Dictionary <string, string>(); salarySlip.Errors.Add("Code", "Tidak dapat membuat SalaryItem dengan Code ini"); return(salarySlip); } salarySlip.SalaryItemId = salaryItem.Id; } if (_validator.ValidCreateObject(salarySlip, this, _salaryItemService)) { salarySlip.Index = GetQueryable().Count() + 1; _repository.CreateObject(salarySlip); } ; return(salarySlip); }
public SalarySlip CreateObject(string Code, string Name, int SalarySign, int SalaryStatus, bool IsMainSalary, bool IsDetailSalary, bool IsEnabled, bool IsPTKP, bool IsPPH21, ISalaryItemService _salaryItemService) { SalarySlip salarySlip = new SalarySlip { Code = Code, Name = Name, SalarySign = SalarySign, IsMainSalary = IsMainSalary, IsDetailSalary = IsDetailSalary, IsEnabled = IsEnabled, IsPTKP = IsPTKP, IsPPH21 = IsPPH21, }; SalaryItem salaryItem = _salaryItemService.GetObjectByCode(Code); if (salaryItem != null) { salarySlip.Errors = new Dictionary <string, string>(); salarySlip.Errors.Add("Code", "SalaryItem dengan Code ini sudah ada"); return(salarySlip); } salaryItem = _salaryItemService.CreateObject(Code, Name, SalarySign, (int)Constant.SalaryItemType.SalarySlip, SalaryStatus, IsMainSalary, IsDetailSalary, false); if (salaryItem == null) { salarySlip.Errors = new Dictionary <string, string>(); salarySlip.Errors.Add("Code", "Tidak dapat membuat SalaryItem dengan Code ini"); return(salarySlip); } salarySlip.SalaryItemId = salaryItem.Id; return(this.CreateObject(salarySlip, _salaryItemService)); }
public GeneralLeaveController() { _generalLeaveService = new GeneralLeaveService(new GeneralLeaveRepository(), new GeneralLeaveValidator()); _employeeService = new EmployeeService(new EmployeeRepository(), new EmployeeValidator()); _salaryItemService = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator()); _salaryStandardDetailService = new SalaryStandardDetailService(new SalaryStandardDetailRepository(), new SalaryStandardDetailValidator()); }
public OtherIncomeController() { _otherIncomeService = new OtherIncomeService(new OtherIncomeRepository(), new OtherIncomeValidator()); _employeeService = new EmployeeService(new EmployeeRepository(), new EmployeeValidator()); _salaryItemService = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator()); _otherIncomeDetailService = new OtherIncomeDetailService(new OtherIncomeDetailRepository(), new OtherIncomeDetailValidator()); }
public OtherExpense UpdateObject(OtherExpense otherExpense, ISalaryItemService _salaryItemService) { if (_validator.ValidUpdateObject(otherExpense, this)) { SalaryItem salaryItem = _salaryItemService.GetObjectById(otherExpense.SalaryItemId.GetValueOrDefault()); if (salaryItem == null) { salaryItem = _salaryItemService.CreateObject(otherExpense.Code, otherExpense.Name, (int)Constant.SalarySign.Expense, (int)Constant.SalaryItemType.SalarySlip, otherExpense.SalaryStatus, otherExpense.IsMainSalary, otherExpense.IsDetailSalary, false); otherExpense.SalaryItemId = salaryItem.Id; } else { salaryItem.Code = otherExpense.Code; salaryItem.Name = otherExpense.Name; salaryItem.SalaryItemStatus = otherExpense.SalaryStatus; _salaryItemService.UpdateObject(salaryItem); if (salaryItem.Errors.Any()) { otherExpense.Errors.Clear(); otherExpense.Errors.Add("Code", "Tidak dapat mengubah SalaryItem dengan Code ini"); } } _repository.UpdateObject(otherExpense); } return(otherExpense); }
public SalaryEmployeeController() { _salaryEmployeeService = new SalaryEmployeeService(new SalaryEmployeeRepository(), new SalaryEmployeeValidator()); _employeeService = new EmployeeService(new EmployeeRepository(), new EmployeeValidator()); _salaryEmployeeDetailService = new SalaryEmployeeDetailService(new SalaryEmployeeDetailRepository(), new SalaryEmployeeDetailValidator()); _salaryItemService = new SalaryItemService(new SalaryItemRepository(), new SalaryItemValidator()); _salaryStandardDetailService = new SalaryStandardDetailService(new SalaryStandardDetailRepository(), new SalaryStandardDetailValidator()); }
public Formula UpdateObject(Formula formula, ISalaryItemService _salaryItemService) { formula.FormulaOp = formula.FormulaOp.Trim(); if (formula.FormulaOp == null || formula.FormulaOp == "") { formula.FormulaOp = "+"; } return(formula = _validator.ValidUpdateObject(formula, this, _salaryItemService) ? _repository.UpdateObject(formula) : formula); }
public EmployeeLoan VHasSalaryItem(EmployeeLoan employeeLoan, ISalaryItemService _salaryItemService) { SalaryItem salaryItem = _salaryItemService.GetObjectById(employeeLoan.SalaryItemId); if (salaryItem == null) { employeeLoan.Errors.Add("SalaryItem", "Tidak ada"); } return(employeeLoan); }
public SalarySlip VHasSalaryItem(SalarySlip salarySlip, ISalaryItemService _salaryItemService) { SalaryItem salaryItem = _salaryItemService.GetObjectById(salarySlip.SalaryItemId.GetValueOrDefault()); if (salaryItem == null) { salarySlip.Errors.Add("SalaryItem", "Tidak ada"); } return(salarySlip); }
public THR VHasSalaryItem(THR thr, ISalaryItemService _salaryItemService) { SalaryItem salaryItem = _salaryItemService.GetObjectById(thr.SalaryItemId.GetValueOrDefault()); if (salaryItem == null) { thr.Errors.Add("SalaryItem", "Tidak valid"); } return(thr); }
public OtherExpense VHasSalaryItem(OtherExpense otherExpense, ISalaryItemService _salaryItemService) { SalaryItem salaryItem = _salaryItemService.GetObjectById(otherExpense.SalaryItemId.GetValueOrDefault()); if (salaryItem == null) { otherExpense.Errors.Add("SalaryItem", "Tidak valid"); } return(otherExpense); }
//public Formula VHasParentSalaryItem(Formula formula, ISalaryItemService _salaryItemService) //{ // SalaryItem salaryItem = _salaryItemService.GetObjectById(formula.SalaryItemId); // if (salaryItem == null) // { // formula.Errors.Add("SalaryItem", "Tidak valid"); // } // return formula; //} public Formula VHasFirstSalaryItem(Formula formula, ISalaryItemService _salaryItemService) { SalaryItem salaryItem = _salaryItemService.GetObjectById(formula.FirstSalaryItemId.GetValueOrDefault()); if (salaryItem == null) { formula.Errors.Add("FirstSalaryItem", "Tidak valid"); } return(formula); }
public Formula CreateObject(Formula formula, ISalaryItemService _salaryItemService) { formula.Errors = new Dictionary <String, String>(); formula.FormulaOp = formula.FormulaOp.Trim(); if (formula.FormulaOp == null || formula.FormulaOp == "") { formula.FormulaOp = "+"; } return(_validator.ValidCreateObject(formula, this, _salaryItemService) ? _repository.CreateObject(formula) : formula); }
public Formula VHasSecondSalaryItem(Formula formula, ISalaryItemService _salaryItemService) { if (!formula.IsSecondValue) { SalaryItem salaryItem = _salaryItemService.GetObjectById(formula.SecondSalaryItemId.GetValueOrDefault()); if (salaryItem == null) { formula.Errors.Add("SecondSalaryItem", "Tidak valid"); } } return(formula); }
public SalaryItem VHasUniqueCode(SalaryItem salaryItem, ISalaryItemService _salaryItemService) { if (String.IsNullOrEmpty(salaryItem.Code) || salaryItem.Code.Trim() == "") { salaryItem.Errors.Add("Code", "Tidak boleh kosong"); } else if (_salaryItemService.IsCodeDuplicated(salaryItem)) { salaryItem.Errors.Add("Code", "Tidak boleh ada duplikasi"); } return(salaryItem); }
public SalarySlip SoftDeleteObject(SalarySlip salarySlip, ISalaryItemService _salaryItemService) { if (_validator.ValidDeleteObject(salarySlip)) { SalaryItem salaryItem = _salaryItemService.GetObjectById(salarySlip.SalaryItemId.GetValueOrDefault()); _repository.SoftDeleteObject(salarySlip); if (salaryItem != null) { _salaryItemService.SoftDeleteObject(salaryItem); } } return(salarySlip); }
public THR SoftDeleteObject(THR thr, ISalaryItemService _salaryItemService) { if (_validator.ValidDeleteObject(thr)) { SalaryItem salaryItem = _salaryItemService.GetObjectById(thr.SalaryItemId.GetValueOrDefault()); _repository.SoftDeleteObject(thr); if (salaryItem != null) { _salaryItemService.SoftDeleteObject(salaryItem); } } return(thr); }
public OtherExpense SoftDeleteObject(OtherExpense otherExpense, ISalaryItemService _salaryItemService) { if (_validator.ValidDeleteObject(otherExpense)) { SalaryItem salaryItem = _salaryItemService.GetObjectById(otherExpense.SalaryItemId.GetValueOrDefault()); _repository.SoftDeleteObject(otherExpense); if (salaryItem != null) { _salaryItemService.SoftDeleteObject(salaryItem); } } return(otherExpense); }
//public SalaryItem VHasValidSign(SalaryItem salaryItem) //{ // if (salaryItem.SalarySign == 0) // { // salaryItem.Errors.Add("SalarySign", "Tidak valid"); // } // return salaryItem; //} public bool ValidCreateObject(SalaryItem salaryItem, ISalaryItemService _salaryItemService) { VHasUniqueCode(salaryItem, _salaryItemService); if (!isValid(salaryItem)) { return(false); } VHasValidCode(salaryItem); if (!isValid(salaryItem)) { return(false); } VHasDefaultValue(salaryItem); //if (!isValid(salaryItem)) { return false; } //VHasValidSign(salaryItem); return(isValid(salaryItem)); }
public THR CreateObject(THR thr, ISalaryItemService _salaryItemService) { thr.Errors = new Dictionary <String, String>(); if (_validator.ValidCreateObject(thr, this)) { SalaryItem salaryItem = _salaryItemService.GetObjectByCode(thr.Code); if (salaryItem != null) { thr.Errors = new Dictionary <string, string>(); thr.Errors.Add("Code", "SalaryItem dengan Code ini sudah ada"); return(thr); } salaryItem = _salaryItemService.CreateObject(thr.Code, thr.Name, (int)Constant.SalarySign.Income, (int)Constant.SalaryItemType.THR, (int)Constant.SalaryItemStatus.Monthly, thr.IsMainSalary, thr.IsDetailSalary, false); if (salaryItem == null) { thr.Errors = new Dictionary <string, string>(); thr.Errors.Add("Code", "Tidak dapat membuat SalaryItem dengan Code ini"); return(thr); } thr.SalaryItemId = salaryItem.Id; _repository.CreateObject(thr); } return(thr); }
public OtherExpense CreateObject(OtherExpense otherExpense, ISalaryItemService _salaryItemService) { otherExpense.Errors = new Dictionary <String, String>(); if (_validator.ValidCreateObject(otherExpense, this)) { SalaryItem salaryItem = _salaryItemService.GetObjectByCode(otherExpense.Code); if (salaryItem != null) { otherExpense.Errors = new Dictionary <string, string>(); otherExpense.Errors.Add("Code", "SalaryItem dengan Code ini sudah ada"); return(otherExpense); } salaryItem = _salaryItemService.CreateObject(otherExpense.Code, otherExpense.Name, (int)Constant.SalarySign.Expense, (int)Constant.SalaryItemType.OtherExpense, otherExpense.SalaryStatus, otherExpense.IsMainSalary, otherExpense.IsDetailSalary, false); if (salaryItem == null) { otherExpense.Errors = new Dictionary <string, string>(); otherExpense.Errors.Add("Code", "Tidak dapat membuat SalaryItem dengan Code ini"); return(otherExpense); } otherExpense.SalaryItemId = salaryItem.Id; _repository.CreateObject(otherExpense); } return(otherExpense); }
public bool ValidUpdateObject(SalaryStandardDetail salaryStandardDetail, ISalaryStandardService _salaryStandardService, ISalaryItemService _salaryItemService) { salaryStandardDetail.Errors.Clear(); ValidCreateObject(salaryStandardDetail, _salaryStandardService, _salaryItemService); return(isValid(salaryStandardDetail)); }
public bool ValidCreateObject(SalaryStandardDetail salaryStandardDetail, ISalaryStandardService _salaryStandardService, ISalaryItemService _salaryItemService) { VHasSalaryStandard(salaryStandardDetail, _salaryStandardService); if (!isValid(salaryStandardDetail)) { return(false); } VHasSalaryItem(salaryStandardDetail, _salaryItemService); if (!isValid(salaryStandardDetail)) { return(false); } VHasAmount(salaryStandardDetail); return(isValid(salaryStandardDetail)); }
public SalaryStandardDetail VHasSalaryItem(SalaryStandardDetail salaryStandardDetail, ISalaryItemService _salaryItemService) { SalaryItem salaryItem = _salaryItemService.GetObjectById(salaryStandardDetail.SalaryItemId); if (salaryItem == null) { salaryStandardDetail.Errors.Add("SalaryItem", "Tidak ada"); } return(salaryStandardDetail); }
public bool ValidUpdateObject(SalarySlip salarySlip, ISalarySlipService _salarySlipService, ISalaryItemService _salaryItemService) { salarySlip.Errors.Clear(); ValidCreateObject(salarySlip, _salarySlipService, _salaryItemService); return(isValid(salarySlip)); }
public bool ValidCreateObject(SalarySlip salarySlip, ISalarySlipService _salarySlipService, ISalaryItemService _salaryItemService) { VHasUniqueCode(salarySlip, _salarySlipService); if (!isValid(salarySlip)) { return(false); } VHasSalaryItem(salarySlip, _salaryItemService); if (!isValid(salarySlip)) { return(false); } VHasValidSign(salarySlip); return(isValid(salarySlip)); }