Esempio n. 1
0
 public JCursor(JConnect connect)
 {
     this.connect = connect;
       connection = connect.Connection;
 }
Esempio n. 2
0
 private void applicationLoad(object sender, EventArgs e)
 {
     using (AutoCursor.AppStart)
       {
     try
     {
       Logger.LogMemo = logMemo;
       Logger.LogFile = new StreamWriter(logFileName);
       LogInfo = string.Format("Log File: {0} opened", logFileName);
       valueCombo.Top = lookupCombo.Top;
       valueLabel.Top = lookupLabel.Top;
       lookupCombo.Top = likeEdit.Top;
       lookupLabel.Top = likeLabel.Top;
       doValueButton.Top = doButton.Top;
       BinTables.LoadParameters(binFileName);
       pcApplication = BinTables.PCApplication;
       pcTables = BinTables.PCTables;
       pcRelations = BinTables.PCRelations;
       pcFields = BinTables.PCFields;
       pcEnums = BinTables.PCEnums;
       pcKeyFields = BinTables.PCKeyFields;
       pcOrderFields = BinTables.PCOrderFields;
       pcBreakFields = BinTables.PCBreakFields;
       pcShowFields = BinTables.PCShowFields;
       pcLinks = BinTables.PCLinks;
       pcLinkPairs = BinTables.PCLinkPairs;
       registryName = pcApplication.registry;
       string ironPythonSetup = Resource1.IronPythonSetup;
       string pythonCode = "";
       if (BinTables.HasValidation() == true)
       {
     pyEngine = Python.CreateEngine();
     pyScope = pyEngine.CreateScope();
     pythonCode = string.Format("{0}\r\n{1}\r\nset_userName('{2}')\r\n", ironPythonSetup ,pcApplication.validateInit, userName);
     ScriptSource __init__ = pyEngine.CreateScriptSourceFromString(pythonCode, SourceCodeKind.Statements);
     __init__.Execute(pyScope);
       }
       mainTab.SelectTab(0);
       registry = new Registry(String.Format("Software\\{0}", registryName));
       maxDropdownEdit.Value = Registry.IntOf(registry["maxDropDown", "256"]);
       showBinfile.Checked = registry["showBinfile", "False"] == "True";
       showSQL.Checked = registry["showSQL", "False"] == "True";
       showSetup.Checked = registry["showSetup", "False"] == "True";
       setGeneralOptions();
       if (showBinfile.Checked == true)
     printBinFile();
       LogDebug = pythonCode;
       Text = pcApplication.descr;
       appNameStripLabel.Text = pcApplication.name;
       appVersionStripLabel.Text = pcApplication.version;
       if (pcApplication.noRelations == 0)
     mainTab.TabPages.Remove(relationsPage);
       else
       {
     for (int i = 0; i < pcApplication.noRelations; i++)
     {
       string[] values = new string[1];
       string[] descr = new string[1];
       values[0] = pcRelations[i].name;
       descr[0] = pcRelations[i].descr;
       listOfRelations.Items.Add(new ListItem(values, descr, i));
     }
       }
       for (int i = 0; i < pcApplication.noTables; i++)
       {
     string[] values = new string[1];
     string[] descr = new string[1];
     values[0] = pcTables[i].name;
     descr[0] = pcTables[i].descr;
     listOfTables.Items.Add(new ListItem(values, descr, i));
       }
       connDataSource = zserver == null ? decrypt(pcApplication.server) : zserver;
       connUserId = xuser == null ? decrypt(pcApplication.user) : xuser;
       connPassword = ypassword == null ? decrypt(pcApplication.password) : ypassword;
       string server = string.Format("Data Source={0};", connDataSource);
       string userData = string.Format("User Id={0};Password={1};", connUserId, connPassword);
       connectionStripLabel.Text = string.Format("{0}@{1}", connUserId, connDataSource);
     #if do_it_with_oracle
       connect = new JConnect(new OracleConnection(server + userData));
     #endif
       server = userData = "";
       connect.TypeOfVendor = VendorType.Oracle;
       connect.Open();
     }
     catch (Exception exception)
     {
       showException(exception);
       Close();
     }
       }
 }
Esempio n. 3
0
 public DBHandler(JConnect connect)
 {
     this.connect = connect;
       cursor = new JCursor(connect);
       fields = null;
       rowSize = 0;
       noRows = 32;
       noFields = 0;
       maxRows = 0;
       Lookup = "";
       UsId = "UsId";
       TmStamp = "TmStamp";
 }