public void FleetPlanMovementUpdate(int fleetPlanEntryID, int fleetPlanDetailID, int locationGroupFrom, int locationGroupTo, string carClass, int movementCount, DateTime dateOfMovement) { FleetPlanDetail fleetplanDetailAddition = new FleetPlanDetail(); FleetPlanDetail fleetplanDetailDeletion = new FleetPlanDetail(); fleetplanDetailAddition.FleetPlanEntryID = fleetPlanEntryID; fleetplanDetailAddition.FleetPlanDetailID = fleetPlanDetailID; fleetplanDetailAddition.LocationGroup.LocationGroupID = locationGroupTo; fleetplanDetailAddition.Addition = movementCount; fleetplanDetailAddition.DateOfMovement = dateOfMovement; fleetplanDetailAddition.CarGroup.CarGroupID = Convert.ToInt32(carClass); fleetplanDetailDeletion.FleetPlanEntryID = fleetPlanEntryID; fleetplanDetailDeletion.FleetPlanDetailID = fleetPlanDetailID; fleetplanDetailDeletion.LocationGroup.LocationGroupID = locationGroupFrom; fleetplanDetailDeletion.Deletion = movementCount; fleetplanDetailDeletion.DateOfMovement = dateOfMovement; fleetplanDetailDeletion.CarGroup.CarGroupID = Convert.ToInt32(carClass); try { using (TransactionScope scope = new TransactionScope()) { dal.FleetPlanUpdate(fleetplanDetailAddition); dal.FleetPlanUpdate(fleetplanDetailDeletion); scope.Complete(); } } catch { // do nothing } }
public void FleetPlanAddDelUpdate(int fleetPlanEntryID, int fleetPlanDetailID, int targetLocationGroup, string carClass, int addition, int deletion, DateTime dateOfMovement) { var fleetplanDetail = new FleetPlanDetail { FleetPlanEntryID = fleetPlanEntryID, FleetPlanDetailID = fleetPlanDetailID, LocationGroup = { LocationGroupID = targetLocationGroup }, Addition = addition, Deletion = deletion, DateOfMovement = dateOfMovement, CarGroup = { CarGroupID = Convert.ToInt32(carClass) } }; dal.FleetPlanUpdate(fleetplanDetail); }
public FleetPlanDetail GetFleetPlanDetailByID(int fleetPlanDetailID) { FleetPlanDetail fleetplanDetail = dal.GetFleetPlanDetailByID(fleetPlanDetailID); return(fleetplanDetail); }