Beispiel #1
0
        public int Update(AppointmentsItem model)
        {
            Mapper.CreateMap <AppointmentsItem, AppointmentsMaster>();
            AppointmentsMaster objAppoint = DbContext.AppointmentsMasters.SingleOrDefault(m => m.ID == model.ID);

            objAppoint = Mapper.Map(model, objAppoint);
            return(DbContext.SaveChanges());
        }
Beispiel #2
0
        public AppointmentsItem GetById(int id)
        {
            Mapper.CreateMap <AppointmentsMaster, AppointmentsItem>();
            AppointmentsMaster objAppoint     = DbContext.AppointmentsMasters.SingleOrDefault(m => m.ID == id);
            AppointmentsItem   objAppointItem = Mapper.Map <AppointmentsItem>(objAppoint);

            return(objAppointItem);
        }
Beispiel #3
0
 public int Insert(AppointmentsItem model)
 {
     try
     {
         Mapper.CreateMap <AppointmentsItem, AppointmentsMaster>();
         AppointmentsMaster objAppoint = Mapper.Map <AppointmentsMaster>(model);
         DbContext.AppointmentsMasters.Add(objAppoint);
         return(DbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw;
     }
 }