Ejemplo n.º 1
0
        public bool SaveRefeul(int id, string beforeFuel, string refuelAmount)
        {
            try
            {
                var req = new Repository <FuelTracker>(_context);

                var fuelTracker = new FuelTracker()
                {
                    CarId      = id,
                    FuelBefore = Convert.ToDouble(beforeFuel),
                    FuelAmount = Convert.ToDouble(refuelAmount),
                    FuelAfter  = Convert.ToDouble(beforeFuel) + Convert.ToDouble(refuelAmount),
                    FuelDate   = DateTime.Now
                };

                req.Add(fuelTracker);
                req.SaveChanges();

                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        GameObject fTracker = GameObject.Find("FuelTracker");

        if (fTracker == null)
        {
            Debug.Log("Cannot find FuelTracker!");
        }
        else
        {
            fuelTracker = fTracker.GetComponent <FuelTracker>();
        }
    }
 public UpdatedCarMessage(FuelTracker.Web.Car car)
 {
     this.Car = car;
 }
 public UpdatedUserProfileMessage(FuelTracker.Web.UserProfile userProfile)
 {
     this.UserProfile = userProfile;
 }
 public LaunchNewCarMessage(FuelTracker.Web.Car car)
 {
     this.Car = car;
 }
Ejemplo n.º 6
0
 public void Awake()
 {
     instance = this;
 }
 public LaunchNewUserProfileMessage(FuelTracker.Web.UserProfile userProfile)
 {
     this.UserProfile = userProfile;
 }
Ejemplo n.º 8
0
 void Awake()
 {
     // Update our singleton to the current active instance
     instance = this;
 }