public static void SupplierReport() { IList <supplierTable> suppliers = DataLayer.GetAllSupplierDL(); String fileName = Path.GetTempFileName() + ".html"; string body = "<html><head><style>body { direction:rtl; font-family: Arial, Sans Serif; }" + "table { width: 100%; } " + "thead th { background: gray; }</style>" + "<title>דוח ספקים</title>" + "</head><body><h1>תוצאות דוח ספקים</h1>" + "<table>" + "<thead><tr><th>מזהה</th><th>שם מלא</th><th>מדינת מוצא</th><th>מספר טלפון</th><th>מייל</th><th>הערות</th><th>כתובת</th><th>מצב פעילות</th></tr></thead>" + "<tbody>"; foreach (supplierTable elemant in suppliers) { bool active; if (elemant.active == 0) { active = true; } else { active = false; } body += "<tr><td>" + elemant.Id.ToString() + "</td><td>" + elemant.full_Name + "</td><td>" + elemant.country + "</td><td>" + elemant.phoneNumber + "</td><td>" + elemant.E_mail + "</td><td>" + elemant.notes + "</td><td>" + elemant.address + "</td><td>" + active.ToString() + "</td></tr>"; } body += "</tbody></table></body></html>"; File.WriteAllText(fileName, body); ProcessStartInfo processStartInfo = new ProcessStartInfo(fileName); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); }
public IList <supplierTable> GetAll() { return(DataLayer.GetAllSupplierDL()); }