Esempio n. 1
0
        private void buttonaddnewadmin_Click(object sender, EventArgs e)
        {
            Data.admins.Add(new Models.Admins()
            {
                Name     = textBoxaddadminname.Text,
                Username = textBoxaddadminusername.Text,
                Password = textBoxaddadminpassword.Text,
                Date     = dateTimePicker1.Value.Date,
            });

            this.Close();

            MessageBox.Show("New Administrator Added");

            viewAdmins.RefreshData();
        }
Esempio n. 2
0
        private void buttonaddnewadmin_Click(object sender, EventArgs e)
        {
            Data.admins.Add(new Models.Admins()
            {
                Name     = textBoxaddadminname.Text,
                Username = textBoxaddadminusername.Text,
                Password = textBoxaddadminpassword.Text
            });

            var Admn = new Admin();

            Admn.Name     = textBoxaddadminname.Text;
            Admn.Username = textBoxaddadminusername.Text;
            Admn.Password = textBoxaddadminpassword.Text;

            zuber_Db.Admin.Add(Admn);
            zuber_Db.SaveChanges();

            this.Close();

            MessageBox.Show("New Administrator Added");

            viewAdmins.RefreshData();
        }