public static void OrderFromSupplierReport()
        {
            IList <orderFromSupplierDetailTable> orderFromSupplier = DataLayer.GetAllOrderFromSupplierDetailDL();
            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 (orderFromSupplierDetailTable elemant in orderFromSupplier)
            {
                bool active;
                if (elemant.active == 0)
                {
                    active = true;
                }
                else
                {
                    active = false;
                }
                body += "<tr><td>" + elemant.Id.ToString() + "</td><td>" + elemant.amount.ToString() + "</td><td>" + elemant.notes +
                        "</td><td>" + active.ToString() + "</td><td>" + elemant.name + "</td><td>" + elemant.materialType + "</td><td>" + elemant.supplier_id.ToString() + "</td><td>" + elemant.price.ToString() + "</td><td>" + elemant.orderFromSupplier_id.ToString() + "</td</tr>";
            }
            body += "</tbody></table></body></html>";
            File.WriteAllText(fileName, body);
            ProcessStartInfo processStartInfo = new ProcessStartInfo(fileName);

            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
        public static void Profitability()
        {
            int expends1 = 0, expends2 = 0, expends3 = 0, expends4 = 0, revenue = 0;
            IList <orderDetailsTable>            orders = DataLayer.GetAllOrderDetailDL();
            IList <EmployeeTable>                employees = DataLayer.GetAllEmployeesDL();
            IList <CurrentExpendsTable>          currentExpends = DataLayer.GetAllCurrentExpends();
            IList <variableExpendsTable>         variableExpends = DataLayer.GetAllVariableExpends();
            IList <orderFromSupplierDetailTable> ordersFromSupplier = DataLayer.GetAllOrderFromSupplierDetailDL();

            foreach (orderDetailsTable element in orders)
            {
                revenue += Convert.ToInt32((element.cost * element.amount) - element.costPrice - element.discount);
            }
            foreach (EmployeeTable element in employees)
            {
                expends1 += Convert.ToInt32(element.salary);
            }
            foreach (CurrentExpendsTable element in currentExpends)
            {
                expends2 += Convert.ToInt32(element.cost);
            }
            foreach (variableExpendsTable element in variableExpends)
            {
                expends3 += Convert.ToInt32(element.cost);
            }
            foreach (orderFromSupplierDetailTable element in ordersFromSupplier)
            {
                expends4 += Convert.ToInt32(element.amount * element.price);
            }
            int    Profitability = revenue - expends1 - expends2 - expends3 - expends4;
            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></tr></thead>" +
                                   "<tbody>";

            body += "<tr><td>" + expends1.ToString() + "</td><td>" + expends2.ToString() + "</td><td>" + expends3.ToString() +
                    "</td><td>" + expends4.ToString() + "</td><td>" + revenue.ToString() + "</td><td>" + Profitability.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 <orderFromSupplierDetailTable> GetAll()
 {
     return(DataLayer.GetAllOrderFromSupplierDetailDL());
 }