Beispiel #1
0
 public ActionResult WoredasBidStatus()
 {
     var filter = new PriceQuotationFilterViewModel();
     ViewBag.filter = filter;
     ViewBag.BidID = new SelectList(_bidService.GetAllBid(), "BidID", "BidNumber");
     ViewBag.RegionID = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name");
     ViewBag.HubID = new SelectList(_hubService.GetAllHub(), "HubID", "Name", "Select Hub");
     return View("WoredaWithOutBidOfferFilterParial", filter);
 }
 public ActionResult BidProposal()
 {
     var filter = new PriceQuotationFilterViewModel();
     ViewBag.filter = filter;
     LoadLookups();
     return View(filter);
 }
 public ActionResult EditStart(PriceQuotationFilterViewModel model)
 {
     List<PriceQuotationDetailViewModel> qoutation = populateForm(model);
     Session["PriceQuotationFilter"] = model;
     return View(qoutation);
 }
        public List<PriceQuotationDetailViewModel> populateForm(PriceQuotationFilterViewModel model)
        {
            Session["PriceQuotationFilter"] = model;
            LoadLookups();
            ViewBag.ModelFilter = model;
            ViewBag.SelectedRegion = _adminUnitService.FindById(model.RegionID);
            int bidID = model.BidID;

            ViewBag.SelectedTransporter = _transporterService.FindById(model.TransporterID);
            Bid SelectedBid = _bidService.FindById(bidID);
            ViewBag.SelectedBid = SelectedBid;
            int bidPlanID = SelectedBid.TransportBidPlanID;

            List<GoodsMovementDetailViewModel> quotationDestinations = GetPlannedDistribution(bidPlanID, model.RegionID);
            List<PriceQuotationDetailViewModel> qoutation = GetPriceQuotation(quotationDestinations, model.TransporterID, bidID);

            // return View(qoutation);

            List<TransportBidQuotation> transporterQuote = _bidQuotationService.FindBy(t => t.BidID == bidID && t.TransporterID == model.TransporterID);
            Dictionary<string, PriceQuotationDetailViewModel> transporterQuoteDictionary = organizeList(qoutation);

            foreach (TransportBidQuotation i in transporterQuote)
            {
                string hash = i.BidID + "_" + i.TransporterID + "_" + i.SourceID + "_" + i.DestinationID;
                if (transporterQuoteDictionary.ContainsKey(hash))
                {
                    PriceQuotationDetailViewModel pq = transporterQuoteDictionary[hash];
                    pq.TransportBidQuotationID = i.TransportBidQuotationID;
                    pq.Tariff = (int)i.Tariff;
                    pq.Remark = i.Remark;
                    pq.IsWinner = i.IsWinner;
                    pq.Rank = i.Position;

                }
            }
            return qoutation;
        }
 public ActionResult Index()
 {
     LoadLookups();
     var model = new PriceQuotationFilterViewModel();
     //return View(model);
     return View();
 }