public void UpdatePatientAppointment(tblPatientAppointment obj) { db.tblPatientAppointments.Attach(obj); var update = db.Entry(obj); update.Property(x => x.Description).IsModified = true; update.Property(x => x.AppointmentDate).IsModified = true; update.Property(x => x.DoctorID).IsModified = true; update.Property(x => x.isActive).IsModified = true; db.SaveChanges(); }
public void SavePatientAppointment(tblPatientAppointment obj) { //obj.ID = 18; try { db.tblPatientAppointments.Add(obj); db.SaveChanges(); } catch (Exception ex) { string error = ex.ToString(); } }