public void DeletePartnerPayment(string partnerMainC, string partnerSubC, DateTime partnerPaymentD, string paymentId) { var deletePartnerPayment = _partnerPaymentRepository.Get(i => i.PartnerMainC == partnerMainC && i.PartnerSubC == partnerSubC && i.PartnerPaymentD == partnerPaymentD && i.PaymentId == paymentId); if (deletePartnerPayment != null) { _partnerPaymentRepository.Delete(deletePartnerPayment); SavePartnerPayment(); } }
public IActionResult Delete(string id) { var claims = User.Claims.Select(claim => new { claim.Type, claim.Value }).ToDictionary(t => t.Type, t => t.Value); if (claims.ContainsKey("name")) { if (claims["name"].Equals("ADMIN") || claims["name"].Equals("MANAGER")) { return(Ok(_repository.Delete(id))); } } else { return(Forbid()); } return(Forbid()); }
public IActionResult Delete(string id) { return(Ok(_repository.Delete(id))); }