Exemplo n.º 1
0
        internal static DdrFiler buildAddRecordQuery(AbstractConnection cxn, RemoteApplicationRecord rec, CallBackFileRecord subrec)
        {
            DdrFiler query = new DdrFiler(cxn);

            query.Operation = "ADD";
            ArrayList  lst = new ArrayList(7);
            VistaField f   = rec.Fields["NAME"];

            lst.Add(FILE_NUMBER + "^" + f.VistaNumber + "^+1,^" + f.VistaValue);
            f = rec.Fields["CONTEXTOPTION"];
            VistaUserDao dao = new VistaUserDao(cxn);

            lst.Add(FILE_NUMBER + "^" + f.VistaNumber + "^+1,^" + dao.getOptionIen(f.VistaValue));
            f = rec.Fields["APPLICATIONCODE"];
            lst.Add(FILE_NUMBER + "^" + f.VistaNumber + "^+1,^" + f.VistaValue);

            f = subrec.Fields["CALLBACKTYPE"];
            lst.Add(CALLBACK_FILE_NUMBER + "^" + f.VistaNumber + "^+2,+1^" + f.VistaValue);
            f = subrec.Fields["CALLBACKPORT"];
            lst.Add(CALLBACK_FILE_NUMBER + "^" + f.VistaNumber + "^+2,+1^" + f.VistaValue);
            f = subrec.Fields["CALLBACKSERVER"];
            lst.Add(CALLBACK_FILE_NUMBER + "^" + f.VistaNumber + "^+2,+1^" + f.VistaValue);
            f = subrec.Fields["URLSTRING"];
            lst.Add(CALLBACK_FILE_NUMBER + "^" + f.VistaNumber + "^+2,+1^" + f.VistaValue);

            query.Args = (string[])lst.ToArray(typeof(string));
            return(query);
        }
Exemplo n.º 2
0
        public string isRpcAvailable(string target, string context, string localRemote, string version)
        {
            if (!isRpcAvailableAtSite(target, localRemote, version))
            {
                return("Not installed at site");
            }
            KeyValuePair <string, string>[] rpcList = getRpcList(target);
            string       rpcIEN  = rpcList[0].Key;
            VistaUserDao userDao = new VistaUserDao(cxn);
            string       optIEN  = userDao.getOptionIen(context);

            if (!StringUtils.isNumeric(optIEN))
            {
                return("Error getting context IEN: " + optIEN);
            }
            DdrLister query = buildGetOptionRpcsQuery(optIEN);

            string[] optRpcs = query.execute();
            if (!isRpcIenPresent(optRpcs, rpcIEN))
            {
                return("RPC not in context");
            }
            return("YES");
        }