Beispiel #1
0
        public DepartmentViewModelTests()
        {
            ViewModelUtils vUtil = new ViewModelUtils();

            vUtil.LoadCollections();

            DepartmentViewModel vm = new DepartmentViewModel();

            vm.Name = "Administration";
            vm.GetByDepartmentName();
            did = vm.Id;
        }
Beispiel #2
0
        public EmployeeViewModelTests()
        {
            ViewModelUtils vUtil = new ViewModelUtils();

            vUtil.LoadCollections();

            EmployeeViewModel vm = new EmployeeViewModel();

            vm.Lastname = "Smartypants";
            vm.GetByLastname();
            eid = vm.Id;
            did = vm.DepartmentId;
        }
Beispiel #3
0
 public IHttpActionResult Get()
 {
     try
     {
         ViewModelUtils utils = new ViewModelUtils();
         if (utils.LoadCollections())
         {
             return(Ok("Collections created!"));
         }
         else
         {
             return(Ok("Collections not created!"));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest("Collections creation failed."));
     }
 }
Beispiel #4
0
 public IHttpActionResult Post()
 {
     try
     {
         ViewModelUtils utils = new ViewModelUtils();
         if (utils.LoadCollections())
         {
             return(Ok("Collections have been reloading succesfully!"));
         }
         else
         {
             return(Ok("Helpdesk failed to reload collections."));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest("Create failed - " + ex.Message));
     }
 }
Beispiel #5
0
        public IHttpActionResult Get()
        {
            try
            {
                ViewModelUtils utils = new ViewModelUtils();

                if (utils.LoadCollections())
                {
                    return(Ok("Collections Created!"));
                }
                else
                {
                    return(Ok("Collections Not Created!"));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest("Collections creation failed - Contact Tech Support"));
            }
        }