Example #1
0
 public void MetaData_AfterRowSelect(DataTable T, DataRow rDepartment)
 {
     if (rDepartment["!password"] is DBNull)
     {
         string userAmmin   = (string)Meta.Conn.GetSys("user");
         byte[] alfa        = mainConn.sha256UserPassword();
         string filtroAmmin = "(login="******") and (iddbdepartment="
                              + QueryCreator.quotedstrvalue(rDepartment["iddbdepartment"], true)
                              + ")";
         object o = Meta.Conn.DO_READ_VALUE("dbaccess", filtroAmmin, "alpha1");
         if (o != null)
         {
             byte[] alfa1 = QueryCreator.StringToByteArray((string)o);
             byte[] up    = xor(alfa, alfa1);
             try {
                 rDepartment["!password"] = DataAccess.DecryptString(up);
             } catch (CryptographicException) {
             }
         }
     }
     btnPassword.Text = (rDepartment["!password"] is DBNull)
                         ? "Inserisci password"
                         : "Modifica password";
 }