Esempio n. 1
0
 private void editprofilebtn_Click(object sender, EventArgs e)
 {
     ServiceAdmin.Admin admin = new ServiceAdmin.Admin();
     admin.Id       = UserInfo.id;
     admin.UserName = adminname.Text;
     admin.Email    = adminemail.Text;
     if (adminpassword.Text == confirmpassword.Text)
     {
         admin.Password = adminpassword.Text;
         ServiceAdmin.Admindata data = new ServiceAdmin.Admindata();
         data = a.updateAdmin(admin);
         if (data != null)
         {
             MessageBox.Show("Updated", "updated", MessageBoxButtons.OK, MessageBoxIcon.Information);
             confirmpassword.Text = "";
         }
         else
         {
             MessageBox.Show("Error", "Info !", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Confirm Password and Password not same", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 2
0
 public Profile()
 {
     InitializeComponent();
     ServiceAdmin.Admindata data = new ServiceAdmin.Admindata();
     data = a.getSingle(UserInfo.id);
     if (data != null)
     {
         adminname.Text     = data.UserName;
         adminemail.Text    = data.Email;
         adminpassword.Text = data.Password;
     }
 }