public void GetLatestActiveTruckWeight(string TruckPlateNo, string TrailerPlateNo) { TruckWeight obj = null; obj = TruckWeightDAL.GetLatestActiveTruckWeight(TruckPlateNo, TrailerPlateNo); if (obj != null) { this.Id = obj.Id; this.TruckPlateNo = obj.TruckPlateNo; this.TrailerPlateNo = obj.TrailerPlateNo; this.hasTrailer = obj.hasTrailer; this.DateWeighed = obj.DateWeighed; this.Weight = obj.Weight; this.Status = obj.Status; } }
public static TruckWeight GetLatestActiveWeight(string TruckPlateNo, string TrailerPlateNo) { TruckWeight obj = null; //Truck only if ((string.IsNullOrEmpty(TruckPlateNo) != true) && (string.IsNullOrEmpty(TrailerPlateNo) == true)) { obj = TruckWeightDAL.GetLatestActiveTruckWeight(TruckPlateNo, TrailerPlateNo); } //Trailer only else if ((string.IsNullOrEmpty(TruckPlateNo) == true) && (string.IsNullOrEmpty(TrailerPlateNo) != true)) { obj = TruckWeightDAL.GetLatestActiveTrailerWeight(TruckPlateNo, TrailerPlateNo); } else if ((string.IsNullOrEmpty(TruckPlateNo) != true) && (string.IsNullOrEmpty(TrailerPlateNo) != true)) { obj = TruckWeightDAL.GetLatestActivetTruckTrailerWeight(TruckPlateNo, TrailerPlateNo); } else { throw new Exception("Truck type is not determinded"); } return(obj); }