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 HubAllocationDetail(Cats.Models.HubAllocation hubAllocation) { var seleList = new SelectList(_hubService.GetAllHub(), "HubId", "Name"); ViewBag.HubId = seleList; IEnumerable <Cats.Models.HubAllocation> detail = _projectCodeAllocationService.Get( t => t.HubID == hubAllocation.HubID); return(View(detail)); }
// GET: /Store/ public ActionResult Index() { var store = _storeService.GetAllStore(); ViewBag.HubID = _hubService.GetAllHub(); return(View(store)); }
public ActionResult hubAllocation(ICollection <RequisitionViewModel> requisitionDetail, FormCollection form) { ViewBag.Hubs = new SelectList(_hubService.GetAllHub(), "HubID", "Name"); ViewBag.Months = new SelectList(RequestHelper.GetMonthList(), "Id", "Name"); ICollection <RequisitionViewModel> listOfRequsitions = new List <RequisitionViewModel>(); RequisitionViewModel[] _requisitionDetail; if (requisitionDetail == null) { ModelState.AddModelError("Error", @"No approved requisitions or no requisition is selected."); TempData["ModelState"] = ModelState; return(RedirectToAction("ApprovedRequisitions")); } _requisitionDetail = requisitionDetail.ToArray(); var chkValue = form["IsChecked"]; // for this code the chkValue will return all value of each checkbox that is checked if (chkValue != null) { string[] arrChkValue = form["IsChecked"].Split(','); foreach (var value in arrChkValue) { listOfRequsitions.Add(_requisitionDetail[int.Parse(value)]); } } return(View(listOfRequsitions.ToList())); }
private ReceiptAllocationViewModel BindReceiptAllocaitonViewModel() { var user = _userProfileService.GetUser(User.Identity.Name); var commodities = _commodityService.GetAllCommodity().DefaultIfEmpty().OrderBy(o => o.Name).ToList(); var donors = _donorService.GetAllDonor().DefaultIfEmpty().OrderBy(o => o.Name).ToList(); var hubs = new List <Hub>(); if (user != null) { //Hubs = new List<Hub>() { user.DefaultHub }; hubs = _hubService.GetAllWithoutId(user.DefaultHub.HubID).DefaultIfEmpty().OrderBy(o => o.Name) .ToList(); } else { hubs = _hubService.GetAllHub().DefaultIfEmpty().OrderBy(o => o.Name).ToList(); } var programs = _programService.GetAllProgram().DefaultIfEmpty().OrderBy(o => o.Name).ToList(); var commoditySources = _commoditySourceService.GetAllCommoditySource().DefaultIfEmpty().OrderBy(o => o.Name).ToList(); var commodityTypes = _commodityTypeService.GetAllCommodityType().DefaultIfEmpty().OrderBy(o => o.Name).ToList(); var viewModel = new ReceiptAllocationViewModel(commodities, donors, hubs, programs, commoditySources, commodityTypes, user); viewModel.HubID = user.DefaultHub.HubID; return(viewModel); }
public JsonResult Hub_Read([DataSourceRequest] DataSourceRequest request) { var hubs = _hubService.GetAllHub(); var hubsViewModel = HubViewModelBinder.BindListHubViewModel(hubs); return(Json(hubsViewModel.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }
public void init() { var caseteams = new List <CaseTeam> { new CaseTeam() { ID = 1, CaseTeamName = "EarlyWarning" }, new CaseTeam() { ID = 2, CaseTeamName = "PSNP/FSCD" }, new CaseTeam() { ID = 3, CaseTeamName = "Logistics" }, new CaseTeam() { ID = 4, CaseTeamName = "Procurement" }, new CaseTeam() { ID = 5, CaseTeamName = "Finance" } }; var userTypes = new SelectList(new[] { new SelectListItem { Text = "Regional", Value = "1" }, new SelectListItem { Text = "Hub", Value = "2" }, new SelectListItem { Text = "Case team", Value = "3" }, new SelectListItem { Text = "Administrator", Value = "4" } }, "Text", "Value"); ViewBag.userTypes = userTypes; ViewBag.CaseTeams = caseteams; ViewBag.hubs = _hubService.GetAllHub().ToList(); ViewBag.regions = _adminUnitService.GetRegions(); ViewBag.Programs = _programService.GetAllProgram().Take(2); }
public void loadListItems() { // commodityService.FindById(1).CommodityID; ViewBag.DonorId = new SelectList(donorService.GetAllDonor(), "DonorID", "Name"); ViewBag.HubId = new SelectList(hubService.GetAllHub(), "HubID", "Name"); ViewBag.CommodityId = new SelectList(commodityService.GetAllCommodity(), "CommodityID", "Name"); }
public ActionResult Index(int regionId = 0, int RequisitionID = 0) { ViewBag.regionId = regionId; ViewBag.RequisitionID = RequisitionID; ViewBag.Hubs = _hubService.GetAllHub(); ViewBag.AllocatedHub = _hubAllocationService.GetAllocatedHubId(RequisitionID); //ViewBag.Allocations = _hubAllocationService.GetAllHubAllocation().Select(m => m.HubID); return(View()); }
public JsonResult GetHubs() { var hubs = _hubService.GetAllHub().Select(h => new { Name = h.Name, HubID = h.HubID }); return(Json(hubs, JsonRequestBehavior.AllowGet)); }
// // GET: /Procurement/TransportBidPlan/Details/5 public ActionResult WarehouseSelection(int id = 0) { TransportBidPlan transportbidplan = fetchFromDB(id); ViewBag.WarehouseID = _hubService.GetAllHub(); @ViewBag.bidPlan = transportbidplan; ViewBag.RegionCollection = _adminUnitService.FindBy(t => t.AdminUnitTypeID == 2); List <WarehouseProgramViewModel> table = GetWoredaWarehouseProgram(id, 0); return(View(table)); }
private IEnumerable <UserHubModel> GetUserHubs(string userName) { var warehouses = from v in _userHubService.GetAllUserHub() where v.UserProfile.UserName == userName select v.HubID; var userHubs = from v in _hubService.GetAllHub() select new UserHubModel { HubID = v.HubID, Name = v.Name + " : " + v.HubOwner.Name, Selected = warehouses.Contains(v.HubID) }; return(userHubs.ToList()); }
private void PrepareCreate(int type) { var years = (from y in _periodService.GetYears() select new { Name = y, Id = y }).ToList(); ViewBag.Year = new SelectList(years, "Id", "Name"); ViewBag.Month = new SelectList(Enumerable.Empty <SelectListItem>(), "Id", "Name"); ViewBag.TransporterID = new SelectList(_transporterService.GetAllTransporter(), "TransporterID", "Name"); var user = _userProfileService.GetUser(User.Identity.Name); ViewBag.CommodityTypeID = new SelectList(_commodityTypeService.GetAllCommodityType(), "CommodityTypeID", "Name"); ViewBag.StoreID = new SelectList(_storeService.GetStoreByHub(user.DefaultHub.HubID), "StoreID", "Name"); ViewBag.ProgramID = new SelectList(_programService.GetAllProgram(), "ProgramID", "Name"); ViewData["Commodities"] = _commodityService.GetAllParents().Select(c => new CommodityModel { Id = c.CommodityID, Name = c.Name }).ToList(); ViewBag.Units = _unitService.GetAllUnit(); if (type == 1) { PrepareFDPCreate(); } else if (type == 2) { var hub = _hubService.GetAllHub(); hub.Remove(user.DefaultHub); ViewBag.ToHUBs = new SelectList(hub.Select(p => new { Name = string.Format("{0} - {1}", p.Name, p.HubOwner.Name), p.HubID }), "HubID", "Name"); } var comms = new List <DispatchDetailModel>(); ViewBag.SelectedCommodities = comms; ViewBag.StackNumber = new SelectList(Enumerable.Empty <SelectListItem>()); }
public virtual ActionResult Index() { return(View(_hubService.GetAllHub().OrderBy(o => o.HubOwner.Name).ThenBy(o => o.Name))); }
public ActionResult ReadAllJson([DataSourceRequest] DataSourceRequest request) { var list = toViewModel(_hubService.GetAllHub()); return(Json(list.ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }
// // GET: /UserWarehouse/Create public ActionResult Create() { ViewBag.UserProfileID = new SelectList(_userProfileService.GetAllUserProfile(), "UserProfileID", "UserName"); ViewBag.WarehouseID = new SelectList(_hubService.GetAllHub(), "HubID", "Name"); return(View()); }
// // GET: /UserWarehouse/ public ViewResult Index() { ViewData["UserProfile"] = _userProfileService.GetAllUserProfile(); ViewData["Hub"] = _hubService.GetAllHub(); return(View()); }