Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        public dynamic Delete(SalaryItem model)
        {
            try
            {
                if (!AuthenticationModel.IsAllowed("Delete", Core.Constants.Constant.MenuName.SalaryItems, Core.Constants.Constant.MenuGroupName.Setting))
                {
                    Dictionary <string, string> Errors = new Dictionary <string, string>();
                    Errors.Add("Generic", "You are Not Allowed to Delete Record");

                    return(Json(new
                    {
                        Errors
                    }, JsonRequestBehavior.AllowGet));
                }

                var data = _salaryItemService.GetObjectById(model.Id);
                model = _salaryItemService.SoftDeleteObject(data);
            }

            catch (Exception ex)
            {
                LOG.Error("Delete Failed", ex);
                Dictionary <string, string> Errors = new Dictionary <string, string>();
                Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Errors
            }));
        }