private void btnChngPass_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtOldPass.Text.Trim() == global.password)
         {
             App_Data.POSDataSetTableAdapters.UsersTableAdapter myUserAd = new App_Data.POSDataSetTableAdapters.UsersTableAdapter();
             myUserAd.UpdatePasswordQuery(txtNewPass.Text, global.user_id);
             MessageBox.Show("Password Updated Successfully");
             this.Close();
         }
         else
         {
             MessageBox.Show("Invalid Old Password!\nTry again.");
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Example #2
0
 private void btnChngPass_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtOldPass.Text.Trim() == global.password)
         {
             App_Data.POSDataSetTableAdapters.UsersTableAdapter myUserAd = new App_Data.POSDataSetTableAdapters.UsersTableAdapter();
             myUserAd.UpdatePasswordQuery(txtNewPass.Text, global.user_id);
             MessageBox.Show("Password Updated Successfully");
             this.Close();
         }
         else
         {
             MessageBox.Show("Invalid Old Password!\nTry again.");
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Example #3
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtUserName.Text == "" || txtPassword.Text == "")
         {
             MessageBox.Show("Please Insert Password and User Name");
             return;
         }
         byte type = 1;
         if (cmbType.SelectedItem.ToString() == "Moderator")
             type = 2;
         App_Data.POSDataSetTableAdapters.UsersTableAdapter myUserAd = new App_Data.POSDataSetTableAdapters.UsersTableAdapter();
         myUserAd.InsertUserQuery(txtUserName.Text.Trim(), txtPassword.Text, type);
         MessageBox.Show("New User Added");
         this.Close();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtUserName.Text == "" || txtPassword.Text == "")
         {
             MessageBox.Show("Please Insert Password and User Name");
             return;
         }
         byte type = 1;
         if (cmbType.SelectedItem.ToString() == "Moderator")
         {
             type = 2;
         }
         App_Data.POSDataSetTableAdapters.UsersTableAdapter myUserAd = new App_Data.POSDataSetTableAdapters.UsersTableAdapter();
         myUserAd.InsertUserQuery(txtUserName.Text.Trim(), txtPassword.Text, type);
         MessageBox.Show("New User Added");
         this.Close();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }