Esempio n. 1
0
        public bool Update(SqlTransaction tran)
        {
            bool isSaved = false;

            isSaved = TruckWeightDAL.Update(this, tran);
            return(isSaved);
        }
Esempio n. 2
0
        public static List <TruckWeight> GetAllActiveTruckWeight(string TruckPlateNo, string TrailerPlateNo)
        {
            List <TruckWeight> list = null;

            list = TruckWeightDAL.GetAllActiveTruckWeight(TruckPlateNo, TrailerPlateNo);
            return(list);
        }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
        public bool SaveNew()
        {
            bool isSaved = false;

            this.CreatedBy = UserBLL.GetCurrentUser();
            if ((string.IsNullOrEmpty(this.TruckPlateNo) != true) && (string.IsNullOrEmpty(this.TrailerPlateNo) == true))
            {
                this.hasTrailer = TruckHasTrailerType.TruckOnly;
            }
            else if ((string.IsNullOrEmpty(this.TruckPlateNo) == true) && (string.IsNullOrEmpty(this.TrailerPlateNo) != true))
            {
                this.hasTrailer = TruckHasTrailerType.TrailerOnly;
            }
            else if ((string.IsNullOrEmpty(this.TruckPlateNo) != true) && (string.IsNullOrEmpty(this.TrailerPlateNo) != true))
            {
                this.hasTrailer = TruckHasTrailerType.TruckTrailer;
            }
            else if ((string.IsNullOrEmpty(this.TruckPlateNo) == true) && (string.IsNullOrEmpty(this.TrailerPlateNo) == true))
            {
                throw new Exception("Truck Plate No. And Trailer Plate No. Are Both Empty");
            }
            this.Status = TruckWeightStatus.Active;

            //THE FOLLOWING METHOD ADDED BY SINISHAW
            isSaved = TruckWeightDAL.InsertNew(this);

            AuditTrailBLL objAt = new AuditTrailBLL();
            int           at    = -1;

            if (isSaved == true)
            {
                at = objAt.saveAuditTrail(this, WFStepsName.RegisterTruckWeight.ToString(), UserBLL.GetCurrentUser(), "Scaling Information");
                if (at == 1)
                {
                    isSaved = true;
                }
                else
                {
                    isSaved = false;
                }
            }
            return(isSaved);
        }
Esempio n. 5
0
        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);
        }