public ActionResult Create([Bind(Exclude = "DeveloperID")] Developer newDev /*string FirstName, string LastName, string Email, string PhoneNumber, string Position, string TeamName*/)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                /*
                 * Developer dev = new Developer();
                 * dev.FirstName = FirstName;
                 * dev.LastName = LastName;
                 * dev.Email = Email;
                 * dev.PhoneNumber = PhoneNumber;
                 * dev.Position = Position;
                 * dev.TeamName = TeamName;
                 */

                newDev.UserName = Membership.GetUser().UserName;

                _dataModel.AddToDevelopers(newDev);
                _dataModel.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Register(RegisterDeveloperModel model)
        {
            if (ModelState.IsValid)
            {
                // Attempt to register the user
                MembershipCreateStatus createStatus;
                Membership.CreateUser(model.register.UserName, model.register.Password, model.register.Email, null, null, true, null, out createStatus);

                if (createStatus == MembershipCreateStatus.Success)
                {
                    Developer dev = new Developer();
                    dev.FirstName   = model.developer.FirstName;
                    dev.LastName    = model.developer.LastName;
                    dev.Email       = model.register.Email;
                    dev.PhoneNumber = model.developer.PhoneNumber;
                    dev.Position    = model.developer.Position;
                    dev.UserName    = model.register.UserName;
                    db.AddToDevelopers(dev);
                    db.SaveChanges();

                    FormsAuthentication.SetAuthCookie(model.register.UserName, false /* createPersistentCookie */);
                    return(RedirectToAction("Index", "Dashboard"));
                }
                else
                {
                    ModelState.AddModelError("", ErrorCodeToString(createStatus));
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }