コード例 #1
0
 public ActionResult Index(int id = 0)
 {
     ViewBag.AssessmentStatus = id;
     ViewData["zones"]        = _adminUnitService.FindBy(t => t.AdminUnitTypeID == 3);
     ViewData["woredas"]      = _adminUnitService.FindBy(t => t.AdminUnitTypeID == 4);
     //ModelState.AddModelError("Success", "Sample Error Message. Use in Your Controller: ModelState.AddModelError('Errors', 'Your Error Message.')");
     return(View());
 }
コード例 #2
0
        public ActionResult Index()
        {
            ViewBag.BidID    = new SelectList(_bidService.GetAllBid(), "BidID", "BidNumber");
            ViewBag.RegionID = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name");

            List <Cats.Models.TransportBidQuotation> list = this._bidQuotationService.GetAllTransportBidQuotation();

            return(View(list));
        }
コード例 #3
0
ファイル: BidController.cs プロジェクト: nathnael/cats
        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));
        }
コード例 #4
0
ファイル: AdminUnitController.cs プロジェクト: nathnael/cats
        public JsonResult AdminUnit_Read([DataSourceRequest] DataSourceRequest request, int parentAdminUnitID)
        {
            List <AdminUnit> admins = _adminUnitService.FindBy(t => t != null && (t.ParentID == parentAdminUnitID));
            var adminUnitViewModel  = AdminUnitViewModelBinder.BindListAdminUnitViewModel(admins);

            return(Json(adminUnitViewModel.ToDataSourceResult(request), JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
        public ActionResult Create(TransportBidPlan transportbidplan)
        {
            if (ModelState.IsValid)
            {
                ViewBag.Message = "Invalid Model";
                var transportPlan = _transportBidPlanService.FindBy(m => m.Year == transportbidplan.Year && m.YearHalf == transportbidplan.YearHalf).FirstOrDefault();
                if (transportPlan == null)
                {
                    var woredas = _adminUnitService.FindBy(m => m.AdminUnitTypeID == 4);
                    var psnptransportBidPlanDetail = (from detail in woredas
                                                      where _transportBidPlanDetailService.GetWoredaGroupedPsnpAmount(detail.AdminUnitID) > 0
                                                      select new TransportBidPlanDetail()
                    {
                        DestinationID = detail.AdminUnitID,
                        SourceID =
                            _hubService.GetNearestWarehouse(detail.AdminUnitID).
                            HubID,
                        ProgramID = 2,
                        Quantity =
                            _transportBidPlanDetailService.
                            GetWoredaGroupedPsnpAmount(detail.AdminUnitID)
                    }).ToList();

                    var relieftransportBidPlanDetail = (from detail in woredas
                                                        where _transportBidPlanDetailService.GetHrdCommodityAmount(detail.AdminUnitID) > 0
                                                        select new TransportBidPlanDetail()
                    {
                        DestinationID = detail.AdminUnitID,
                        SourceID =
                            _hubService.GetNearestWarehouse(detail.AdminUnitID).
                            HubID,
                        ProgramID = 1,
                        Quantity =
                            _transportBidPlanDetailService.GetHrdCommodityAmount
                                (detail.AdminUnitID)
                    }).ToList();
                    var transportbidplanDetail = psnptransportBidPlanDetail.Union(relieftransportBidPlanDetail).ToList();
                    transportbidplan.TransportBidPlanDetails = transportbidplanDetail;
                    _transportBidPlanService.AddTransportBidPlan(transportbidplan);
                    return(RedirectToAction("Index"));
                }
                ModelState.AddModelError("Errors", @"Bid Plan For this Year and Period already Exists");
            }

            loadLookups(transportbidplan);
            return(View(transportbidplan));
        }
コード例 #6
0
ファイル: HRDController.cs プロジェクト: nathnael/cats
        public ActionResult CreateHRD(HRD hrd)
        {
            DateTime dateCreated   = DateTime.Now;
            DateTime DatePublished = DateTime.Now;

            hrd.CreatedDate   = dateCreated;
            hrd.PublishedDate = DatePublished;
            hrd.Status        = 1;

            if (ModelState.IsValid)
            {
                try
                {
                    var userid  = _needAssessmentService.GetUserProfileId(HttpContext.User.Identity.Name);
                    var woredas = _adminUnitService.FindBy(m => m.AdminUnitTypeID == 4);
                    hrd.CreatedBY = userid;
                    var hrdDetails = (from detail in woredas
                                      select new HRDDetail
                    {
                        WoredaID = detail.AdminUnitID,
                        StartingMonth = dateCreated.Month,
                        NumberOfBeneficiaries =
                            _needAssessmentDetailService.GetNeedAssessmentBeneficiaryNoFromPlan(
                                hrd.PlanID, detail.AdminUnitID),
                        DurationOfAssistance =
                            _needAssessmentDetailService.GetNeedAssessmentMonthsFromPlan(
                                hrd.PlanID, detail.AdminUnitID)
                    }).ToList();

                    hrd.HRDDetails = hrdDetails;
                    _hrdService.AddHRDFromAssessment(hrd);
                    return(RedirectToAction("Index"));
                }
                catch (Exception exception)
                {
                    var log = new Logger();
                    log.LogAllErrorsMesseges(exception, _log);
                    ModelState.AddModelError("Errors", @"Unable to create hrd form the given need Assessment");
                    //ViewBag.Error = "HRD for this Season and Year already Exists";
                }
            }
            ViewBag.Year     = hrd.Year;
            ViewBag.RationID = new SelectList(_rationService.GetAllRation(), "RationID", "RefrenceNumber");
            ViewBag.SeasonID = new SelectList(_seasonService.GetAllSeason(), "SeasonID", "Name");
            return(View(hrd));
        }
コード例 #7
0
        //
        // GET: /Procurement/Transporter/Create

        public ActionResult Create()
        {
            //return RedirectToAction("Edit");
            ViewBag.Regions = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name");
            ViewBag.zones   = new SelectList(_adminUnitService.FindBy(z => z.AdminUnitTypeID == 3 && z.ParentID == 3), "AdminUnitID", "Name");
            ViewBag.woredas = new SelectList(_adminUnitService.FindBy(w => w.AdminUnitTypeID == 4 && w.ParentID == 19), "AdminUnitID", "Name");
            return(View());
        }
コード例 #8
0
 public void LoadLookups()
 {
     ViewBag.BidID         = new SelectList(_bidService.GetAllBid(), "BidID", "BidNumber");
     ViewBag.RegionID      = new SelectList(_adminUnitService.FindBy(t => t.AdminUnitTypeID == 2), "AdminUnitID", "Name");
     ViewBag.TransporterID = new SelectList(_transporterService.GetAllTransporter(), "TransporterID", "Name");
 }
コード例 #9
0
 public ActionResult Index(int id = 0)
 {
     ViewBag.AssessmentStatus = id;
     ViewData["zones"]        = _adminUnitService.FindBy(t => t.AdminUnitTypeID == 3);
     ViewData["woredas"]      = _adminUnitService.FindBy(t => t.AdminUnitTypeID == 4);
     ViewBag.userRegionID     = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).RegionID;
     //ModelState.AddModelError("Success", "Sample Error Message. Use in Your Controller: ModelState.AddModelError('Errors', 'Your Error Message.')");
     return(View());
 }