public async Task <ActionResult> Edit(Guid RegionId)
        {
            var Region = await _Region.GetRegionById(RegionId);

            var selectedItems = new List <int>();

            if (Region.StateXml != null)
            {
                var states = Deserialize <List <StateModel> >(Region.StateXml);

                foreach (var item in states)
                {
                    selectedItems.Add(Convert.ToInt32(item.St_ID));
                }
            }
            Region.StateList      = new SelectList(_Dropdown.BindState(), "Value", "Text");
            Region.SelectedStates = selectedItems;
            if (CurrentUser.UserTypeName.ToLower() == "super admin")
            {
                Region.IsAdmin     = true;
                Region.CompanyList = new SelectList(await CommonModel.GetCompanies(), "Name", "Text");
            }
            return(View(Region));
        }
Ejemplo n.º 2
0
 public static EasyOne.Model.Accessories.RegionInfo GetRegionById(int regionId)
 {
     return(dal.GetRegionById(regionId));
 }