public static void PurchasingReport()
        {
            IList <OrdersTable> orders = DataLayer.GetAllOrderTableDL();
            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><th>כתובת לשליחה</th></tr></thead>" +
                          "<tbody>";

            foreach (OrdersTable elemant in orders)
            {
                bool active;
                if (elemant.active == 0)
                {
                    active = true;
                }
                else
                {
                    active = false;
                }
                body += "<tr><td>" + elemant.Id.ToString() + "</td><td>" + elemant.shipping_number + "</td><td>" + elemant.reception_number +
                        "</td><td>" + elemant.employee_id.ToString() + "</td><td>" + elemant.orderDate.ToString() + "</td><td>" + elemant.supplyingDate.ToString() + "</td><td>" + elemant.notes + "</td><td>" + active.ToString() + "</td><td>" + elemant.shippingAddress + "</td></tr>";
            }
            body += "</tbody></table></body></html>";
            File.WriteAllText(fileName, body);
            ProcessStartInfo processStartInfo = new ProcessStartInfo(fileName);

            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
Ejemplo n.º 2
0
 public IList <OrdersTable> GetAll()
 {
     return(DataLayer.GetAllOrderTableDL());
 }