Exemplo n.º 1
0
        public FormUserDetails(string userID)
        {
            InitializeComponent();
            this.adminID = null;
            details      = connect.findUserByID(userID);
            items        = details.Split(';');

            userID       = items[0];
            firstName    = items[1];
            lastName     = items[2];
            age          = items[3];
            email        = items[4];
            userRole     = items[5];
            active       = items[6];
            street       = items[7];
            streetNumber = items[8];
            postalCode   = items[9];
            city         = items[10];
            country      = items[11];
            telephone    = items[12];

            ID.Text           = userID;
            FirstName.Text    = firstName;
            LastName.Text     = lastName;
            Age.Text          = age;
            Email.Text        = email;
            UserRole.Text     = userRole;
            Active.Text       = active;
            Street.Text       = street;
            StreetNumber.Text = streetNumber;
            PostalCode.Text   = postalCode;
            City.Text         = city;
            Country.Text      = country;
            Telephone.Text    = telephone;

            if (userRole.Equals("user"))
            {
                ID.Enabled       = false;
                Age.Enabled      = false;
                UserRole.Enabled = false;
                Active.Enabled   = false;
            }
        }