Esempio n. 1
0
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   int  nProd = 0;
   char Title[200];
   HWND hwndProducts   = GetDlgItem(hwnd, IDC_PRODUCTS);
   HWND hwndTables     = GetDlgItem(hwnd, IDC_TABLES);
   HWND hwndtableall   = GetDlgItem(hwnd, IDC_TABLE_ALL);
   HWND hwndproductall = GetDlgItem(hwnd, IDC_PRODUCT_ALL);
   
   LPRECONCILER lpmod = (LPRECONCILER)lParam;
   
   ZEROINIT (Title);

   if (!AllocDlgProp(hwnd, lpmod))
      return FALSE;
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RECONCILER));
   
   //Fill the windows title bar
   GetWindowText(hwnd,Title,GetWindowTextLength(hwnd)+1);
   x_strcat(Title, " ");
   x_strcat(Title, GetVirtNodeName ( GetCurMdiNodeHandle ()));
   x_strcat(Title, "::");
   x_strcat(Title,lpmod->DBName);

   SetWindowText(hwnd,Title);

   if (!OccupyDbnumberControl(hwnd)
    || !OccupyCddsControl(hwnd))
   {
     ASSERT(NULL);
     EndDialog(hwnd, FALSE);
     return TRUE;
   }
	
   InitialiseEditControls(hwnd);
   EnableDisableOKButton (hwnd);
   richCenterDialog(hwnd);
   return TRUE;
}
Esempio n. 2
0
static BOOL FillStructureFromControls (HWND hwnd)
{
   char szGreatBuffer [MAX_RMCMD_BUFSIZE];
   char szBufferT     [MAX_RMCMD_BUFSIZE];
   char szBufferF     [MAX_RMCMD_BUFSIZE];
   char szSyscat      [22];
   char szBefore      [22];
   char szAfter       [22];
   char szCn          [10];
   char szActUser     [MAXOBJECTNAME];
   char szUserName    [MAXOBJECTNAME];
   char buftemp[200];

   HWND hwndSyscat         = GetDlgItem (hwnd, IDC_AUDITDB_SYSCAT);
   HWND hwndBefore         = GetDlgItem (hwnd, IDC_AUDITDB_BEFORE);
   HWND hwndAfter          = GetDlgItem (hwnd, IDC_AUDITDB_AFTER);
   HWND hwndCn             = GetDlgItem (hwnd, IDC_AUDITDB_CKP_NUMBER);
   HWND hwndActUser        = GetDlgItem (hwnd, IDC_AUDITDB_ACTION_USER);
   HWND hwndWait           = GetDlgItem (hwnd, IDC_AUDITDB_WAIT);
   HWND hwndInconsistent   = GetDlgItem (hwnd, IDC_AUDITDB_INCONSISTENT);
   HWND hwndTable          = GetDlgItem (hwnd, IDC_AUDITDB_TABLES);
   HWND hwndFile           = GetDlgItem (hwnd, IDC_AUDITDB_FILES);

   LPUCHAR vnodeName = GetVirtNodeName (GetCurMdiNodeHandle ());
   LPAUDITDBPARAMS     lpauditdb  = GetDlgProp (hwnd);
   LPTABLExFILE ls   = lpfile;

   ZEROINIT (szGreatBuffer);
   ZEROINIT (szBufferT);
   ZEROINIT (szBufferF);
   ZEROINIT (szSyscat);
   ZEROINIT (szBefore);
   ZEROINIT (szAfter);
   ZEROINIT (szCn);
   ZEROINIT (szActUser);

   // Verify if the length of the remote command do not exceed MAX_LINE_COMMAND.
   if (!VerifyBufferLen(hwnd))
   {
       ErrorMessage ((UINT) IDS_E_TOO_MANY_TABLES_SELECTED, RES_ERR);
       return FALSE;
   }

   if (Button_GetCheck (hwndFile))
       x_strcpy (szBufferF, " -file");

   if (Button_GetCheck (hwndTable))
   {
       char*  aTable;
       LPOBJECTLIST list = table.lpTable;

       if (list)
       {
           aTable = (LPTSTR)RemoveDisplayQuotesIfAny((LPTSTR)StringWithoutOwner(list->lpObject));
           x_strcpy (szBufferT, " -table=");
           x_strcat (szBufferT, aTable);
           list = list->lpNext;
       }
       while (list)
       {
           x_strcat (szBufferT, ",");
           aTable = (LPTSTR)RemoveDisplayQuotesIfAny((LPTSTR)StringWithoutOwner(list->lpObject));
           x_strcat (szBufferT, aTable);
           list = list->lpNext;
       }
   }

   if (Button_GetCheck (hwndFile) && ls && Modify (ls))
   {
       x_strcpy (szBufferF, " -file=");
       x_strcat (szBufferF, ls->FileName);
       ls = ls->next;

       while (ls)
       {
           x_strcat (szBufferF, ",");
           x_strcat (szBufferF, ls->FileName);
           ls = ls->next;
       }
   }

   if (Button_GetCheck (hwndSyscat))
       x_strcpy (szSyscat, "-a");
   else
       x_strcpy (szSyscat, "");

   wsprintf (szGreatBuffer,
       "auditdb %s %s %s %s",
       szSyscat,
       lpauditdb->DBName,
       szBufferT,
       szBufferF);
 
   Edit_GetText (hwndAfter,  szAfter,  sizeof (szAfter ));
   Edit_GetText (hwndBefore, szBefore, sizeof (szBefore));
   Edit_GetText (hwndCn,     szCn,     sizeof (szCn));

   ComboBox_GetText (hwndActUser, szActUser, sizeof (szActUser));

   if (x_strlen (szAfter) > 0)
   {
       x_strcat (szGreatBuffer, " -b");
       x_strcat (szGreatBuffer, szAfter);
   }

   if (x_strlen (szBefore) > 0)
   {
       x_strcat (szGreatBuffer, " -e");
       x_strcat (szGreatBuffer, szBefore);
   }

   if (Button_GetCheck (GetDlgItem (hwnd, IDC_AUDITDB_CKP)))
   {
       x_strcat (szGreatBuffer, " #c");
       if (x_strlen (szCn) > 0)
           x_strcat (szGreatBuffer, szCn);
   }

   if (x_strlen (szActUser) > 0)
   {
       x_strcat (szGreatBuffer, " -i");
       x_strcat (szGreatBuffer, szActUser);
   }

   if (Button_GetCheck (hwndWait))
       x_strcat (szGreatBuffer, " -wait");

   if (Button_GetCheck (hwndInconsistent))
       x_strcat (szGreatBuffer, " -inconsistent");
  
   ZEROINIT (szUserName);
   DBAGetUserName (vnodeName, szUserName);
   x_strcat (szGreatBuffer, " -u");
   x_strcat (szGreatBuffer, szUserName);


   wsprintf(buftemp,
       ResourceString ((UINT)IDS_T_RMCMD_AUDITDB), //"auditing database %s::%s",
       vnodeName,
       lpauditdb->DBName);
   execrmcmd(vnodeName,szGreatBuffer,buftemp);
   return TRUE;
}
Esempio n. 3
0
static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
   switch (id)
   {
     case IDOK:
     {
       int nIndex;
       int nCount;
       int nLast=0;
       int max;
       int i;
       int first=0;
       UCHAR buf[MAXOBJECTNAME];
       HWND    hwndCdds     = GetDlgItem (hwnd, IDC_CDDSNUMBER);
       HWND    hwndDbNumber = GetDlgItem (hwnd, IDC_DBNUMBER);
       HWND    hwndStartTime= GetDlgItem (hwnd, IDC_STARTTIME);
       LPRECONCILER lpreconciler = GetDlgProp(hwnd);


       // fill structure with CDDS values
       nCount = 0;
       ZEROINIT (lpreconciler->CddsNo);

       nCount = CAListBox_GetSelCount(hwndCdds);
       max    = CAListBox_GetCount(hwndCdds);
       
       if (nCount != max)
         {
         for (i=0;i<max;i++)
           {
           if (CAListBox_GetSel (hwndCdds, i))
             {
             char szName[MAX_DBNAME_LEN];
             
             CAListBox_GetText(hwndCdds, i, szName);
             
             if (first==0 && nCount>1)
               {
               x_strcat(lpreconciler->CddsNo,"'(");
               first=1;
               }
             
             x_strcat(lpreconciler->CddsNo,szName);
             
             nLast++;

             if ( nLast == nCount && nCount>1 )
               x_strcat(lpreconciler->CddsNo,")'");
             else
               {
               if (nCount>1)
                 x_strcat(lpreconciler->CddsNo,",");
               }
             }
           }
         }
       else
         x_strcat(lpreconciler->CddsNo,"all ");

       // Fill structure with Targetdbnumber
       nIndex=ComboBox_GetCurSel(hwndDbNumber);
       ComboBox_GetLBText(hwndDbNumber, nIndex, buf);
       
       GetIntFromStartofString( buf, lpreconciler->TarGetDbNumber);

       //sscanf (buf,"%s",lpreconciler->TarGetDbNumber );

       //Fill structure with the Start time
       Edit_GetText(hwndStartTime, buf, MAXOBJECTNAME );
       x_strcpy (lpreconciler->StarTime,buf);
       
       if (SendCommand(hwnd)==TRUE)
         EndDialog(hwnd, TRUE);

       break;
     }

     case IDCANCEL:
       EndDialog(hwnd, FALSE);
       break;

     case IDC_DBNUMBER:
       if ( codeNotify == CBN_SELCHANGE)
         EnableDisableOKButton (hwnd);
       break;

     case IDC_CDDSNUMBER:
       if ( codeNotify == CALBN_CHECKCHANGE || codeNotify == CALBN_SELCHANGE ||
                           codeNotify == CALBN_KILLFOCUS )
         EnableDisableOKButton (hwnd);
       break;

     case IDC_STARTTIME:
       if (codeNotify == EN_CHANGE)
         EnableDisableOKButton (hwnd);
       break;

   }
}