public ActionResult Create(CreateProspectModel createProspectModel) { var prospectModel = createProspectModel.ProspectModel; prospectModel.Team = GetTeamWithId(createProspectModel.TeamId, createProspectModel.PossibleTeams); var dProspect = Mapper.Map<DProspect>(prospectModel); IDatabaseAccessor db = new SqlDatabaseAccessor(MvcApplication.GetMockDraftConnectionStringName()); if (ModelState.IsValid) { if (db.ProspectExists(dProspect)) { ViewBag.Feedback = createProspectModel.AlreadyExistedErrorMessage; return View(createProspectModel); } db.AddProspect(dProspect); ViewBag.Feedback = createProspectModel.SuccessMessage; } var newProspectModel = new CreateProspectModel(); return View(newProspectModel); }
public ActionResult Create() { var createProspectModel = new CreateProspectModel(); return View(createProspectModel); }