AdminStatus

Namespace: AWSSDK.GuardDuty
We found 10 examples in language CSharp for this search. You will see 20 fragments of code.

Other methods


		private MapperConfiguration MapGridQueries()
		{
			return new MapperConfiguration(config => {
				config.CreateMap<SchoolAdmin, SchoolAdminRecord>()
				.ForMember(m => m.Name, m => m.MapFrom(mm => mm.User.FirstName + " " + mm.User.LastName))
				.ForMember(m => m.SchoolName, m => m.MapFrom(mm => mm.School.Name))
				.ForMember(m => m.Status, m => m.MapFrom(mm => mm.AdminStatus));
			});
		}


		private MapperConfiguration MapGridQueries()
		{
			return new MapperConfiguration(config => {
				config.CreateMap<TeamAdmin, TeamAdminRecord>()
				.ForMember(m => m.Name, m => m.MapFrom(mm => mm.User.FirstName + " " + mm.User.LastName))
				.ForMember(m => m.TeamName, m => m.MapFrom(mm => mm.Team.School.Name + " - " + mm.Team.Sport.Name))
				.ForMember(m => m.Status, m => m.MapFrom(mm => mm.AdminStatus)); 
			});
		}

using System;
using System.Xml;
using System.Xml.Linq;
using AuroraServer.CLASSES;
using AuroraServer.NETWORK;

namespace AuroraServer.XMPP
{
	internal class Bind
	{
		internal int DedicatedId;

		private readonly XNamespace NameSpace = "urn:ietf:params:xml:ns:xmpp-bind";

		internal Bind(Client User, XmlDocument Packet)
		{
			Client client = ArrayList.OnlineUsers.Find((Client Attribute) => Attribute.JID == $"{User.Player.TicketId}@warface/GameClient");
			if (client != null)
			{
				Console.ForegroundColor = ConsoleColor.Red;
				Console.WriteLine("[" + User.JID + "] -> Bind in use! Destroying current session!");
				Console.ResetColor();
				new StreamError(client, "conflict");
			}
			if (User.Dedicated)
			{
				User.JID = $"dedicated{DedicatedId}@warface/GameDedicated";
			}
			else
			{
				User.JID = $"{User.Player.Nickname.ToLower()}@row_emul.warface/GameClient";
			}
            string AdminStatus = "";
            //if (User.Player.Privilegie == PrivilegieId.ADMINISTRATOR)
            //    AdminStatus = "[ADMIN] ";
            //else if (User.Player.Privilegie == PrivilegieId.MODERATOR)
            //    AdminStatus = "[MODER] ";
            //else AdminStatus = "";
            User.Player.Nickname = AdminStatus + User.Player.Nickname;

            /*Console.ForegroundColor = ConsoleColor.Yellow;
			Console.WriteLine("[" + User.IPAddress + "] -> Binded XMPP JID [" + User.JID + "]");
			Console.ResetColor();*/
			XElement xElement = new XElement(Gateway.JabberNS + "iq");
			xElement.Add(new XAttribute("type", "result"));
			xElement.Add(new XAttribute("id", Packet["iq"].Attributes["id"].InnerText));
			xElement.Add(new XAttribute("to", User.JID));
			XElement xElement2 = new XElement(NameSpace + "bind");
			xElement2.Add(new XElement("jid", User.JID));
			xElement.Add(xElement2);
			User.Send(xElement.ToString(SaveOptions.DisableFormatting));
		}
	}
}


        public IEnumerable<ItemViewModel> Retrieve()
        {
            var records = (from items in db.Items
                           where items.AdminStatus == "Active"
                           select items).ToList();

            return records;
        }

        public void Archive(int id)
        {
            var record = db.Items
                .Where(x => x.ItemId == id && x.AdminStatus == "Active")
                .FirstOrDefault();

            if (record != null)
            {
                record.AdminStatus = "Archived";
                db.SaveChanges();
            }
        }

        public IEnumerable<ItemViewModel> RetrieveArchives()
        {
            var records = (from items in db.Items
                           where items.AdminStatus == "Archived"
                           select items).ToList();

            return records;
        }

        public void RevertArchive(int id)
        {
            var record = db.Items
                .Where(x => x.ItemId == id && x.AdminStatus == "Archived")
                .FirstOrDefault();

            if (record != null)
            {
                record.AdminStatus = "Active";
                db.SaveChanges();
            }
        }

using JumboServer.Packages;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace JumboServer.API
{
    public class Person : RequestObject
    {
        public string Name { get; set; }
        public string LastName { get; set; }
        public string ParentName { get; set; }
        public string Login { get; set; }
        public string Password { get; set; }
        public int Room { get; set; }
        public int Id { get; set; }
        public int AdminStatus { get; set; }
        public UserToken Token { get; set; }

        [JsonConstructor]
        public Person(string login, string password)
        {
            Login = login;
            Password = password;
        }
        public Person(string name, string lastName, string parentName, string login, string password, int room, int id, UserToken token, int adminStatus)
        {
            Name = name;
            LastName = lastName;
            ParentName = parentName;
            Login = login;
            Password = password;
            Room = room;
            Id = id;
            Token = token;
            AdminStatus = adminStatus;
        }
    }
}


		[Route("CountSchool"), HttpGet]
		public async Task<IHttpActionResult> CountSchool()
		{
			return Ok(await _repo.SchoolAdmins.Where(m => m.AdminStatus == AdminStatus.Approved).CountAsync());
		}

		[Route("CountTeam"), HttpGet]
		public async Task<IHttpActionResult> CountTeam()
		{
			return Ok(await _repo.TeamAdmins.Where(m => m.AdminStatus == AdminStatus.Approved).CountAsync());
		}

		[Route("PendingCount"), HttpGet]
		public async Task<IHttpActionResult> PendingCount()
		{
			var schoolCount = await _repo.SchoolAdmins.Where(m => m.AdminStatus == AdminStatus.Pending).CountAsync();
			var teamCount = await _repo.TeamAdmins.Where(m => m.AdminStatus == AdminStatus.Pending).CountAsync();
			return Ok(schoolCount + teamCount);
		}

        public List<Account> Db_Get_All_Accounts()
        {
            string query = "SELECT Gebruikersnaam, Hash, AdminStatus, Vraag, Antwoord FROM Account";
            SqlParameter[] sqlParameters = new SqlParameter[0];
            return ReadTables(ExecuteSelectQuery(query, sqlParameters));
        }

        private List<Account> ReadTables(DataTable dataTable)
        {
            List<Account> accounts = new List<Account>();

            foreach (DataRow dr in dataTable.Rows)
            {
                Account account = new Account()
                {
                    Gebruikersnaam = (String)dr["Gebruikersnaam"],
                    Wachtwoord = (String)dr["Hash"],
                    AdminStatus = (String)dr["AdminStatus"],
                    Vraag = (String)dr["Vraag"],
                    Antwoord = (String)dr["Antwoord"]
                };
                accounts.Add(account);
            }
            return accounts;
        }

        public void AddAccount(Account account)
        {

            String toevoegenQuery = $"INSERT INTO Account ( Gebruikersnaam, Hash, AdminStatus, Vraag, Antwoord, Salt ) VALUES ( '{account.Gebruikersnaam}', '{account.Wachtwoord}', '{account.AdminStatus}', '{account.Vraag}', '{account.Antwoord}', '{account.Salt}')";
            SqlParameter[] sqlParameters = new SqlParameter[0];
            OpenConnection();
            ExecuteEditQuery(toevoegenQuery, sqlParameters);
        }

        public string AdminStatus(string username)
        {
            string query = $"SELECT AdminStatus FROM Account WHERE Gebruikersnaam = '{username}'";
            SqlParameter[] sqlParameters = new SqlParameter[0];
            Account currentAccount = new Account();
            DataTable table = ExecuteSelectQuery(query, sqlParameters);
            foreach (DataRow dr in table.Rows)
            {
                currentAccount.AdminStatus = (String)dr["AdminStatus"];
            }
            return currentAccount.AdminStatus;
        }

        public void DeleteAccount(string gebruikersnaam)
        {
            String query = $"DELETE FROM Account WHERE Gebruikersnaam = '{gebruikersnaam}'";
            SqlParameter[] sqlParameters = new SqlParameter[0];
            OpenConnection();
            ExecuteEditQuery(query, sqlParameters);
        }

        public void AlterAccount(string gebruikersnaam, string toChange, string newValue)
        {
            String query = $"UPDATE Account SET {toChange} = '{newValue}' WHERE Gebruikersnaam = '{gebruikersnaam}'";
            SqlParameter[] sqlParameters = new SqlParameter[0];
            OpenConnection();
            ExecuteEditQuery(query, sqlParameters);
        }

		[Test]
		public void AdminStatusTest()
		{
			NetworkDeviceList devs = IPHelper.GetAllDevices();
			NetworkDevice myDev = null;
			foreach(NetworkDevice dev in devs)
			{
				Console.WriteLine(dev.ToStringDetailed());
				if(dev.Name.EndsWith("{2E39C390-6D40-412E-ADF4-8270E3782F74}"))
				{
					myDev=dev;
				}
			}
			
			if(myDev!=null)
			{
				Console.WriteLine("Bringing down '{0}'...", myDev.Description);
				myDev.AdminStatus = false;
				Assert.IsTrue(!myDev.AdminStatus, "Admin status should be: False");
				//System.Threading.Thread.Sleep(10000);
				Console.WriteLine("Bringing up '{0}'...", myDev.Description);
				myDev.AdminStatus = true;
				Assert.IsTrue(myDev.AdminStatus, "Admin status should be: True");
			}
		}

		[Test]
		public void AdminStatusTest()
		{
			NetworkDeviceList devs = IPHelper.GetAllDevices();
			NetworkDevice myDev = null;
			foreach(NetworkDevice dev in devs)
			{
				Console.WriteLine(dev.ToStringDetailed());
				if(dev.Name.EndsWith("{2E39C390-6D40-412E-ADF4-8270E3782F74}"))
				{
					myDev=dev;
				}
			}
			
			if(myDev!=null)
			{
				Console.WriteLine("Bringing down '{0}'...", myDev.Description);
				myDev.AdminStatus = false;
				Assert.IsTrue(!myDev.AdminStatus, "Admin status should be: False");
				//System.Threading.Thread.Sleep(10000);
				Console.WriteLine("Bringing up '{0}'...", myDev.Description);
				myDev.AdminStatus = true;
				Assert.IsTrue(myDev.AdminStatus, "Admin status should be: True");
			}
		}

		[Test]
		public void AdminStatusTest()
		{
			NetworkDeviceList devs = IPHelper.GetAllDevices();
			NetworkDevice myDev = null;
			foreach(NetworkDevice dev in devs)
			{
				Console.WriteLine(dev.ToStringDetailed());
				if(dev.Name.EndsWith("{2E39C390-6D40-412E-ADF4-8270E3782F74}"))
				{
					myDev=dev;
				}
			}
			
			if(myDev!=null)
			{
				Console.WriteLine("Bringing down '{0}'...", myDev.Description);
				myDev.AdminStatus = false;
				Assert.IsTrue(!myDev.AdminStatus, "Admin status should be: False");
				//System.Threading.Thread.Sleep(10000);
				Console.WriteLine("Bringing up '{0}'...", myDev.Description);
				myDev.AdminStatus = true;
				Assert.IsTrue(myDev.AdminStatus, "Admin status should be: True");
			}
		}

Amazon.GuardDuty.AdminStatus : ConstantClass

Fields :

public static AdminStatus DISABLE_IN_PROGRESS
public static AdminStatus ENABLED

Constructors :

public AdminStatus(String value = )

Methods :

public static AdminStatus FindValue(String value = )
public static AdminStatus op_Implicit(String value = )
public String get_Value()
public String ToString()
public String ToString(IFormatProvider provider = )
public Int32 GetHashCode()
public Boolean Equals(Object obj = )
public Boolean Equals(ConstantClass obj = )
public Type GetType()