コード例 #1
0
        ///<summary>Inserts, updates, or deletes database rows to match supplied list.  Must always pass in ConnectionGroupNum.</summary>
        public static void Sync(List <ConnGroupAttach> listNew, long connectionGroupNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), listNew, connectionGroupNum);              //never pass DB list through the web service
                return;
            }
            List <ConnGroupAttach> listDB = ConnGroupAttaches.GetForGroup(connectionGroupNum);

            Crud.ConnGroupAttachCrud.Sync(listNew, listDB);
        }
コード例 #2
0
        ///<summary>Filters _listConns to only include connections that are associated to the selected connection group.</summary>
        public static List <CentralConnection> FilterConnections(List <CentralConnection> listConns, string filterText, ConnectionGroup connGroup)
        {
            //No need to check RemotingRole; no call to db.
            //Get all ConnGroupAttaches for selected group.
            List <CentralConnection> retVal = listConns;

            if (connGroup != null)
            {
                //Find all central connections that are in the group list
                List <ConnGroupAttach> listCentralConnGroupAttaches = ConnGroupAttaches.GetForGroup(connGroup.ConnectionGroupNum);
                retVal = retVal.FindAll(x => listCentralConnGroupAttaches.Exists(y => y.CentralConnectionNum == x.CentralConnectionNum));
            }
            //Find all central connections that meet the filterText criteria
            retVal = retVal.FindAll(x => x.DatabaseName.ToLower().Contains(filterText.ToLower()) ||
                                    x.ServerName.ToLower().Contains(filterText.ToLower()) ||
                                    x.ServiceURI.ToLower().Contains(filterText.ToLower()));
            return(retVal);
        }