public static void CurrentExpendsReport() { IList <CurrentExpendsTable> currentExpends = DataLayer.GetAllCurrentExpends(); 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></tr></thead>" + "<tbody>"; foreach (CurrentExpendsTable elemant in currentExpends) { bool active; if (elemant.active == 0) { active = true; } else { active = false; } body += "<tr><td>" + elemant.Id.ToString() + "</td><td>" + elemant.employee_id.ToString() + "</td><td>" + elemant.notes + "</td><td>" + active.ToString() + "</td><td>" + elemant.name + "</td><td>" + elemant.cost + "</td><td>" + elemant.date.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 static IList <CurrentExpendsTable> GetAllCurentExp() { return(DataLayer.GetAllCurrentExpends()); }