public ActionResult GetRequisitionDetails(int id) { RequisitionService rservice = new RequisitionService(); List <RequisitionDetails> rDetails = rservice.GetRequisitionDetails(id); ViewBag.rDetails = rDetails; return(View()); }
public void GetRequisitionDetailsTest() { // Arrange string reqId = "GAB1"; // Act List <RequisitionDetail> reqList = requisitionService.GetRequisitionDetails(reqId); // Assert - Should return a List<Requistion> where Requisition.RequisitionId equals the one passed in foreach (RequisitionDetail rd in reqList) { Assert.AreEqual(rd.RequisitionId, reqId); } }
public IEnumerable <RequisitionDetailVTableiewModel> GetAllRequisitionDetails(string rid) { List <RequisitionDetail> reqDetailList = requisitionService.GetRequisitionDetails(rid); List <RequisitionDetailVTableiewModel> viewModel = new List <RequisitionDetailVTableiewModel>(); foreach (RequisitionDetail r in reqDetailList) { viewModel.Add(new RequisitionDetailVTableiewModel { ItemCode = r.ItemCode, Description = r.Item.Description, Quantity = r.Quantity, Status = r.Status.Name }); } return(viewModel); }