Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int getEmployeeSalaray(Employee e)
- {
- int eid = Int32.Parse(e.employeeId);
- Employee emp = Methods.LoadEmployeeData(eid).Result;
- if (e != null)
- {
- int sum = new Int32();
- foreach (Employee.Salary s in emp.salary)
- {
- int sal = Int32.Parse(s.salary);
- sum += sal;
- }
- return sum;
- }
- else
- {
- return 0;
- }
- }
- public static void LoadEmploymentDocument(Employee e)
- {
- int eid = Int32.Parse(e.employeeId);
- /* Employee e = Methods.LoadEmployeeData(eid).Result; */
- int salary = Methods.getEmployeeSalaray(e);
- string dok = System.IO.File.ReadAllText("MallAsHtml.html");
- var Renderer = new IronPdf.HtmlToPdf();
- //var PDF = Renderer.RenderHTMLFileAsPdf("MallAsHtml.html");
- var HtmlTemplate = dok;
- var HtmlInstance = HtmlTemplate.Replace("[[FIRSTNAME]]", e.firstName).Replace("[[LASTNAME]]", e.lastName).Replace("[[NATIONALID]]", e.nationalId).Replace("[[STARTDATE]]", e.startDate).Replace("[[SALARY]]", salary.ToString());
- var Pdf = Renderer.RenderHtmlAsPdf(HtmlInstance);
- Pdf.SaveAs(e.employeeId +"_" + e.firstName+".pdf");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement