public List <SupplierPayments> GetAllSupplierPayments(SupplierPaymentsAdvanceSearch supplierPaymentsAdvanceSearch) { List <SupplierPayments> supplierPayObj = null; supplierPayObj = _supplierPaymentsRepository.GetAllSupplierPayments(supplierPaymentsAdvanceSearch); return(supplierPayObj); }
public string GetAllSupplierPayments(string filter, string supplierPaymentsAdvanceSearch) { SupplierPaymentsAdvanceSearch supplierPaymentsAdvanceSearchObj = supplierPaymentsAdvanceSearch != null ? (JsonConvert.DeserializeObject <SupplierPaymentsAdvanceSearch>(supplierPaymentsAdvanceSearch)) : new SupplierPaymentsAdvanceSearch(); List <SupplierPaymentsViewModel> supplierPayList = Mapper.Map <List <SupplierPayments>, List <SupplierPaymentsViewModel> >(_supplierPaymentsBusiness.GetAllSupplierPayments(supplierPaymentsAdvanceSearchObj)); if (filter != null && filter == "NA") { supplierPayList = supplierPayList.Where(m => m.ApprovalStatus == 1).ToList(); } else if (filter != null && filter == "AP") { supplierPayList = supplierPayList.Where(m => m.ApprovalStatus == 2).ToList(); } return(JsonConvert.SerializeObject(new { Result = "OK", Records = supplierPayList })); }