Пример #1
0
        /// <summary>
        /// Get employee name match to cond for auto complete textbox.
        /// </summary>
        /// <param name="cond"></param>
        /// <returns></returns>
        public ActionResult MAS070_GetEmployeeName(string cond)
        {
            ObjectResultData res         = new ObjectResultData();
            List <string>    listEmpName = new List <string>();

            try
            {
                IAutoCompleteHandler  handler = ServiceContainer.GetService <IAutoCompleteHandler>() as IAutoCompleteHandler;
                List <dtEmployeeName> lst     = handler.GetEmployeeName(cond);

                foreach (var item in lst)
                {
                    listEmpName.Add(item.EmpName);
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            res.ResultData = listEmpName.ToArray();
            return(Json(res));
        }