Пример #1
0
        public override List<Subdomain> GetSubdomains(string domainName)
        {
            var _tmp = new List<Subdomain>();

            using (OleDbConnection _conn = new OleDbConnection(Settings.Default.connectionString))
            {
                _conn.Open();
                using (OleDbCommand _cmd = new OleDbCommand(@"SELECT Domain_Name, Sub_Domain, Host_ID, Reseller_Username FROM SubDomain_List
                                                                WHERE (Domain_Name = ?)", _conn))
                {
                    _cmd.CommandType = CommandType.Text;
                    _cmd.Parameters.AddWithValue("NAME", domainName);

                    using (OleDbDataReader _read = _cmd.ExecuteReader())
                    {
                        while (_read.Read())
                        {
                            var _d = new Subdomain();
                            _d.Domain = _read["Domain_Name"].ToString();
                            _d.Login = _read["Domain_Name"].ToString();
                            _d.Password = "";
                            _d.Name = _read["Sub_Domain"].ToString();
                            _d.UserType = "";

                            _tmp.Add(_d);
                        }
                    }
                }

                _conn.Close();
            }

            return _tmp;
        }
Пример #2
0
        public override List<Subdomain> GetSubdomains(string domainName)
        {
            var _tmp = new List<Subdomain>();

            using (OleDbConnection _conn = new OleDbConnection(Settings.Default.connectionString))
            {
                _conn.Open();
                using (OleDbCommand _cmd = new OleDbCommand(@"SELECT subdomains.name, domains.name AS [domain], sys_users.login, accounts.[password], subdomains.sys_user_type
                                                                FROM (((accounts RIGHT OUTER JOIN
                                                                    sys_users ON accounts.id = sys_users.account_id) RIGHT OUTER JOIN
                                                                    subdomains ON sys_users.id = subdomains.sys_user_id) LEFT OUTER JOIN
                                                                    domains ON subdomains.dom_id = domains.id)
                                                                WHERE (domains.name = ?)", _conn))
                {
                    _cmd.CommandType = CommandType.Text;
                    _cmd.Parameters.AddWithValue("NAME", domainName);

                    using (OleDbDataReader _read = _cmd.ExecuteReader())
                    {
                        while (_read.Read())
                        {
                            var _d = new Subdomain();
                            _d.Domain = _read["domain"].ToString();
                            _d.Login = _read["login"].ToString();
                            _d.Password = _read["password"].ToString();
                            _d.Name = _read["name"].ToString();
                            _d.UserType = _read["sys_user_type"].ToString();

                            _tmp.Add(_d);
                        }
                    }
                }

                _conn.Close();
            }

            return _tmp;
        }
Пример #3
0
        public override List<Subdomain> GetSubdomains(string domainName)
        {
            var _tmp = new List<Subdomain>();

            using (SQLiteConnection _conn = new SQLiteConnection(Settings.Default.connectionString))
            {
                _conn.Open();
                using (SQLiteCommand _cmd = new SQLiteCommand(@"SELECT SD.Name as name, D.Name as domain, SD.Username as login, FU.Password as password
                                                                FROM SubDomain As SD
                                                                LEFT JOIN Domain As D ON D.DomainId = SD.DomainId
                                                                LEFT JOIN DomainMsFTP As Ftp ON Ftp.DomainId = D.DomainId
                                                                LEFT JOIN DomainMsFTPUser As FU ON FU.FtpId = Ftp.Id AND FU.Username = SD.Username
                                                                WHERE D.Name = $NAME", _conn))
                {
                    _cmd.Parameters.AddWithValue("$NAME", domainName);

                    using (SQLiteDataReader _read = _cmd.ExecuteReader())
                    {
                        while (_read.Read())
                        {
                            var _d = new Subdomain();
                            _d.Domain = _read["domain"].ToString();
                            _d.Login = _read["login"].ToString();
                            _d.Password = _read["password"].ToString();
                            _d.Name = _read["name"].ToString();
                            _d.UserType = "";

                            _tmp.Add(_d);
                        }
                    }
                }
                _conn.Close();
            }

            return _tmp;
        }