コード例 #1
0
        public static List <Project> GetProjectsForAutocomplete(int organizationId, int areaId, string filter)
        {
            string userName = HttpContext.Current.User.Identity.Name;

            List <Project> theList = new List <Project>();
            Project        theData = null;

            try
            {
                ProjectsTableAdapter        localAdapter = new ProjectsTableAdapter();
                ProjectDS.ProjectsDataTable theTable     = localAdapter.GetProjectForAutocomplete(userName, organizationId, areaId, filter);
                if (theTable != null && theTable.Rows.Count > 0)
                {
                    foreach (ProjectDS.ProjectsRow theRow in theTable)
                    {
                        theData = FillRecord(theRow);
                        theList.Add(theData);
                    }
                }
            }
            catch (Exception exc)
            {
                log.Error(Resources.Project.MessageErrorLoadProject + " for autocomplete.", exc);
                throw new Exception(Resources.Project.MessageErrorLoadProject);
            }
            return(theList);
        }