Ejemplo n.º 1
0
 public JsonResult GetAll()
 {
     try
     {
         var items = CauseManager.GetAll();
         //return Json(items.Select(m => m.sDescription), JsonRequestBehavior.AllowGet);
         return(Json(new { Result = "OK", Options = items.Select(m => new { DisplayText = m.sDescription, Value = m.kCauseId }) }));
     }
     catch (Exception ex)
     {
         return(Json(new { Result = "ERROR", Message = ex.Message }));
     }
 }
Ejemplo n.º 2
0
        //For Create Cause on Claim Module
        public JsonResult Search3(string term)
        {
            try
            {
                term = term.Trim();
                var items = CauseManager.GetAll();

                if (!string.IsNullOrEmpty(term))
                {
                    items = CauseManager.GetBySearch(term);
                }
                return(Json(items.Select(m => new { label = String.Format("[{0}] {1}", m.sCode, m.sDescription), description = m.sDescription, price = m.dPrice })
                            , JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }
Ejemplo n.º 3
0
        public JsonResult Search(string q)
        {
            try
            {
                q = q.Trim();
                var items = CauseManager.GetAll();

                if (!string.IsNullOrEmpty(q))
                {
                    items = CauseManager.GetBySearch(q);
                }
                return(Json(items.Select(m => new { name = String.Format("[{0}] {1} ราคา {2} บาท", m.sCode, m.sDescription, m.dPrice), id = m.sDescription, Readonly = "true" })
                            , JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }