public void DeleteSPKSchedule(SPKScheduleViewModel SPKSchedule) { SPKSchedule entity = _SPKScheduleRepository.GetById(SPKSchedule.Id); entity.Status = (int)DbConstant.DefaultDataStatus.Deleted; _SPKScheduleRepository.Update(entity); _unitOfWork.SaveChanges(); }
public void UpdateSPKSchedule(SPKScheduleViewModel SPKSchedule, int userId) { DateTime serverTime = DateTime.Now; SPKSchedule entity = _SPKScheduleRepository.GetById(SPKSchedule.Id); entity.ModifyDate = serverTime; entity.ModifyUserId = userId; entity.Date = SPKSchedule.Date; entity.Description = SPKSchedule.Description; entity.SPKId = SPKSchedule.SPKId; entity.MechanicId = SPKSchedule.MechanicId; //Map(SPKSchedule, entity); //_SPKScheduleRepository.AttachNavigation<Mechanic>(entity.Mechanic); //_SPKScheduleRepository.AttachNavigation<SPK>(entity.SPK); _SPKScheduleRepository.Update(entity); _unitOfWork.SaveChanges(); }