package asa.service.impl;

import asa.service.ConstantsInterface;
import asa.service.AppointmentService;
import asa.dao.ScheduleDAO ;
import asa.bean.Appointment;
import asa.model.Schedule;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils;
import java.util.*;


@Service("appointmentService")
public class AppointmentServiceImpl implements ConstantsInterface,AppointmentService{
	
	@Autowired
	private ScheduleDAO scheduleDAO;		
		
    public List<Appointment> get(){
	return new ArrayList<Appointment>();
    }

    
	public boolean add(Appointment appointment){
	Schedule schedule= new Schedule();
      BeanUtils.copyProperties(appointment,schedule);
	System.out.println(appointment.getDate()+" - "+schedule.getDate());
      try{
        scheduleDAO.save(schedule);
      }
      
      //failure
      catch(Exception e){
        System.out.println("add Appointment failed due to:\n"+e);
        return false;
      }
      
      //success
      return true;
    }
	
}

@@ -829,21 +829,16 @@
     
- try%7B
 %0A       
  sch
@@ -833,17 +833,19 @@
 %0A       
- 
+if(
 schedule
@@ -852,12 +852,14 @@
 DAO.
-save
+insert
 (sch
@@ -868,64 +868,14 @@
 ule)
-;%0A      %7D%0A      %0A      //failure%0A      catch(Exception e
+==null
 )%7B%0A 
@@ -880,17 +880,18 @@
 %0A       
- 
+%09%09
 System.o
@@ -944,24 +944,25 @@
 e);%0A        
+%09
 return false
@@ -973,16 +973,13 @@
     
+ 
 %7D%0A
-      
+%09%09
 %0A   

Update AppointmentServiceImpl.java