//
 // GET: /Issue/Create
 /// <summary>
 /// Gets all required Data for the create view
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult Create(String id)
 {
     student student = db.students.Single(i => i.studentid == id);
     issue issue = new issue() { studentid = id, date = DateTime.Now };
     program program = db.programs.Single(i => i.programcode == student.programcode);
     IEnumerable<catagory> catagory = db.catagories;
     IEnumerable<employee> employee = db.employees;
     List<String> employees = new List<String>();
     employees.Add("Please Select an Employee");
     foreach (employee emp in employee)
     {
         employees.Add(emp.employeeid.Trim() + " - " + emp.fname.Trim() + " " + emp.lname.Trim());
     }
     CreateIssueRequestModel model = new CreateIssueRequestModel() { _issue = issue, _student = student, _program = program, _catagory = catagory, _employee = employees };
     return View(model);
 }
 public ActionResult Create(CreateIssueRequestModel model, String id)
 {
     try
     {
         if (ModelState.IsValid)
         {
             StringBuilder sb = new StringBuilder(model._issue.employeeid.Trim().ToUpper());
             sb.Remove(9, sb.Length - 9);
             model._issue.employeeid = sb.ToString();
             model._issue.issueid = Guid.NewGuid();
             model._issue.studentid = id;
             db.issues.AddObject(model._issue);
             db.SaveChanges();
             return RedirectToAction("Details/" + id, "Student");
         }
     }
     catch (Exception ex)
     {
         ViewBag.studentid = new SelectList(db.students, "studentid", "fname", model._issue.studentid);
         return View(model);
     }
     ViewBag.studentid = new SelectList(db.students, "studentid", "fname", model._issue.studentid);
     return View(model);
 }