예제 #1
0
파일: Pipe.cs 프로젝트: S031/MetaStack
 private static void Read()
 {
     try
     {
         var result = ClientGate.Execute("Sys.PipeRead");
         if (result.Read())
         {
             OutputWindow.Print(LogLevels.Trace, ((string)result[0]).Split(new string[] { "\f" }, StringSplitOptions.RemoveEmptyEntries));
         }
     }
     catch (Exception ex)
     {
         OutputWindow.Print(LogLevels.Error, $"{ex.Message}\n{ex.StackTrace}");
     }
 }
예제 #2
0
파일: DBGrid.cs 프로젝트: S031/MetaStack
        private void GetRecordset()
        {
            string _objectName = _xc.ObjectName;
            var    parameters  = _sqlParams.AsEnumerable();

            if (!StartFilter.IsEmpty())
            {
                parameters = parameters.Concat(new object[] { "_filter", StartFilter });
            }
            if (!_connectioName.IsEmpty())
            {
                parameters = parameters.Concat(new object[] { "_connectionName", _connectioName });
            }

            _dt = ClientGate.GetData(this.ObjectName, parameters.ToArray());
        }
예제 #3
0
        public static DataTable GetData(string queryID, params object[] parameters)
        {
            var dr = ClientGate.GetActionInfo("Sys.Select")
                     .GetInputParamTable()
                     .AddNew()
                     .SetValue("ParamName", "_viewName")
                     .SetValue("ParamValue", queryID)
                     .Update();

            bool c = false;

            for (int i = 0; i < parameters.Length; i++)
            {
                object p = parameters[i];
                if (i % 2 == 0)
                {
                    if (p.ToString().EndsWith("ConnectionName", StringComparison.OrdinalIgnoreCase))
                    {
                        c = true;
                    }
                    else
                    {
                        dr.AddNew();
                        dr.SetValue("ParamName", (string)p);
                    }
                }
                else
                {
                    if (c)
                    {
                        dr.SetHeader("ConnectionName", p);
                        dr.UpdateHeaders();
                        c = false;
                    }
                    else
                    {
                        dr.SetValue("ParamValue", p);
                        dr.Update();
                    }
                }
            }
            return(ClientGate.Execute("Sys.Select", dr).ToDataTable());
        }
예제 #4
0
 public static JMXSchema GetObjectSchema(string objectName)
 {
     if (!_schemaCache.TryGetValue(objectName, out JMXSchema schema))
     {
         using (var p = new DataPackage(
                    new string[] { "ObjectName" },
                    new object[] { objectName }))
             using (var r = ClientGate.Execute("Sys.GetSchema", p))
             {
                 r.GoDataTop();
                 if (r.Read())
                 {
                     schema = JMXSchema.Parse((string)r["ObjectSchema"]);
                     _schemaCache.TryAdd(objectName, schema);
                 }
                 else
                 {
                     return(null);
                 }
             }
     }
     return(schema);
 }