Exemplo n.º 1
0
        public DepartmentViewModelTests()
        {
            ViewModelUtils vUtil = new ViewModelUtils();

            vUtil.LoadCollections();

            DepartmentViewModel vm = new DepartmentViewModel();

            vm.Name = "Administration";
            vm.GetByDepartmentName();
            did = vm.Id;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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."));
     }
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 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"));
            }
        }