예제 #1
0
        public JsonResult GetCountryLists()
        {
            //var sa = new JsonSerializerSettings();
            var list = _IBOCountry.GetCountryLists();
            List <CountryVM> objList = new List <CountryVM>();

            foreach (var item in list)
            {
                var cvm = new CountryVM()
                {
                    countryId   = item.countryId,
                    countryName = item.countryName
                };
                objList.Add(cvm);
            }
            var obj = objList;

            return(Json(obj, new JsonSerializerSettings()));
        }
예제 #2
0
        public JsonResult GetMasterbyId(int id)
        {
            var countryList  = _IBOCountry.GetCountryLists();
            var provinceList = _IBOCountry.GetProvinceLists();
            var rcrd         = _IBOUsers.GetMasterById(id);

            var uvm = new NewUserVM()
            {
                userId      = rcrd.userId,
                userName    = rcrd.userName,
                userEmail   = rcrd.userEmail,
                userPwd     = rcrd.userPwd,
                userPhone   = rcrd.userPhone,
                userCountry = rcrd.countryId,
                countryName = (from name in countryList
                               where name.countryId == rcrd.countryId
                               select name.countryName
                               ).FirstOrDefault(),
                uskillIds = rcrd.skillIds,
            };

            return(Json(uvm, new JsonSerializerSettings()));
        }