private void FindProjectAndCustomerAndService(string cardDescription, string commentText, TimeEntry timeEntry) { timeEntry.Project = FindCommand(cardDescription, commentText, "project") ?? ""; timeEntry.Customer = FindCommand(cardDescription, commentText, "customer") ?? ""; timeEntry.Service = FindCommand(cardDescription, commentText, "service") ?? ""; var miteCommand = FindCommand(cardDescription, commentText, "mite") ?? ""; if (!string.IsNullOrEmpty(miteCommand)) { var miteCommandArray = miteCommand.Split(';').Select(x => x.Trim()).ToArray(); if (miteCommandArray.Length == 3) { if (string.IsNullOrEmpty(timeEntry.Customer)) timeEntry.Customer = miteCommandArray[0]; if (string.IsNullOrEmpty(timeEntry.Project)) timeEntry.Project = miteCommandArray[1]; if (string.IsNullOrEmpty(timeEntry.Service)) timeEntry.Service = miteCommandArray[2]; } } }
private void FindNotes(string cardDescription, string commentText, string cardTitle, TimeEntry timeEntry) { var notes = FindCommand(cardDescription, commentText, "notes"); if (string.IsNullOrWhiteSpace(notes)) notes = cardTitle; timeEntry.Notes = notes; }