public ActionResult ExcuseAlarm(string vehicleNumber, string beatNumber, string alarmType, string driverName, string comments) { String retValue = String.Empty; if (!String.IsNullOrEmpty(alarmType) && !String.IsNullOrEmpty(vehicleNumber)) { using (TowTruckServiceRef.TowTruckServiceClient service = new TowTruckServiceRef.TowTruckServiceClient()) { service.ExcuseAlarm(vehicleNumber, beatNumber, alarmType, driverName, comments); Debug.WriteLine("Alarm Excused for " + vehicleNumber); retValue = "Thank you! Alarm successfully excused"; } } return(Json(retValue, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateAlarm(AlarmHistory alarm) { String retValue = String.Empty; if (alarm != null) { using (TowTruckServiceRef.TowTruckServiceClient service = new TowTruckServiceRef.TowTruckServiceClient()) { if (alarm.IsExcused) { service.ExcuseAlarm(alarm.VehicleNumber, alarm.BeatNumber, alarm.AlarmType, alarm.DriverName, alarm.Comments); retValue = "Thank you! Alarm successfully excused"; } else { service.UnexcuseAlarm(alarm.VehicleNumber, alarm.BeatNumber, alarm.AlarmType, alarm.DriverName, alarm.Comments); retValue = "Thank you! Alarm successfully un-excused"; } } } return(Json(retValue, JsonRequestBehavior.AllowGet)); }