1
namespace Employee.Controllers
{
public class EmployeController : Controller
{
EmployeeEntities db = new EmployeeEntities();
// GET: Employe
public ActionResult Index()
{
return View(db.Tables.ToList());
}
// GET: Add Employee
[HttpGet]
public ActionResult Create()
{
return View();
}
[HttpPost]
// POST
public ActionResult Create(EmployeController employe)
{
if(ModelState.IsValid)
{
db.Tables.Add(employe);
}
return View(employe);
}