public void AddBoxTicketData(tBoxTicketData boxTicketData) { DateTime dt; bool res = DateTime.TryParse(boxTicketData.Time, out dt); if (res) { boxTicketData.Time = dt.ToString("HH:mm:ss"); } _context.tBoxTicketData.Add(boxTicketData); _context.SaveChanges(); }
private static void WriteInBoundBoxTicketRow(ExcelWorksheet worksheet, int y, tBoxTicketData inbound) { worksheet.Cells[y, 1].Value = inbound.ClassName; worksheet.Cells[y, 1].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 2].Value = inbound.ShipTo; worksheet.Cells[y, 2].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 3].Value = inbound.FlightNo; worksheet.Cells[y, 3].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 4].Value = inbound.Route; worksheet.Cells[y, 4].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 5].Value = inbound.Time; worksheet.Cells[y, 5].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); var flightNum = inbound.FlightNo; if (flightNum == "VS251" || flightNum == "VS026" || flightNum == "VS207" || flightNum == "VS301" || flightNum == "VS401" || flightNum == "VS412" || flightNum == "VS450") { worksheet.Cells[y, 6].Value = Convert.ToDateTime(inbound.Date).AddDays(1); } else { worksheet.Cells[y, 6].Value = inbound.Date; } worksheet.Cells[y, 6].Style.Numberformat.Format = "dd-mm-yyyy"; worksheet.Cells[y, 6].Style.Numberformat.Format = "dd-mm-yyyy"; worksheet.Cells[y, 6].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 7].Value = inbound.Count; worksheet.Cells[y, 7].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 8].Value = inbound.Bound; worksheet.Cells[y, 8].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 9].Value = inbound.MenuCode; worksheet.Cells[y, 9].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); if (inbound.ClassName == "J") { worksheet.Cells[y, 10].Value = inbound.TEAMenuCode; } else { worksheet.Cells[y, 10].Value = ""; } worksheet.Cells[y, 10].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); if (inbound.ClassName == "J") { worksheet.Cells[y, 11].Value = inbound.BRKMenuCode; } else { worksheet.Cells[y, 11].Value = ""; } worksheet.Cells[y, 11].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); }
private static void WriteOutboundBoxTicketRow(ExcelWorksheet worksheet, int y, tBoxTicketData dateBoxOutbound) { worksheet.Cells[y, 1].Value = dateBoxOutbound.ClassName; worksheet.Cells[y, 1].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 2].Value = dateBoxOutbound.ShipTo; worksheet.Cells[y, 2].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 3].Value = dateBoxOutbound.FlightNo; worksheet.Cells[y, 3].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 4].Value = dateBoxOutbound.Route; worksheet.Cells[y, 4].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 5].Value = dateBoxOutbound.Time; worksheet.Cells[y, 5].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 6].Style.Numberformat.Format = "dd-mm-yyyy"; worksheet.Cells[y, 6].Value = dateBoxOutbound.Date; worksheet.Cells[y, 6].Style.Numberformat.Format = "dd-mm-yyyy"; worksheet.Cells[y, 6].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 7].Value = dateBoxOutbound.Count; worksheet.Cells[y, 7].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 8].Value = dateBoxOutbound.Bound; worksheet.Cells[y, 8].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); worksheet.Cells[y, 9].Value = dateBoxOutbound.MenuCode; worksheet.Cells[y, 9].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); if (dateBoxOutbound.ClassName == "J") { worksheet.Cells[y, 10].Value = dateBoxOutbound.TEAMenuCode; } else { worksheet.Cells[y, 10].Value = ""; } worksheet.Cells[y, 10].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); if (dateBoxOutbound.ClassName == "J") { worksheet.Cells[y, 11].Value = dateBoxOutbound.BRKMenuCode; } else { worksheet.Cells[y, 11].Value = ""; } worksheet.Cells[y, 11].Style.Border.BorderAround( OfficeOpenXml.Style.ExcelBorderStyle.Thin, System.Drawing.Color.Black); }
public void AddBoxTicketData(tBoxTicketData boxTicketData) { _context.tBoxTicketData.Add(boxTicketData); _context.SaveChanges(); }