Ejemplo n.º 1
0
 private void SaveBTN_Click(object sender, EventArgs e)
 {
     if (SaveBTN.Text.Equals("SAVE"))
     {
         if (Account.ChangePassword(int.Parse(UsersGRD.SelectedRows[0].Cells[0].Value.ToString()), NewBX.Text.Replace("'", string.Empty),
                                    CurrentBX.Text.Replace("'", string.Empty)))
         {
             Account.ChangeUsername(int.Parse(UsersGRD.SelectedRows[0].Cells[0].Value.ToString()),
                                    UsernameBX.Text.Replace("'", string.Empty));
             LoadUsers();
             CancelBTN.PerformClick();
             RylMessageBox.ShowDialog("Account Details Changed", "Accounts Details",
                                      MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             RylMessageBox.ShowDialog("Current Password is incorrect", "Accounts Details",
                                      MessageBoxButtons.OK, MessageBoxIcon.Error);
             NewBX.Clear();
             CurrentBX.Clear();
         }
     }
     else
     {
         Account.CreateUser(UsernameBX.Text.Replace("'", string.Empty), NewBX.Text.Replace("'", string.Empty), AdminRDBTN.Checked ? 1 : 2);
         LoadUsers();
         CancelBTN.PerformClick();
         RylMessageBox.ShowDialog("User was added", "Users",
                                  MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 2
0
 private void AddBTN_Click(object sender, EventArgs e)
 {
     UsernameBX.Clear();
     CurrentBX.Clear();
     NewBX.Clear();
     CurrentBX.Enabled      = false;
     CurrentPassPic.Visible = false;
     UsersGRDPNL.Visible    = false;
     EditUserPNL.Visible    = true;
     CloseBTN.Visible       = false;
     AdminRDBTN.Enabled     = true;
     ClerkRDBTN.Enabled     = true;
     AboutLBL.Visible       = false;
     SaveBTN.Text           = "ADD";
 }
Ejemplo n.º 3
0
 private void EditBTN_Click(object sender, EventArgs e)
 {
     UsernameBX.Text = UsersGRD.SelectedRows[0].Cells[1].Value.ToString();
     CurrentBX.Clear();
     CurrentBX.Enabled      = true;
     CurrentPassPic.Visible = true;
     NewBX.Clear();
     UsersGRDPNL.Visible = false;
     EditUserPNL.Visible = true;
     CloseBTN.Visible    = false;
     AdminRDBTN.Checked  = UsersGRD.SelectedRows[0].Cells[2].Value.ToString().Equals("Manager");
     ClerkRDBTN.Checked  = UsersGRD.SelectedRows[0].Cells[2].Value.ToString().Equals("Clerk");
     AdminRDBTN.Enabled  = false;
     ClerkRDBTN.Enabled  = false;
     AboutLBL.Visible    = false;
     SaveBTN.Text        = "SAVE";
 }