コード例 #1
0
        public ActionResult Create(CreateProbationaryContractModel createprobationarycontractplanmodel)
        {
            if (ModelState.IsValid)
            {
                createprobationarycontractplanmodel._probationaryContractPlan.advisementid = Guid.NewGuid();
                db.probationaryContractPlans.AddObject(createprobationarycontractplanmodel._probationaryContractPlan);
                db.SaveChanges();
                return RedirectToAction("Details/" + createprobationarycontractplanmodel._probationaryContractPlan.advisementid);
            }

            return View(createprobationarycontractplanmodel);
        }
コード例 #2
0
 //
 // GET: /ProbationaryContract/Create
 /// <summary>
 /// Create gets the required data
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult Create(Guid id)
 {
     try
     {
         if (id != null)
         {
             probationaryContractPlan probationaryContractPlan = new probationaryContractPlan() { issueid = id, date = DateTime.Now };
             issue issue = db.issues.Single(i => i.issueid == id);
             student student = db.students.Include("program").Single(s => s.studentid == issue.studentid);
             CreateProbationaryContractModel Model = new CreateProbationaryContractModel() { _probationaryContractPlan = probationaryContractPlan, _student = student };
             return View(Model);
         }
         else
         {
             return RedirectToAction("Index", "Issue");
         }
     }
     catch (Exception)
     {
         return RedirectToAction("Index", "Issue");
     }
 }