Esempio n. 1
0
        public ActionResult _LocationSelection()
        {
            PopulateSecurityExtended();
            var list     = new List <SelectListItem>();
            var response = _sharedFunctions.PopulateSecurityLocations(SecurityExtended.UserName);

            if (response != null && response.Any())
            {
                foreach (var item in response)
                {
                    if (item.LocationID == SecurityExtended.LocationId)
                    {
                        list.Add(new SelectListItem {
                            Text = item.LocationDS, Value = item.LocationID.ToString(), Selected = true
                        });
                    }
                    else
                    {
                        list.Add(new SelectListItem {
                            Text = item.LocationDS, Value = item.LocationID.ToString()
                        });
                    }
                }
                ViewBag.SecurityLocations = list;
            }
            return(PartialView("_LocationSelection"));
        }