예제 #1
0
        //START~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~B
        public ActionResult ReadAjax([DataSourceRequest] DataSourceRequest request)
        {
            PriceQuotationFilterViewModel        model     = (PriceQuotationFilterViewModel)Session["PriceQuotationFilter"];
            List <PriceQuotationDetailViewModel> qoutation = populateForm(model);

            return(Json(qoutation.ToDataSourceResult(request), JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult EditStart(PriceQuotationFilterViewModel model)
        {
            List <PriceQuotationDetailViewModel> qoutation = populateForm(model);

            Session["PriceQuotationFilter"] = model;
            return(View(qoutation));
        }
예제 #3
0
        public ActionResult BidProposal()
        {
            var filter = new PriceQuotationFilterViewModel();

            ViewBag.filter = filter;
            LoadLookups();
            return(View(filter));
        }
예제 #4
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));
        }
예제 #5
0
        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);
        }