public TblTrailerTruck InsertTblTrailerTruckToDataBase(TblTrailerTruck nTrailer)
        {
            try
            {
                if (nTrailer != null)
                {
                    nTrailer.CreateDate = this.DateOfServer;
                    nTrailer.Creator    = nTrailer.Creator ?? "someone";

                    this.Context.TblTrailerTruck.Add(nTrailer);
                    return(this.Context.SaveChanges() > 0 ? this.GetTblTrailerTruckWithKey(nTrailer.TrailerId) : null);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Has error " + ex.ToString());
            }
            return(null);
        }
        public TblTrailerTruck UpdateTblTrailerTruckToDataBase(int TrailerID, TblTrailerTruck uTrailer)
        {
            try
            {
                var dbTrailer = this.Context.TblTrailerTruck.Find(TrailerID);
                if (dbTrailer != null)
                {
                    uTrailer.CreateDate = dbTrailer.CreateDate;
                    uTrailer.ModifyDate = this.DateOfServer;
                    uTrailer.Modifyer   = uTrailer.Modifyer ?? "someone";

                    this.Context.Entry(dbTrailer).CurrentValues.SetValues(uTrailer);
                    return(this.Context.SaveChanges() > 0 ? this.GetTblTrailerTruckWithKey(TrailerID) : null);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Has error " + ex.ToString());
            }
            return(null);
        }