Exemplo n.º 1
0
        public ActionResult Create(Models.Employee emp)
        {
            var record = new HRMSEntitiesLib.Employee
            {
                Ecode  = emp.Ecode,
                Ename  = emp.Ename,
                Salary = emp.Salary,
                Deptid = emp.Deptid
            };

            //Insert using Business layer
            BusinessLayer bll = new BusinessLayer();

            bll.AddEmployee(record);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult Edit(Models.Employee emp)
        {
            var record = new HRMSEntitiesLib.Employee
            {
                Ecode  = emp.Ecode,
                Ename  = emp.Ename,
                Salary = emp.Salary,
                Deptid = emp.Deptid
            };

            //save to database using business layer
            BusinessLayer bll = new BusinessLayer();

            bll.UpdateEmployee(record);

            return(RedirectToAction("Index"));
        }