Esempio n. 1
0
        public ConnectionGroup Copy()
        {
            ConnectionGroup connGroup = new ConnectionGroup();

            connGroup.ConnectionGroupNum = this.ConnectionGroupNum;
            connGroup.Description        = this.Description;
            return(connGroup);
        }
 ///<summary></summary>
 public static void Update(ConnectionGroup connectionGroup)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), connectionGroup);
         return;
     }
     Crud.ConnectionGroupCrud.Update(connectionGroup);
 }
 ///<summary></summary>
 public static long Insert(ConnectionGroup connectionGroup)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         connectionGroup.ConnectionGroupNum = Meth.GetLong(MethodBase.GetCurrentMethod(), connectionGroup);
         return(connectionGroup.ConnectionGroupNum);
     }
     return(Crud.ConnectionGroupCrud.Insert(connectionGroup));
 }
Esempio n. 4
0
		///<summary>Filters _listConns to only include connections that are associated to the selected connection group.</summary>
		public static List<CentralConnection> FilterConnsByGroup(List<CentralConnection> listConns,ConnectionGroup connGroup) {
			List<CentralConnection> retVal=new List<CentralConnection>();
			//Get all ConnGroupAttaches for selected group.
			List<ConnGroupAttach> listCentralConnGroupAttaches=ConnGroupAttaches.GetForGroup(connGroup.ConnectionGroupNum);
			for(int i=0;i<listConns.Count;i++) {//Go through connections and return a subset of only those in listConnAttaches (only those in the selected group).
				for(int j=0;j<listCentralConnGroupAttaches.Count;j++) {
					if(listConns[i].CentralConnectionNum==listCentralConnGroupAttaches[j].CentralConnectionNum) {//Connection entry found for selected group, display connection.
						retVal.Add(listConns[i]);
						break;
					}
				}
			}
			return retVal;
		}
Esempio n. 5
0
		private void butAdd_Click(object sender,EventArgs e) {
			ConnectionGroup connGroup=new ConnectionGroup();
			connGroup.Description="";
			connGroup.ConnectionGroupNum=ConnectionGroups.Insert(connGroup);
			FormCentralConnectionGroupEdit FormCCGE=new FormCentralConnectionGroupEdit();
			FormCCGE.ConnectionGroupCur=connGroup;
			FormCCGE.IsNew=true;
			FormCCGE.ShowDialog();
			if(FormCCGE.DialogResult==DialogResult.OK) {
				if(FormCCGE.ConnectionGroupCur==null) {
					ConnectionGroups.Delete(connGroup.ConnectionGroupNum);
				}
				else {
					_listCentralConnGroups.Add(connGroup);
				}
			}
			FillGrid();
		}
Esempio n. 6
0
		public ConnectionGroup Copy() {
			ConnectionGroup connGroup=new ConnectionGroup();
			connGroup.ConnectionGroupNum=this.ConnectionGroupNum;
			connGroup.Description=this.Description;
			return connGroup;
		}
Esempio n. 7
0
		///<summary></summary>
		public static void Update(ConnectionGroup connectionGroup){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
				Meth.GetVoid(MethodBase.GetCurrentMethod(),connectionGroup);
				return;
			}
			Crud.ConnectionGroupCrud.Update(connectionGroup);
		}
Esempio n. 8
0
		///<summary></summary>
		public static long Insert(ConnectionGroup connectionGroup){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb){
				connectionGroup.ConnectionGroupNum=Meth.GetLong(MethodBase.GetCurrentMethod(),connectionGroup);
				return connectionGroup.ConnectionGroupNum;
			}
			return Crud.ConnectionGroupCrud.Insert(connectionGroup);
		}
Esempio n. 9
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);
        }
Esempio n. 10
0
		private void butDelete_Click(object sender,EventArgs e) {
			if(IsNew) {//Do nothing
				DialogResult=DialogResult.Cancel;
			}
			//Deletion is permanent.  Remove all groupattaches for this group then Set ConnectionGroupCur to null so parent form knows to remove it.
			if(MessageBox.Show(this,Lans.g(this,"Delete this entire connection group?"),"",MessageBoxButtons.YesNo)==DialogResult.No) {
				return;
			}
			for(int i=0;i<_listConnGroupAttaches.Count;i++) {
				ConnGroupAttaches.Delete(_listConnGroupAttaches[i].ConnGroupAttachNum);
			}
			ConnectionGroupCur=null;
			DialogResult=DialogResult.OK;
		}