private void editProfile_Click_1(object sender, EventArgs e)
        {
            //EditProfilePage editProfile = new EditProfilePage();
            //editProfile.ShowDialog();
            //this.Refresh();
            EditProfilePage editProfile = new EditProfilePage(Global.user.Details, this);     //create new isntance of form

            editProfile.FormClosed += new FormClosedEventHandler(EditProfilePage_FormClosed); //add handler to catch when child form is closed
            editProfile.Show();                                                               //show child
        }
Exemple #2
0
        private void edit_Click(object sender, EventArgs e)
        {
            var id = int.Parse(listView1.SelectedItems[0].SubItems[0].Text);

            using (var db = new SunwayCafeContext())
            {
                var acc = db.Accounts.Where(x => x.Id == id).FirstOrDefault();
                if (acc != null)
                {
                    EditProfilePage editProfile = new EditProfilePage(acc, this);
                    editProfile.Show();
                }
                else
                {
                    MessageBox.Show("Unable to find account in database. Please contact administrator.");
                }
            }
        }
Exemple #3
0
        private void addStaff_Click_1(object sender, EventArgs e)
        {
            EditProfilePage editProfile = new EditProfilePage(null, this);

            editProfile.Show();
        }