/// <summary> /// created by Ashwajit Bansod dated : 09/01/2017 /// For Deleting eFleet Preventative Maintenance /// </summary> /// <param name="VehicleId"></param> /// <param name="loggedInUserId"></param> /// <returns></returns> public Result DeleteeFleetPM(long VehicleId, long loggedInUserId, string location) { var objDAR = new DARModel(); try { Result result; if (VehicleId > 0) { var objeFleetPreventativeMaintenanceRepository = new eFleetPreventativeMaintenanceRepository(); var data = objeFleetPreventativeMaintenanceRepository.GetSingleOrDefault(v => v.ID == VehicleId && v.IsDeleted == false); // PmID in Ashwajit Created Table if (data != null) { data.IsDeleted = true; data.DeletedBy = loggedInUserId; data.DeletedDate = DateTime.UtcNow; objeFleetPreventativeMaintenanceRepository.Update(data); objeFleetPreventativeMaintenanceRepository.SaveChanges(); objDAR.ActivityDetails = DarMessage.DeleteFleetPM(location); objDAR.TaskType = (long)TaskTypeCategory.DeletePreventativeMaintenance; #region Save DAR objDAR.LocationId = data.LocationID; objDAR.UserId = loggedInUserId; objDAR.DeletedBy = data.DeletedBy; objDAR.DeletedOn = DateTime.UtcNow; result = _ICommonMethod.SaveDAR(objDAR); #endregion Save DAR return(Result.Delete); } } else { return(Result.DoesNotExist); } return(Result.Delete); } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public Result DeleteeFleetPM(long VehicleId, long loggedInUserId)", "Exception While Deleting Preventative Maintenence.", null); throw; } }