Ejemplo n.º 1
0
        private void InitElements(UserModel model)
        {
            int lastTabulation = 7;

            ContentPanel.CreateComboBoxWithLabel(PositionComboBox, PositionHeader, lastTabulation--, "Выберите должность");
            ContentPanel.CreateTextBoxWithLabel(ContactNumberMaskBox, ContactNumberHeader, lastTabulation--, FormBrushes.ContactNumberMask);
            ContentPanel.CreateTextBoxWithLabel(LastNameTextBox, LastNameHeader, lastTabulation--);
            ContentPanel.CreateTextBoxWithLabel(SecondNameTextBox, SecondNameHeader, lastTabulation--);
            ContentPanel.CreateTextBoxWithLabel(FirstNameTextBox, FirstNameHeader, lastTabulation--);

            //login password for new
            if (model.IsNull())
            {
                ContentPanel.CreateTextBoxWithLabel(PasswordTextBox, PasswordHeader, lastTabulation--, passwordCharEnabled: true);
                ContentPanel.CreateTextBoxWithLabel(LoginTextBox, LoginHeader, lastTabulation--);
            }
            //and for old
            else if (!model.Login.Equals("admin"))
            {
                ContentPanel.CreateButtonWithLabel(ChangePasswordButton,
                                                   ChangePasswordButtonText,
                                                   lastTabulation--,
                                                   ChangeLoginPasswordClick);
            }
        }