Ejemplo n.º 1
0
        public ActionResult Details(int id)
        {
            Step2017Entities1 ent       = new Step2017Entities1();
            EmployeeSearch    empSearch = ent.EmployeeSearches.Where(c => c.Id == id).FirstOrDefault();

            return(View(empSearch));
        }
Ejemplo n.º 2
0
        public ActionResult DetailsEmployee(string name)
        {
            Step2017Entities1 ent = new Step2017Entities1();
            var result            = ent.EmployeeSearches.Where(c => c.Name == name).ToList();

            return(View(result));
        }
Ejemplo n.º 3
0
        public ActionResult List()
        {
            Step2017Entities1     ent       = new Step2017Entities1();
            List <EmployeeSearch> empSearch = ent.EmployeeSearches.ToList();

            return(View(empSearch));
        }
Ejemplo n.º 4
0
        public ActionResult Create(EmployeeSearch empSearch)
        {
            Step2017Entities1 ent = new Step2017Entities1();

            ent.EmployeeSearches.Add(empSearch);
            ent.SaveChanges();
            return(RedirectToAction("List"));
        }
Ejemplo n.º 5
0
        public ActionResult Delete(int id)
        {
            Step2017Entities1 ent = new Step2017Entities1();
            var resultDelete      = ent.EmployeeSearches.Where(c => c.Id == id).FirstOrDefault();

            ent.EmployeeSearches.Remove(resultDelete);
            ent.SaveChanges();
            return(RedirectToAction("List"));
        }
Ejemplo n.º 6
0
        public ActionResult Edit(EmployeeSearch empSearch)
        {
            Step2017Entities1 ent = new Step2017Entities1();
            EmployeeSearch    es  = ent.EmployeeSearches.Where(c => c.Id == empSearch.Id).FirstOrDefault();

            es.Name    = empSearch.Name;
            es.Address = empSearch.Address;
            es.Salary  = empSearch.Salary;
            ent.SaveChanges();
            return(RedirectToAction("List"));
        }