public async Task <IActionResult> GetVendorsAndItems(int RfPid)
        {
            var model = new ProcessRFQModel();
            await _rfqService.PrepareProcessRFQ(RfPid, model);

            return(new JsonResult(model));
        }
Beispiel #2
0
        public async Task <ProcessRFQModel> PrepareProcessRFQ(int rfpid,
                                                              ProcessRFQModel model)
        {
            model.rfp = _mapper.Map <RfprfqModel>(_rfpRepository.Table.Where(c => c.Rfpid.Equals(rfpid)).FirstOrDefault());

            var vendors = _rfpVendorRepository.Table.Where(c => c.Rfpid == rfpid).ToList();

            model.RFPVendorList = _mapper.Map <List <RFPVendorModel> >(vendors);

            var items = _rfpItemRepository.Table.Where(c => c.Rfpid == rfpid).ToList();

            model.RFPItemList = _mapper.Map <List <RFPItemModel> >(items);

            return(model);
        }
        public async Task <IActionResult> ProcessRFQ()
        {
            var model = new ProcessRFQModel();

            model.AvailableRfqName.Add(new SelectListItem {
                Text = "SELECT", Value = "1"
            });

            foreach (var item in (await _rfqService.GetRfpNames()))
            {
                model.AvailableRfqName.Add(new SelectListItem {
                    Text = item.Rfptitle, Value = item.Rfpid.ToString()
                });
            }

            return(View(model));
        }