Beispiel #1
0
        public static void StartForm(string form)
        {
            switch (form)
            {
            case "MainMenu":
                MainMenu mainMenu = new MainMenu();
                mainMenu.Show();
                activeForm.Hide();
                activeForm = mainMenu;
                break;

            case "UsersManagement":
                UsersManagement usersManagement = new UsersManagement();
                usersManagement.Show();
                activeForm.Hide();
                activeForm = usersManagement;
                break;

            case "ProductsManagement":
                ProductsManagement productsManagement = new ProductsManagement();
                productsManagement.Show();
                activeForm.Hide();
                activeForm = productsManagement;
                break;

            default:
                Console.WriteLine("Cant find specified Form - " + form);
                break;
            }
        }
Beispiel #2
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);

            this.Owner.Enabled = true;

            UsersManagement usersManagement = this.Owner as UsersManagement;

            usersManagement.UpdateForm();
        }
Beispiel #3
0
        public UpdateUserInfoForm(Form ownerForm, string email, DateTime dob)
        {
            InitializeComponent();

            buttonSave.Click += new EventHandler(OnClick);

            this.Owner = ownerForm;

            userData = UsersManagement.GetUserData(Form1.sqlConnection, email);

            labelEmaillabel.Text  = email;
            dateTimePicker1.Value = dob;
        }
Beispiel #4
0
        private void ButtonClick(object sender, EventArgs e)
        {
            Button but = sender as Button;

            switch (but.Name)
            {
            case "buttonSim":
                UsersManagement usersManagement = Owner as UsersManagement;
                usersManagement.DeleteSelectedRows();
                this.Close();
                break;

            case "buttonNao":
                this.Close();
                break;

            default:
                break;
            }
        }