public void Add(AppointmentAdditionDTO appointmentAddition, int appointmentAdditionId) { AppointmentAddition model = _mapper.Map <AppointmentAddition>(appointmentAddition); model.CreationDate = DateTime.Now; model.CreatedBy = appointmentAdditionId; dbset.Add(model); }
public void Update(AppointmentAdditionDTO appointmentAddition, int appointmentAdditionId) { AppointmentAddition model = _mapper.Map <AppointmentAddition>(appointmentAddition); model.ModifiedDate = DateTime.Now; model.ModifiedBy = appointmentAdditionId; entities.Entry(model).State = EntityState.Modified; entities.Entry(model).Property(m => m.CreatedBy).IsModified = false; entities.Entry(model).Property(m => m.CreationDate).IsModified = false; }
public void Update(AppointmentAdditionDTO appointmentAddition, int appointmentAdditionId) { try { appointmentAdditionRepository.Update(appointmentAddition, appointmentAdditionId); UoW.SaveChanges(); } catch (Exception e) { throw e; } }
public List <AppointmentAdditionDTO> Delete(AppointmentAdditionDTO appointmentAddition, GridSettings gridSettings) { try { appointmentAdditionRepository.Delete(appointmentAddition); UoW.SaveChanges(); } catch (Exception e) { throw e; } return(GetAll(gridSettings)); }
public void Delete(AppointmentAdditionDTO appointmentAddition) { dbset.Remove(_mapper.Map <AppointmentAddition>(appointmentAddition)); }