Example #1
0
        public JsonResult Search2(string term)
        {
            try
            {
                var items = InsuranceManager.GetBySearch(term.Trim());

                return(Json(items.Select(m => new
                {
                    label = m.sInsuranceName
                    ,
                    m.kInsuranceId
                    ,
                    m.sInsuranceName
                    ,
                    m.sAddress1
                    ,
                    m.sCity
                    ,
                    m.sZip
                    ,
                    m.sPhone
                    ,
                    m.sMobile
                    ,
                    m.sFax
                    ,
                    m.sEmailAddress
                })
                            , JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }
Example #2
0
        public JsonResult Search(string term)
        {
            try
            {
                var items = InsuranceManager.GetBySearch(term);

                return(Json(items.Select(m => m.sInsuranceName), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }