public void Add(AppointmentCategoryDTO appointmentCategory, int appointmentCategoryId) { AppointmentCategory model = _mapper.Map <AppointmentCategory>(appointmentCategory); model.CreationDate = DateTime.Now; model.CreatedBy = appointmentCategoryId; dbset.Add(model); }
public void Update(AppointmentCategoryDTO appointmentCategory, int appointmentCategoryId) { AppointmentCategory model = _mapper.Map <AppointmentCategory>(appointmentCategory); model.ModifiedDate = DateTime.Now; model.ModifiedBy = appointmentCategoryId; 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(AppointmentCategoryDTO appointmentCategory, int appointmentCategoryId) { try { appointmentCategoryRepository.Update(appointmentCategory, appointmentCategoryId); UoW.SaveChanges(); } catch (Exception e) { throw e; } }
public List <AppointmentCategoryDTO> Delete(AppointmentCategoryDTO appointmentCategory, GridSettings gridSettings) { try { appointmentCategoryRepository.Delete(appointmentCategory); UoW.SaveChanges(); } catch (Exception e) { throw e; } return(GetAll(gridSettings)); }
public void Delete(AppointmentCategoryDTO appointmentCategory) { dbset.Remove(_mapper.Map <AppointmentCategory>(appointmentCategory)); }