public List <OPDHistoryModel> GetByStatus(params string[] status) { try { Expression <Func <OPDHistory, bool> > predicate = null; foreach (var item in status) { if (predicate != null) { Expression <Func <OPDHistory, bool> > predicateFilter = t => t.Status.Name == item; predicate = PredicateBuilder.OrElse <OPDHistory>(predicate, predicateFilter); } else { predicate = t => t.Status.Name == item; } } OPDHistory entity = new OPDHistory(); return(entity.GetByStatus(predicate)); } catch (Exception ex) { throw ex; } }
public bool Print(Guid?id, string printOption) { try { OPDHistory entity = new OPDHistory(); OPDHistoryModel model = entity.GetById(id.Value); string renamefileName = DateTime.Now.Ticks.ToString() + ".pdf"; string path = ConfigurationManager.AppSettings["SaveReport"].ToString() + DateTime.Now.ToString("dd-MM-yyyy"); if (ErrorLog.IsFolderExist(path)) { path = path + "\\" + renamefileName; } // Create a Document object // var document = new iTextSharp.text.Document(PageSize.A4, 50, 50, 10, 10); // Create a new PdfWrite object, writing the output to a MemoryStream // FileStream output = new FileStream(path, FileMode.Create); var writer = PdfWriter.GetInstance(document, output); // Method To Set Page Header And Footer // //setBillHeaderFooter(writer, document); // Open the Document for writing // document.Open(); if (printOption == "Bill") { setBillPageBody(document, model); new BillHistory().Update(model.Id); } else if (printOption == "Prescription") { setPrescriptionPageBody(document, model); } else if (printOption == "Both") { setBillPageBody(document, model); setPrescriptionPageBody(document, model); } // flush and clear the document from memory // document.Close(); System.Diagnostics.Process.Start(path); return(true); } catch (Exception ex) { throw ex; } }
public OPDHistoryModel GetById(Guid id) { try { OPDHistory entity = new OPDHistory(); return(entity.GetById(id)); } catch (Exception ex) { throw ex; } }
public List <OPDHistoryModel> GetHistoryByPatientId(Guid?id) { try { OPDHistory entity = new OPDHistory(); return(entity.GetHistoryByPatientId(id)); } catch (Exception ex) { throw ex; } }
public bool UpdateStatus(List <OPDHistoryModel> model, OPD_STATUS status) { try { OPDHistory entity = new OPDHistory(); return(entity.UpdateStatus(model, status.ToString())); } catch (Exception ex) { throw ex; } }
public List <LookupModel> getPatientByType(P_TYPE type) { try { OPDHistory entity = new OPDHistory(); return(entity.getPatientByType(type)); } catch (Exception ex) { throw ex; } }
public List <OPDHistoryModel> Get() { try { OPDHistory entity = new OPDHistory(); return(entity.Get()); } catch (Exception ex) { throw ex; } }
public List <OPDHistoryModel> AdvanceSearch(string searchText) { try { OPDHistory entity = new OPDHistory(); return(entity.AdvanceSearch(searchText)); } catch (Exception ex) { throw ex; } }
public DashboardModel getDashboardCounts() { try { OPDHistory entity = new OPDHistory(); return(entity.getDashboardCounts()); } catch (Exception ex) { throw ex; } }
public bool Update(OPDHistoryModel model) { try { OPDHistory entity = new OPDHistory(); return(entity.Update(model)); } catch (Exception ex) { throw ex; } }
public string DownloadReport(OPDFilterSearchModel searchModel) { try { OPDHistory entity = new OPDHistory(); List <OPDHistoryModel> model = entity.GetGenericReport(GetPredicate(searchModel)); return(createReport(model)); } catch (Exception ex) { throw ex; } }