public ActionResult formCollection(FormCollection formCollection) { Employee emp = new Employee(); DataAccessLib db = new DataAccessLib(); emp.Name = formCollection["Name"]; emp.Designation = formCollection["Designation"]; emp.Gender = formCollection["Gender"]; emp.Salary = Convert.ToDouble(formCollection["Salary"]); emp.City = formCollection["City"]; emp.State = formCollection["State"]; emp.Zip = formCollection["Zip"]; db.AddEmployees(emp); return RedirectToAction("Index"); }
// // GET: /Employee/ public ActionResult Index() { DataAccessLib db = new DataAccessLib(); return View(db.GetEmployees); }