package com.veggie.src.java;

import com.veggie.src.java.form.AbstractFormBuilder;
import com.veggie.src.java.form.AbstractFormBuilderFactory;
import com.veggie.src.java.form.Form;


public class AddReservationController implements Controller
{
  AbstractFormBuilderFactory fbf;
  AbstractFormBuilder fb;
  Form f;

  public AddReservationController()
  {

  }

  public Form createForm()
  {
    return f;
  }

}

@@ -22,16 +22,77 @@
 c.java;%0A
+import java.util.List;%0A%0Aimport com.veggie.src.java.form.Form;
 %0Aimport 
@@ -224,27 +224,421 @@
 rc.java.
-form.Form;%0A
+notification.Notification;%0Aimport com.veggie.src.java.database.AbstractDatabaseManagerFactory;%0Aimport com.veggie.src.java.database.prototype.PrototypeAccountDatabaseManager;%0Aimport com.veggie.src.java.database.TransactionDatabaseManager;%0Aimport com.veggie.src.java.database.AccountDatabaseManager;%0Aimport com.veggie.src.java.database.ItemDatabaseManager;%0Aimport com.veggie.src.java.ReservationTransaction;
 %0A%0Apublic
@@ -695,16 +695,24 @@
 ler%0A%7B%0A  
+private 
 Abstract
@@ -726,148 +726,1448 @@
 lder
-Factory fbf;%0A  AbstractFormBuilder fb;%0A  Form f;%0A%0A  public AddReservationControll
+ formBuilder;%0A  private Form form;%0A  Notification notification;%0A%0A  public AddReservationController()%0A  %7B%0A    formBuilder = AbstractFormBuilderFactory.getInstance().createFormBuilder();%0A    formBuilder.addField(%22User ID%22);%0A    formBuilder.addField(%22Item ID%22);%0A    form = formBuilder.getResult();%0A  %7D%0A%0A  public Form createForm()%0A  %7B%0A    return form;%0A  %7D%0A  %0A    public Notification submitForm()%0A  %7B%0A      List%3CString%3E formData = form.getData();%0A      int itemid;%0A      int userid;%0A      try%7B%0A      %09userid = Integer.parseInt(formData.get(0));%0A      %09itemid = Integer.parseInt(formData.get(1));%0A         AccountDatabaseManager accountDBManager = AbstractDatabaseManagerFactory.getInstance().createAccountDatabaseManag
 er()
+;
 %0A  
-%7B%0A%0A  %7D%0A%0A  public Form createForm()%0A  %7B%0A    return f;
+       PatronAccount patron;%0A         patron = (PatronAccount)accountDBManager.getUser(userid);%0A         ItemDatabaseManager itemDBManager = AbstractDatabaseManagerFactory.getInstance().createItemDatabaseManager();%0A         MediaItem med = itemDBManager.getItem(itemid);%0A         MediaTitle name = med.getTitle();%0A        ReservationTransaction res = new ReservationTransaction(patron, name, 0);%0A      %09TransactionDatabaseManager transactionDBManager = AbstractDatabaseManagerFactory.getInstance().createTransactionDatabaseManager();%0A      transactionDBManager.addTransaction(res);%0A      %7Dcatch(Exception e)%7B%0A      %09System.out.println(%22Error: incorrect form data%22);%0A      %7D%0A      %0A      return notification;   //???????
 %0A  %7D

Update AddReservationController.java