Ejemplo n.º 1
0
        public void GetInitialDropDownComplexModel(MyProfileObject model)
        {
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            MasterlistEngine masterEngine = new MasterlistEngine();
            string response = masterEngine.GetCategoryListJSON();
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            List<Common.DTO.Category> categories = new List<Common.DTO.Category>();
            categories = (List<Common.DTO.Category>)Serializer.JSONStringToObject<List<Common.DTO.Category>>(responseObject.ResultObjectJSON);

            model.Categories = categories;
            ViewBag.CategoryId = new SelectList(categories, "ID", "Name"); ;
            response = string.Empty;
            response = masterEngine.GetCountryListJSON();
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            List<Common.DTO.Country> countries = new List<Common.DTO.Country>();
            countries = (List<Common.DTO.Country>)Serializer.JSONStringToObject<List<Common.DTO.Country>>(responseObject.ResultObjectJSON);

            model.Countries = countries;
        }