C2017-003: Support SQL Server for storing of Referenced Object data

This commit is contained in:
2020-01-09 15:39:17 +00:00
parent 7fbc9e358d
commit de58331ffb
19 changed files with 5088 additions and 1230 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RODBInterface
{
public partial class InputBox : Form
{
private string _ResultConnectString = null;
public string ResultConnectString
{
get { return _ResultConnectString; }
set { _ResultConnectString = value; }
}
public InputBox(string constring)
{
InitializeComponent();
this.tbSqlConnectString.Text = constring;
}
private void btnTestConnect_Click(object sender, EventArgs e)
{
bool canConnect = SqlRODB.TestConnect(this.tbSqlConnectString.Text);
if (!canConnect)
MessageBox.Show("Connection failed.", "Connection Failed");
else
MessageBox.Show("You have been successfully connected to the database!", "Connection Succeeded");
}
private void btnOk_Click(object sender, EventArgs e)
{
ResultConnectString = this.tbSqlConnectString.Text;
}
}
}

View File

@@ -0,0 +1,111 @@
namespace RODBInterface
{
partial class InputBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblSqlConnectString = new System.Windows.Forms.Label();
this.tbSqlConnectString = new System.Windows.Forms.TextBox();
this.btnTestConnect = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblSqlConnectString
//
this.lblSqlConnectString.AutoSize = true;
this.lblSqlConnectString.BackColor = System.Drawing.Color.Transparent;
this.lblSqlConnectString.Location = new System.Drawing.Point(12, 18);
this.lblSqlConnectString.Name = "lblSqlConnectString";
this.lblSqlConnectString.Size = new System.Drawing.Size(144, 17);
this.lblSqlConnectString.TabIndex = 4;
this.lblSqlConnectString.Text = "Sql Connection String";
//
// tbSqlConnectString
//
this.tbSqlConnectString.Location = new System.Drawing.Point(29, 49);
this.tbSqlConnectString.Name = "tbSqlConnectString";
this.tbSqlConnectString.Size = new System.Drawing.Size(620, 22);
this.tbSqlConnectString.TabIndex = 5;
//
// btnTestConnect
//
this.btnTestConnect.Location = new System.Drawing.Point(300, 93);
this.btnTestConnect.Name = "btnTestConnect";
this.btnTestConnect.Size = new System.Drawing.Size(75, 42);
this.btnTestConnect.TabIndex = 6;
this.btnTestConnect.Text = "Test Connect";
this.btnTestConnect.UseVisualStyleBackColor = true;
this.btnTestConnect.Click += new System.EventHandler(this.btnTestConnect_Click);
//
// btnOk
//
this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOk.Location = new System.Drawing.Point(435, 103);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 7;
this.btnOk.Text = "OK";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(571, 103);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 8;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// InputBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(691, 157);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.btnTestConnect);
this.Controls.Add(this.lblSqlConnectString);
this.Controls.Add(this.tbSqlConnectString);
this.Name = "InputBox";
this.Text = "Sql Connection String";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblSqlConnectString;
private System.Windows.Forms.TextBox tbSqlConnectString;
private System.Windows.Forms.Button btnTestConnect;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -939,7 +939,7 @@ namespace RODBInterface
// First get the fields used for this Group.
string tmp=null; // needed for inuse call
ArrayList AvailList = myrodb.RODB_GetFields(this, 0);
ArrayList InUseList = myrodb.RODB_GetFieldsInUse(this, AvailList, "GroupFieldsInUse", ref tmp, true);
ArrayList InUseList = myrodb.RODB_GetFieldsInUse(this, AvailList, "GroupFieldsInUse", ref tmp, false);
// For each field, print the header (field name) & then print data if it exists.
if (InUseList != null)
@@ -1009,7 +1009,7 @@ namespace RODBInterface
// Get used fields for this RO.
string tmp=null; // needed for inuse call
ArrayList AvailList = myrodb.RODB_GetFields(this, 0);
ArrayList InUseList = myrodb.RODB_GetFieldsInUse(this, AvailList, "FieldsInUse", ref tmp, true);
ArrayList InUseList = myrodb.RODB_GetFieldsInUse(this, AvailList, "FieldsInUse", ref tmp, false);
// put out the stored headers, i.e. the group titles up the tree.
xmldoc.doHeader(headers);
@@ -1020,7 +1020,6 @@ namespace RODBInterface
xmldoc.writeRROBegin();
xmldoc.writeInt(8);
xmldoc.writeText(myrodb.MyDBID + MyROID);
Console.WriteLine("ROID={0}", myrodb.MyDBID + MyROID);
xmldoc.writeInt(7);
xmldoc.writeText(this.GetAttribute("AccPageID").Trim());
// add items to the InUseList box.
@@ -1111,6 +1110,7 @@ namespace RODBInterface
// ShowGroup processes the input group node for the complete report by
// using ShowGroupDetail to output data for the group and ShowRRO to
// output data for the RO
DateTime last = DateTime.Now; // use these to control status message output
private bool ShowGroup(RODB myrodb, ArrayList headers, VlnStatusMessage showStat)
{
XmlNode chldnode;
@@ -1154,9 +1154,9 @@ namespace RODBInterface
if (chldnode is VlnXmlElement)
{
VlnXmlElement elem = (VlnXmlElement) chldnode;
if (showStat !=null)
if (showStat != null)
showStat.StatusMessage = elem.InnerText;
// if it's a group, recurse through it.
if (chldnode.Name == "vlnGroup")
elem.ShowGroup(myrodb, headers, showStat);
@@ -1166,8 +1166,14 @@ namespace RODBInterface
int levelcnt = chldnode.ChildNodes.Count;
bool isParDisData = chldnode.Name == "Parameter__Display__Data";
string TheMenuTitle = elem.GetAttribute("MenuTitle");
if (showStat != null)
showStat.StatusMessage = TheMenuTitle;
if (showStat != null)
{
if (TimeSpan.FromTicks(DateTime.Now.Ticks - last.Ticks).Seconds > 1)
{
showStat.StatusMessage = TheMenuTitle;
last = DateTime.Now;
}
}
if (!isParDisData && ((levelcnt > 1) || (levelcnt==1 && !TheMenuTitle.Equals(""))))
elem.ShowRRO(myrodb, headers);
}