示例#1
0
        private void GetProgramLists()
        {
            DataTable dtProgramList = CRCDataAccess.ProgramCalendarSearch("*", "StartsWith");

            ProgramList = (new SelectListItem[] { new SelectListItem()
                                                  {
                                                      Text = "Select a Program Name", Value = ""
                                                  } }).Union((from DataRow row in dtProgramList.Rows
                                                              select new SelectListItem()
            {
                Text = row["ProgramName"].ToString(),
                Value = row["ProgramId"].ToString()
            }));
        }
示例#2
0
        public ActionResult ProgramCalendarSearch(string term, string searchType)
        {
            using (var dt = CRCDataAccess.ProgramCalendarSearch(term, searchType))
            {
                var searchResults =
                    from DataRow dr in dt.Rows
                    select new
                {
                    value = dr["ProgramId"],
                    label = dr["ProgramName"]
                };

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