public PartialViewResult SearchAssetLocation(string keyword) { var vm = new AssetLocationCreateVM(); var searchlist = db.AssetLocations.Where(x => x.Name.Contains(keyword)).ToList(); vm.AssetLocations = searchlist; return(PartialView("SearchAssetLocation", vm)); }
public ViewResult Create(AssetLocationCreateVM assetLocationVm) { var assetLocation = new AssetLocationCreateVM(); assetLocation = assetLocationVm; bool isSaved = assetLocationManager.Save(assetLocation.AssetLocation); if (isSaved) { ViewBag.Message = "Saved Successfully!"; } assetLocation.Organizations = organizationsSelectListItems; return(View(assetLocation)); }
// GET: AssetLocation public ActionResult Create() { AssetLocationCreateVM modeVm = new AssetLocationCreateVM(); var organizations = assetLocationManager.GetAllGeneralOrganizations(); foreach (var organization in organizations) { SelectListItem item = new SelectListItem() { Value = organization.id.ToString(), Text = organization.Name }; organizationsSelectListItems.Add(item); } modeVm.Organizations = organizationsSelectListItems; return(View(modeVm)); }