Beispiel #1
0
        public JsonResult LoadDepartment(int?depID)
        {
            departmentFactory = new DepartmentFactorys();
            List <DAL.db.Department> list = departmentFactory.SearchDepartment(depID);
            var empList = list.Select(x => new { x.DepartmentID, x.DepartmentName });

            return(Json(empList, JsonRequestBehavior.AllowGet));
        }
        public JsonResult DepartmentCreate(DAL.db.Department dept)
        {
            result = new Result();

            DepartmentFactory = new DepartmentFactorys();
            result            = DepartmentFactory.SaveDepartment(dept);

            return(Json(result));
        }
        public JsonResult DepartmentLists(int?DepartmentID)
        {
            result = new Result();

            DepartmentFactory = new DepartmentFactorys();
            List <DAL.db.Department> list = DepartmentFactory.SearchDepartment(DepartmentID);
            var deptList = list.Select(x => new { x.DepartmentID, x.DepartmentName });

            return(Json(deptList, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
 public ParcelService(IDepartmentFactory departmentFactory)
 {
     _departmentFactory = departmentFactory;
 }
 public DepartmentApiController()
 {
     departmentFactory=new DepartmentFactory();
 }