public async Task <HttpResponseMessage> AssignTest(Assignedtest assignedtest)
        {
            var content = Utilities.GetRequestContent(assignedtest);
            HttpResponseMessage response = await _httpClient.PostAsync($"Admin/AssignTest", content);

            return(response);
        }
Beispiel #2
0
        public async Task <IActionResult> AssignTest(int id)
        {
            Assignedtest assignedtest = new Assignedtest();

            assignedtest.TestId      = id;
            @ViewBag.ListofCustomers = await _apiHandler.GetCustomers();

            @ViewBag.ListofSimTest = _apiHandler.GetSimTest(id).Result.TestName;
            return(View(assignedtest));
        }
Beispiel #3
0
        public async Task <IActionResult> AssignTest(Assignedtest assignedtest)
        {
            try
            {
                assignedtest.Id = 0;
                var response = _apiHandler.AssignTest(assignedtest);
                Session.Message = new Message()
                {
                    CssClassName = "alert-sucess", Title = "Success!", Messages = "Test Assigned."
                };
                return(RedirectToAction("Index"));
            }
            catch
            {
                Session.Message = new Message()
                {
                    CssClassName = "alert-error", Title = "Error!", Messages = "Operation Failed."
                };
                @ViewBag.ListofCustomers = await _apiHandler.GetCustomers();

                @ViewBag.ListofSimTest = _apiHandler.GetSimTest(assignedtest.TestId).Result.TestName;
                return(View(assignedtest));
            }
        }
Beispiel #4
0
 public IActionResult Result(Assignedtest assignedtest)
 {
     return(View(assignedtest));
 }