public void Update(Battery battery)
        {
            Battery rBattery = GetBatteryById(battery.ID);
            if (rBattery == null)
                return;

            rBattery.OutOfCommisionDate = battery.OutOfCommisionDate;
            rBattery.IsActive = battery.IsActive;
            db.SaveChanges();
        }
 public bool CreateBattery(Battery battery)
 {
     try
     {
         _batteryRepository.Insert(battery);
         return true;
     }
     catch (Exception ex)
     {
         HandleLogging.LogMessage(ex, "CreateBattery", 1, WebOperationContext.Current);
         return false;
     }
 }
 public void Insert(Battery battery)
 {
     db.Batteries.Add(battery);
     db.SaveChanges();
 }
 public bool CreateBattery(Battery battery)
 {
     return new StationService().CreateBattery(battery);
 }
 public bool UpdateBattery(Battery battery)
 {
     return new StationService().UpdateBattery(battery);
 }