Example #1
0
        public JsonResult GetCategoryInfo(string name)//170608
        {
            //clsSubmitModel oSubmit = new clsSubmitModel();
            DataTable dt;

            dt = oSubmit.GetCategoryInfo(name, Session["CompCode"].ToString());
            var result = new List <KeyValuePair <string, string> >();

            foreach (DataRow dr in dt.Rows)
            {
                result.Add(new KeyValuePair <string, string>(dr["Code"].ToString(), dr["Name"].ToString()));
            }
            var result3 = result.Where(s => s.Value.ToLower().Contains(name.ToLower())).Select(w => w).ToList();

            return(Json(result3, JsonRequestBehavior.AllowGet));
        }