Exemple #1
0
        private InvoiceSpecification GetInvoiceSpecification(InvoiceSearchDataModel searchModel, bool IsCount)
        {
            var invoiceSpecification = new InvoiceSpecification(_clinicId);
            if (searchModel.DisplayId != null && searchModel.DisplayId > 0)
            {
                invoiceSpecification.AddDisplayId((int)searchModel.DisplayId);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.FirstName))
            {
                invoiceSpecification.AddFirstName(searchModel.FirstName);
            }
            if (!string.IsNullOrWhiteSpace(searchModel.LastName))
            {
                invoiceSpecification.AddFirstName(searchModel.LastName);
            }
            if (searchModel.InvoiceFromDate != null)
            {
                invoiceSpecification.AddFromDate((DateTime)searchModel.InvoiceFromDate);
            }
            if (searchModel.InvoiceToDate != null)
            {
                invoiceSpecification.AddToDate((DateTime)searchModel.InvoiceToDate);
            }

            if (!IsCount)
            {
                invoiceSpecification.AddPagination(searchModel.CurrentPage, searchModel.PageSize);
            }

            return invoiceSpecification;
        }
Exemple #2
0
        public InvoiceModel SearchInvoice(int invoiceId)
        {
            var invoiceDetailSpecification = new InvoiceSpecification(_clinicId);
            invoiceDetailSpecification.AddDisplayId(invoiceId);
            var data = _invoiceRepository.GetSingleBySpec(invoiceDetailSpecification);

            return data !=null?data:null;
        }