Beispiel #1
0
        public void Add(AppointmentCategoryDTO appointmentCategory, int appointmentCategoryId)
        {
            AppointmentCategory model = _mapper.Map <AppointmentCategory>(appointmentCategory);

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