Ejemplo n.º 1
0
        public static string GenrateMenuForMappingShow(int UserId)
        {
            using (OneFineRateEntities _context = new OneFineRateEntities())
            {
                var result = _context.uspGetPropertiesAndChainByUserForShow(UserId);

                var lstResult = result.ToList();

                string ReturnString = "";

                foreach (var item in lstResult)
                {
                    ReturnString += "{ \"id\" : " + item.iPropId + ", \"name\": \"" + item.PropName.Trim() + "\", \"parent\": \"" + item.chainName.Trim() + "\", \"checked\": \"" + item.Mapped + "\"},";
                }
                try
                {
                    ReturnString = "[" + ReturnString.Substring(0, ReturnString.Length - 1) + "]";
                }
                catch (Exception)
                {
                    ReturnString = "[]";
                }
                return(ReturnString);
            }
        }