private SqlParameter[] setStopParameters(ShipScheduleDS.ShipScheduleStopTableRow row) { SqlParameter [] parms = new SqlParameter[7]; parms[0] = new SqlParameter("@StopID", SqlDbType.Char, 13); parms[0].Value = row.StopID; parms[1] = new SqlParameter("@Notes", SqlDbType.Char, 15); if (!row.IsNotesNull()) { parms[1].Value = row.Notes; } parms[2] = new SqlParameter("@ScheduledOFD1", SqlDbType.DateTime, 8); parms[2].Value = row.ScheduledOFD1; parms[3] = new SqlParameter("@ScheduledArrival", SqlDbType.DateTime, 8); parms[3].Value = row.ScheduledArrival; parms[4] = new SqlParameter("@LastUpdated", SqlDbType.DateTime); parms[4].Value = row.LastUpdated; parms[5] = new SqlParameter("@UserID", SqlDbType.VarChar, 50); parms[5].Value = row.UserID; parms[6] = new SqlParameter("@RowVersion", SqlDbType.Char, 24); parms[6].Value = row.RowVersion; parms[6].Direction = ParameterDirection.InputOutput; return(parms); }
private ShipScheduleDS populateTrip(ShipScheduleDS.ShipScheduleTableRow sourceRow) { //Updated with new fields - TractorNumber and FreightAssinged ShipScheduleDS detailDS = new ShipScheduleDS(); //Trip ShipScheduleDS.ShipScheduleTripTableRow tripRow = detailDS.ShipScheduleTripTable.NewShipScheduleTripTableRow(); tripRow.CarrierServiceID = sourceRow.CarrierServiceID; tripRow.LastUpdated = System.DateTime.Now; tripRow.LoadNumber = sourceRow.LoadNumber.Trim(); tripRow.TractorNumber = sourceRow.TractorNumber.Trim(); tripRow.DriverName = sourceRow.DriverName.Trim(); tripRow.RowVersion = sourceRow.SCDERowVersion; tripRow.ScheduledClose = sourceRow.ScheduledClose; tripRow.ScheduledDeparture = sourceRow.ScheduledDeparture; tripRow.TrailerNumber = sourceRow.TrailerNumber.Trim(); tripRow.TripID = sourceRow.TripID; tripRow.UserID = Environment.UserName; if (!sourceRow.IsFreightAssignedNull()) { tripRow.FreightAssigned = sourceRow.FreightAssigned; } if (!sourceRow.IsTrailerCompleteNull()) { tripRow.TrailerComplete = sourceRow.TrailerComplete; } if (!sourceRow.IsTrailerDispatchedNull()) { tripRow.TrailerDispatched = sourceRow.TrailerDispatched; } if (!sourceRow.IsPaperworkCompleteNull()) { tripRow.PaperworkComplete = sourceRow.PaperworkComplete; } if (!sourceRow.IsCanceledNull()) { tripRow.Canceled = sourceRow.Canceled; } detailDS.ShipScheduleTripTable.AddShipScheduleTripTableRow(tripRow); //Associated stops ShipScheduleDS.ShipScheduleStopTableRow stop1Row = detailDS.ShipScheduleStopTable.NewShipScheduleStopTableRow(); stop1Row.LastUpdated = System.DateTime.Now; stop1Row.Notes = sourceRow.Notes; stop1Row.RowVersion = sourceRow.S1RowVersion; stop1Row.ScheduledArrival = sourceRow.ScheduledArrival; stop1Row.ScheduledOFD1 = sourceRow.ScheduledOFD1; stop1Row.StopID = sourceRow.StopID; stop1Row.UserID = sourceRow.S1UserID; detailDS.ShipScheduleStopTable.AddShipScheduleStopTableRow(stop1Row); if (sourceRow.S2MainZone != null & sourceRow.S2MainZone.Trim() != "") { ShipScheduleDS.ShipScheduleStopTableRow stop2Row = detailDS.ShipScheduleStopTable.NewShipScheduleStopTableRow(); stop2Row.LastUpdated = System.DateTime.Now; stop2Row.Notes = sourceRow.S2Notes; stop2Row.RowVersion = sourceRow.S2RowVersion; stop2Row.ScheduledArrival = sourceRow.S2ScheduledArrival; stop2Row.ScheduledOFD1 = sourceRow.S2ScheduledOFD1; stop2Row.StopID = sourceRow.S2StopID; stop2Row.UserID = sourceRow.S2UserID; detailDS.ShipScheduleStopTable.AddShipScheduleStopTableRow(stop2Row); } return(detailDS); }