public override Boolean Equals(object obj)
        {
            if ((obj == null) || (obj.GetType() != this.GetType()))
            {
                return(false);
            }
            ShowData castObj = (ShowData)obj;

            return((castObj != null) &&
                   (this.DataKey == castObj.DataKey));
        }
Beispiel #2
0
        public static IList<ShowData> GetCustomersList()
        {
            //Variables Auxiliares
            IList<ShowData> CustomerList = new List<ShowData>();
            ShowData Customer;
            IList<Location> ListadoClientes;
            DaoFactory factory = new DaoFactory();

            //Obtenemos el listado de clientes habilitados, Status = 1001
            ListadoClientes = factory.DaoLocation().Select(new Location { Status = new Status { StatusID = 1001 } });

            //Recorro el listado de clientes y creo el listado
            foreach (Location Cliente in ListadoClientes)
            {
                //Inicializo la variable del cliente
                Customer = new ShowData();

                //Asigno los datos
                Customer.DataKey = Cliente.Name;
                Customer.DataValue = Cliente.LocationID.ToString();

                //Adicionamos el cliente al listado
                CustomerList.Add(Customer);
            }

            return CustomerList;
        }
Beispiel #3
0
        public static IList<ShowData> GetDomainList()
        {
            IList<ShowData> domainList = new List<ShowData>();

            ShowData curDomain;

            //Use LDAP Authentication - read Option
            DaoFactory factory = new DaoFactory();
            try
            {
                string ldapConfig = factory.DaoConfigOption().Select(new ConfigOption { Code = "USELDAP" }).FirstOrDefault().DefValue;
                
                //Muestra dominios si la opcion es True
                if (ldapConfig == "T")
                {

                    DirectoryEntry en = new DirectoryEntry("LDAP://");
                    // Search for objectCategory type "Domain"
                    DirectorySearcher srch = new DirectorySearcher("objectCategory=Domain");
                    SearchResultCollection coll = srch.FindAll();
                    // Enumerate over each returned domain.
                    foreach (SearchResult rs in coll)
                    {
                        curDomain = new ShowData();
                        ResultPropertyCollection resultPropColl = rs.Properties;
                        foreach (object domainKey in resultPropColl["name"])
                        {
                            curDomain.DataKey = domainKey.ToString().ToUpper();

                            foreach (object domainPath in resultPropColl["adspath"])
                                curDomain.DataValue = domainPath.ToString();
                        }

                        domainList.Add(curDomain);
                    }
                }
            }
            catch { }

            //Adding Default Domain
            domainList.Add(new ShowData { DataKey = "WMSEXPRESS", DataValue = "" });

            return domainList;

        }