/// <summary> /// /// </summary> /// <param name="csvExport"></param> /// <param name="booking"></param> /// <param name="counter" ></param> private static void AddRow(CsvExport csvExport, IBooking booking, int counter) { var timeDiff = booking.EndTime.Subtract(booking.StartTime); csvExport.AddRow(); csvExport["UN_ID"] = $"{counter}"; csvExport["COMP_ID"] = booking.Customer.ShortName; csvExport["USER_ID"] = booking.Employee.User.UserName; csvExport["DESC"] = booking.Task.Name; csvExport["DESC_MEMO"] = booking.TaskDescription; csvExport["NDESC"] = booking.Task.Number.ToString(); csvExport["DAT"] = booking.Date.ToShortDateString(); csvExport["NR_WEEK"] = string.Format("{0}", booking.Date.CalendarWeek()); csvExport["T_START"] = booking.StartTime.ToString(); csvExport["T_END"] = booking.EndTime.ToString(); csvExport["T_S_FACT"] = ""; csvExport["T_E_FACT"] = ""; csvExport["CUSTOMER"] = string.Format("{0} {1}", booking.Customer.Number, booking.Customer.Name); csvExport["TIME_DIFF"] = string.Format("{0:D2}:{1:D2}:{2:D2}", timeDiff.Hours, timeDiff.Minutes, timeDiff.Seconds); csvExport["TIME_FACT"] = ""; csvExport["PAYED"] = "FALSCH"; csvExport["NSEC"] = timeDiff.TotalSeconds.ToString(); csvExport["NSEC_FACT"] = "0"; csvExport["KNR"] = booking.Customer.Number.ToString(); csvExport["NPROJECT"] = booking.Project.Number.ToString(); csvExport["DESCP"] = booking.Project.Name; csvExport["BOOKED"] = "FALSCH"; csvExport["UNIT"] = "0"; csvExport["PRICE"] = "{0}"; }
private static void AddJdcBookingRow(CsvExport csvExport, JdcBooking booking) { csvExport.AddRow(); csvExport["Datum"] = $"{booking.Date.ToShortDateString()}"; csvExport["Name"] = $"{booking.EmployeeName}"; csvExport["Kommt"] = $"{booking.StartTime}"; csvExport["Geht"] = $"{booking.EndTime}"; }