public static void GemerateParticipantEvent(PersonEvents ev) { using (var workbook = new XLWorkbook()) { var ws = workbook.Worksheets.Add(ev.Title); var colIndex = 1; var rowIndex = 2; ws.Cell(1, colIndex).Value = "FullName"; ws.Cell(1, colIndex + 1).Value = "Date filed"; ws.Cell(1, colIndex + 2).Value = "Ailment detail"; ws.Cell(1, colIndex + 3).Value = "Diagnosis"; ws.Cell(1, colIndex + 4).Value = "Remarks"; ws.Cell(1, colIndex + 5).Value = "Weight"; ws.Cell(1, colIndex + 6).Value = "Height"; ws.Cell(1, colIndex + 7).Value = "ExpectedChildGender"; ws.Cell(1, colIndex + 8).Value = "PregnancyDueDate"; foreach (var log in ev.Logs) { ws.Cell(rowIndex, colIndex).Value = log.FullName; ws.Cell(rowIndex, colIndex + 1).Value = log.LastModified; if (log.Consultation != null) { ws.Cell(rowIndex, colIndex + 2).Value = log.Consultation.AilmentDetail; ws.Cell(rowIndex, colIndex + 3).Value = log.Consultation.Diagnosis; ws.Cell(rowIndex, colIndex + 4).Value = log.Consultation.Remarks; ws.Cell(rowIndex, colIndex + 5).Value = log.Consultation.Weight; ws.Cell(rowIndex, colIndex + 6).Value = log.Consultation.Height; ws.Cell(rowIndex, colIndex + 7).Value = log.Consultation.ExpectedChildGender; ws.Cell(rowIndex, colIndex + 8).Value = log.Consultation.PregnancyDueDate; } rowIndex++; } SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Excel Files | *.xlsx"; sfd.DefaultExt = "xlsx"; if (sfd.ShowDialog() == DialogResult.OK) { workbook.SaveAs(sfd.FileName); MessageBox.Show("Saved"); } } }
public async Task <bool> ModifyEvent(PersonEvents events) { var data = await DataConnection.UpdateAsync(events); return(data); }
public async Task <int> CreateEvent(PersonEvents events) { var data = await DataConnection.InsertAsync(events); return(data); }