Example #1
0
        public ActionResult SignUp(MvcEmployee mvcEmployee)
        {
            if (ModelState.IsValid)
            {
                int recordCreated = CreateEmployee(
                    mvcEmployee.EmployeeId,
                    mvcEmployee.FirstName,
                    mvcEmployee.LastName,
                    mvcEmployee.EmailAdress
                    );
                RedirectToAction("Index");
            }

            //Return ti the same page you are
            return(View());
        }
Example #2
0
        public ActionResult ViewEmployees(MvcEmployee mvcEmployee)
        {
            ViewBag.Message = "Enployee Sign Up";
            var data = LoadEmployees();
            List <MvcEmployee> employees = new List <MvcEmployee>();

            foreach (var row in data)
            {
                employees.Add(new MvcEmployee
                {
                    EmployeeId   = row.EmployeeId,
                    FirstName    = row.FirstName,
                    LastName     = row.LastName,
                    EmailAdress  = row.EmailAdress,
                    ConfirmEmail = row.EmailAdress
                });
            }

            //Return ti the same page you are
            return(View(employees));
        }