Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
orellabacCR committed Aug 27, 2019
0 parents commit d27949e
Show file tree
Hide file tree
Showing 97 changed files with 41,758 additions and 0 deletions.
Binary file added Media/Add.bmp
Binary file not shown.
Binary file added Media/Delete.bmp
Binary file not shown.
Binary file added Media/Edit.bmp
Binary file not shown.
Binary file added Media/Logo with letters.bmp
Binary file not shown.
Binary file added Media/Logo with letters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/Logo-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/Logo-small.bmp
Binary file not shown.
Binary file added Media/Market.bmp
Binary file not shown.
Binary file added Media/Market.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/MobilizeLogos/3bars-Icon-tranparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/MobilizeLogos/3bars-Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/MobilizeLogos/mobilize.ico
Binary file not shown.
Binary file added Media/NewLogo.bmp
Binary file not shown.
Binary file added Media/NewLogo.ico
Binary file not shown.
Binary file added Media/NewLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmAddProductTo.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmAddStockManual.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmCustomers.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmOrderReception.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmProviders.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmReceptionApproval.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmRequestApproval.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSPhotos/frmSearch.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/SKSWINFORMS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Media/Save.2.bmp
Binary file not shown.
Binary file added Media/Save.bmp
Binary file not shown.
Binary file added Media/Search.bmp
Binary file not shown.
Binary file added Media/newlogo_svI_icon.ico
Binary file not shown.
Binary file added Media/newlogo_ugr_icon.ico
Binary file not shown.
Binary file added Media/search.ico
Binary file not shown.
Binary file added Media/user.ico
Binary file not shown.
Binary file added NewLogo.ico
Binary file not shown.
Binary file added Orders.mdb
Binary file not shown.
36 changes: 36 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.


// Review the values of the assembly attributes


[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("Artinsoft")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:

// Major Version
// Minor Version
// Build Number
// Revision

// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion=("1.0.*")]


[assembly: AssemblyVersion("1.0.*")]


[assembly: ClassInterface(ClassInterfaceType.AutoDual)]
251 changes: 251 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
# Salmon King Seafood Reference App (SKS) WinForms C#

![SKSWinForms](./Media/SKSWINFORMS.jpg)

# About the App
Salmon King Seafood (SKS) is a reference App create to show some of the migration capabilities of the [Visual Basic Upgrade Companion](https://www.mobilize.net/visual-basic-upgrade-companion) [VBUC](https://www.mobilize.net/visual-basic-upgrade-companion) from [Mobilize.Net](https://www.mobilize.net)

# Migrated Screens

Below you can see some of the migrated screens

![frmOrderReception](./Media/SKSPhotos/frmOrderReception.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmOrderReception.PNG)


![frmOrderReception](./Media/SKSPhotos/frmProviders.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmProviders.PNG)

![frmOrderReception](./Media/SKSPhotos/frmCustomers.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmCustomers.PNG)

![frmOrderReception](./Media/SKSPhotos/frmAddProductTo.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmAddProductTo.PNG)

![frmOrderReception](./Media/SKSPhotos/frmAddStockManual.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmAddStockManual.PNG)

![frmOrderReception](./Media/SKSPhotos/frmReceptionApproval.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmReceptionApproval.PNG)


![frmOrderReception](./Media/SKSPhotos/frmRequestApproval.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmRequestApproval.PNG)


![frmOrderReception](./Media/SKSPhotos/frmSearch.PNG)
[VB Screen](/~https://github.com/MobilizeNet/SKSVB6/raw/master/Media/SKSPhotos/frmSearch.PNG)

# Some VBUC Features used by this migration

## ADODB to `System.Data.Common`

Converts `ADODB` to ADO.Net by using the System.Data.Common libraries and some helpers.

> **Remarks**
>- This option converts `ADODB` to ADO.NET by using helper classes but with a very high automation level.
>- If the VB6 code is using data binding to grids it is also recommended to convert all data grids to .Net components.
### General Description:

This solution uses a set of helper objects to provide equivalent behavior in .Net and to encapsulate the ADO.Net machinery required in order to handle a set of data, more specifically for the RecordSet object, which is very powerful and flexible in VB6 and does not have a direct equivalence in .Net. The approach reduces the manual changes effort to achieve functional equivalence.

The usage of `System.Data.Common` libraries provides the application with the ability to interact with different Database Manager Systems (e.g. SQL Server, Oracle, MS Access, etc) through its ADO.Net 2.0 compliant providers with just a minimal configuration effort and proper dialect changes.

**Deployment Note**

This feature if needed can be configured using a .Net configuration file containing specific sections. See [Example](https://gist.github.com/orellabac/a644a07dc02094698730f6619d1ba071)

| Class | Maps To |
| --- | --- |
|ADODB.RecordSet |UpgradeHelpers.DB.ADO.ADORecordSetHelper|
|ADODB.Command |System.Data.Common.DbCommand|
|ADODB.CommandTypeEnum |System.Data.CommandType|
|ADODB.Connection |System.Data.Common.DbConnection
|ADODB.DataTypeEnum |System.Data.DbType
|ADODB.Field |System.Data.DataColumn
|ADODB.Fields |System.Data.DataColumnCollection
|ADODB.IsolationLevelEnum |System.Data.IsolationLevel
|ADODB.ObjectStateEnum |System.Data.ConnectionState
|ADODB.Parameter |System.Data.Common.DbParameter
|ADODB.ParameterDirectionEnum |System.Data.ParameterDirection
|ADODB.Parameters |System.Data.Common.DbParameterCollection
|ADODB.Stream |System.IO.StreamWriter
|ADODB.LockTypeEnum |UpgradeHelpers.DB.ADO.LockTypeEnum
|ADODB.CursorLocationEnum |UpgradeHelpers.DB.ADO.CursorLocationEnum
|ADODB.AffectEnum |UpgradeHelpers.DB.ADO.AffectEnum
|ADODB.EventStatusEnum |UpgradeHelpers.DB.ADO.Events.EventStatusEnum
|ADODB.EventReasonEnum |UpgradeHelpers.DB.ADO.Events.EventReasonEnum
|ADODB.PositionEnum |UpgradeHelpers.DB.ADO.PositionEnum
|MSAdodcLib.Adodc |UpgradeHelpers.DB.ADO.ADODataControlHelper
|MSAdodcLib.EOFActionEnum |UpgradeHelpers.DB.Controls.EOFActionEnum
|MSAdodcLib.BOFActionEnum |UpgradeHelpers.DB.Controls.BOFActionEnum

### Code Examples

**VB6**
```vb
Dim conConnection As New ADODB.Connection
Dim cmdCommand As New ADODB.Command
Dim rstRecordSet As New ADODB.Recordset
conConnection.Open
cmdCommand.CommandText = "SELECT * FROM TestTable;"
...
rstRecordSet.Open
If rstRecordSet.EOF = False Then
MsgBox rstRecordSet.Fields(0).Name & "=" & rstRecordSet.Fields(0)
Else
MsgBox "No records were returned using the query " & cmdCommand.CommandText
End If

```

**C#**
```csharp
using UpgradeHelpers.DB;
...
DbConnection conConnection = AdoFactoryManager.GetFactory().CreateConnection();
DbCommand cmdCommand = AdoFactoryManager.GetFactory().CreateCommand();
ADORecordSetHelper rstRecordSet = new ADORecordSetHelper("");
conConnection.Open();
...
cmdCommand.CommandText = "SELECT * FROM TestTable;";
...
rstRecordSet.Open();
if (! rstRecordSet.EOF)
{
MessageBox.Show(Convert.ToString(rstRecordSet[0]), Application.ProductName);
}
else
{
MessageBox.Show("No records were returned using the query " + cmdCommand.CommandText, Application.ProductName);
}
```

## `MSFlexGridLib` To DataGridViewFlex

Maps Microsoft's `MSFlexGridLib` to a helper class that extends the `System.Windows.Forms.DataGridView` component

| Class |Maps To|
| -- | --|
|MSFlexGridLib.MSFlexGrid |UpgradeHelpers.Gui.DataGridViewFlex|

**VB6**
```vb
Private Sub Form_Load()
Dim ctl As MSFlexGrid
Set ctl = MSFlexGrid1
ctl.ScrollBars = flexScrollBarBoth
ctl.GridLines = flexGridNone
End Sub
```

```csharp
private void Form1_Load(Object eventSenderEventArgs eventArgs)
{
UpgradeHelpers.Gui.DataGridViewFlex ctl;
ctl = new UpgradeHelpers.Gui.DataGridViewFlex();
ctl.ScrollBars = ScrollBars.Both;
ctl.CellBorderStyle = DataGridViewCellBorderStyle.None;
}
```

## `VBCollection` To `OrderedDictionary`

Convert Collection type to `System.Collections.Specialized.OrderedDictionary`


|Class |Maps To
| -- | --|
|vba.Collection | System.Collections.Specialized.OrderedDictionary|

## `MSComctLib` To `System.Windows.Forms`


Converts Microsoft's `MSComctLib` classes to `System.Windows.Forms`.

>Remarks:
>- By using this option the converted application will not have any >reference to the COM Component.

|Class |Maps To|
|--|--|
|MSComctlLib StatusBar |System.Windows.Forms.StatusStrip
|MSComctlLibToolbar |System.Windows.Forms.ToolStrip
|MSComctlLibImageList |System.Windows.Forms.ImageList
|MSComctlLibTabStrip |System.Windows.Forms.TabControl
|MSComctlLibTreeView |System.Windows.Forms.TreeView
|MSComctlLibImageCombo |System.Windows.Forms.ComboBox
|MSComctlLibListView |System.Windows.Forms.ListView
|MSComctLib.ProgressBar |System.Windows.Forms.ProgressBar

**VB6**
```vb
Begin VB.Form Form1
...
Begin MSComctlLib.ImageCombo ImageCombo1
...
End
Begin MSComctlLib.Slider Slider1
...
End
Begin MSComctlLib.ImageList ImageList1
...
End
Begin MSComctlLib.ListView ListView1
...
End
Begin MSComctlLib.TreeView TreeView1
...
End
Begin MSComctlLib.ProgressBar ProgressBar1
...
End
Begin MSComctlLib.StatusBar StatusBar1
...
End
Begin MSComctlLib.TabStrip TabStrip1
...
End
Begin MSComctlLib.Toolbar Toolbar1
...
End
...
```

**C#**
```csharp
partial class Form1
{
...
public System.Windows.Forms.MaskedTextBox MaskEdBox1;
public System.Windows.Forms.ComboBox ImageCombo1;
public System.Windows.Forms.TrackBar Slider1;
public System.Windows.Forms.ImageList ImageList1;
public System.Windows.Forms.ListView ListView1;
public System.Windows.Forms.TreeView TreeView1;
public System.Windows.Forms.ProgressBar ProgressBar1;
private System.Windows.Forms.ToolStripStatusLabel _StatusBar1_Panel1;
public System.Windows.Forms.StatusStrip StatusBar1;
private System.Windows.Forms.TabPage _TabStrip1_Tab1;
public System.Windows.Forms.TabControl.TabPageCollection TabStrip1_Tabs;
public System.Windows.Forms.TabControl TabStrip1;
public System.Windows.Forms.ToolStrip Toolbar1;
...
private void InitializeComponent()
{
...
this.ImageCombo1 = new System.Windows.Forms.ComboBox();
this.Slider1 = new System.Windows.Forms.TrackBar();
this.ImageList1 = new System.Windows.Forms.ImageList();
this.ListView1 = new System.Windows.Forms.ListView();
this.TreeView1 = new System.Windows.Forms.TreeView();
this.ProgressBar1 = new System.Windows.Forms.ProgressBar();
this.StatusBar1 = new System.Windows.Forms.StatusStrip();
this._StatusBar1_Panel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.TabStrip1 = new System.Windows.Forms.TabControl();
this.TabStrip1_Tabs = new System.Windows.Forms.TabControl.TabPageCollection(TabStrip1);
this._TabStrip1_Tab1 = new System.Windows.Forms.TabPage();
this.Toolbar1 = new System.Windows.Forms.ToolStrip();
}
```
Loading

0 comments on commit d27949e

Please sign in to comment.