Пример #1
0
 private void btnCopy_Click(object sender, EventArgs e)
 {
     if (txtUsernameFrom.Text == "" || txtUsernameFrom.Text == txtUsernameTo.Text)
     {
         XtraMessageBox.Show("Please enter the Username", "HAMACO", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         string username2 = gen.GetString3("MSC_User", "UserName", "UserName", txtUsernameTo.Text, "CompanyCode", Globals.companycode);
         if (username2 == "")
         {
             Frm_user F = new Frm_user();
             F.getusername(txtUsernameTo.Text);
             F.getactive("0");
             F.Show();
             copyRoles(txtUsernameFrom.Text, txtUsernameTo.Text); // copy role
             copyStock(txtUsernameFrom.Text, txtUsernameTo.Text);
         }
         else
         {
             // XtraMessageBox.Show("This user is already existed", "HAMACO", MessageBoxButtons.OK, MessageBoxIcon.Error);
             copyRoles(txtUsernameFrom.Text, txtUsernameTo.Text); // copy role va companycode
             copyStock(txtUsernameFrom.Text, txtUsernameTo.Text);
             Frm_user F = new Frm_user();
             F.getusername(txtUsernameTo.Text);
             F.getactive("1");
             F.Show();
         }
     }
 }
Пример #2
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     if (txtUser.Text == "")
     {
         XtraMessageBox.Show("Please enter the Username", "HAMACO", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         username = gen.GetString3("MSC_User", "UserName", "UserName", txtUser.Text, "CompanyCode", Globals.companycode);
         if (username == "")
         {
             Frm_user F = new Frm_user();
             F.getusername(txtUser.Text);
             F.getactive("0"); //  tao moi
             F.Show();
         }
         else
         {
             XtraMessageBox.Show("This user " + username + " is already existed", "HAMACO", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }