示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        // 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));
        }