public void Load()
 {
     DepartmentList = new departmentList();
     DepartmentList.Load();
     AllEmployees = new employeeList ();
     AllEmployees.Load();//TODO: in real application make paging/sorting
 }
Beispiel #2
0
        public EditEmployeeViewModel(int id)
        {
            DepartmentList = new departmentList();
            DepartmentList.Load();
            var EmployeeList = new employeeList();

            Employee = EmployeeList.LoadId(id);
        }
        public ActionResult Create(FormCollection frm)
        {
            departmentList empList = new departmentList();

            empList.deptId         = int.Parse(frm["deptid"]);
            empList.departmentName = frm["departmentName"];
            empList.empId          = int.Parse(frm["empid"]);
            if (ModelState.IsValid)
            {
                dbEntitles.departmentLists.Add(empList);
                dbEntitles.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Beispiel #4
0
        public ActionResult DepartmentList()
        {
            try
            {
                departmentList dep = new departmentList();
                dep.Load();

                return(Json(new { ok = true, data = dep, message = "ok" }));
            }
            catch (Exception ex)
            {
                return(Json(new { ok = false, message = ex.Message }));
            }
        }
Beispiel #5
0
        public void Initialize()
        {
            var DepartmentList = new departmentList();

            DepartmentList.Load();
            EmployeeListViewModel = new List <EditEmployeeViewModel>();
            var EmployeeList = new employeeList();

            EmployeeList.Load();//TODO: in real application make paging/sorting
            foreach (var item in EmployeeList)
            {
                EditEmployeeViewModel evm = new EditEmployeeViewModel();
                evm.DepartmentList = DepartmentList;
                evm.Employee       = item;
                EmployeeListViewModel.Add(evm);
            }
        }