Beispiel #1
0
        public void TestGetDeptById()
        {
            var deptName = "Gateway Digital";
            var dept     = _deptManager.GetDeptByIdBAL(20019);

            Assert.Equal(deptName, dept.DepartmentName);
        }
Beispiel #2
0
        public ActionResult GetDepartmentById(string DepartmentID)
        {
            var objDept = new DepartmentViewModel();
            int Id      = Convert.ToInt32(DepartmentID);

            try
            {
                objDept = _deptManager.GetDeptByIdBAL(Id);
                if (objDept == null)
                {
                    return(NotFound());
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(Ok(objDept));
        }