/// <summary>
        /// Gets the global code categories.
        /// </summary>
        /// <returns></returns>
        public ActionResult GetGlobalCodeCategories()
        {
            var gccBal = new GlobalCodeCategoryBal();
            var globalCodeCategories = gccBal.GetGlobalCodeCategories();

            return(Json(globalCodeCategories));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Binds the global code categories.
        /// </summary>
        /// <returns></returns>
        public ActionResult BindGlobalCodeCategories()
        {
            var list = new List <DropdownListData>();

            using (var bal = new GlobalCodeCategoryBal())
            {
                var result = bal.GetGlobalCodeCategories();
                if (result.Count > 0)
                {
                    list.AddRange(result.Select(item => new DropdownListData
                    {
                        Text           = item.GlobalCodeCategoryName,
                        Value          = item.GlobalCodeCategoryValue,
                        ExternalValue1 = Convert.ToString(item.GlobalCodeCategoryID)
                    }));
                }
            }
            return(Json(list, JsonRequestBehavior.AllowGet));
        }