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()); }
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)); }
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 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)); }
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)); }
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)); }
// // 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()); }
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"); }
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()); }