


| |
Other Forms
This section describes the Location and Container Entry
forms.
The Location Form
The Location form is similar to the Product form

The code for the Location.cs file follows below.
using System;
using Gtk;
using Gdk;
using System.Data;
using System.Data.Odbc;
using EntityLIB;
using TableGridLIB;
namespace Inventory
{
public class LocationSetup
{
public TableGrid TG = new TableGrid( 10, 2 );
public GridEvents ge = null;
//
Color BlueColor = new Gdk.Color( 224, 255, 255 );
string fields_location = "loc_id,loc_desc";
string where_location = "";
string sort_location = "loc_id ASC";
public LocationSetup( VBox vbox, OdbcConnection connect )
{
ge = new GridEvents( vbox,
"location", TG, connect );
display( vbox );
ge.SelectCommand( fields_location,
where_location, sort_location );
int[] key = new int[1];
key[0] = 1;
ge.UpdateCommand( key );
ge.GetData();
}
void display( VBox vbox ) {
vbox.PackStart( TG.Grid, false,
false, 5 );
vbox.PackEnd( TG.GridPager, false,
false, 5 );
TG.hasAssistMenu = false;
TG.hasSelectMenu = false;
TG.hasGridColorAlternate = true;
TG.GridColorAlternate = BlueColor;
TG.DrawDatasheet();
TG.SetColumnHeader( 0, "Location" );
TG.SetColumnHeader( 1, "Description"
);
TG.SetColumnWidth( 1, 15 );
TG.SetColumnWidth( 2, 30 );
}
} //class
} //namespace
The Container Entry Form
In this implementation, the Container form is similar to
the Product form. However, the student may desire to continue to enhance
the form. For example, the product id fields should be validated against
the data in the product table.

The code for the Container Entry form follows below.
using System;
using Gtk;
using Gdk;
using System.Data;
using System.Data.Odbc;
using EntityLIB;
using TableGridLIB;
namespace Inventory
{
public class ContainerEntry
{
public TableGrid TG = new TableGrid( 10, 6 );
public GridEvents ge = null;
//
Color BlueColor = new Gdk.Color( 224, 255, 255 );
string fields_container = "prod_id,con_id,con_qty,con_grade,con_status,con_shipdate";
string where_container = "";
string sort_container = "prod_id ASC";
public ContainerEntry( VBox vbox, OdbcConnection connect )
{
ge = new GridEvents( vbox,
"container", TG, connect );
display( vbox );
ge.SelectCommand( fields_container,
where_container, sort_container );
int[] key = new int[1];
key[0] = 1;
ge.UpdateCommand( key );
ge.GetData();
}
void display( VBox vbox ) {
vbox.PackStart( TG.Grid, false,
false, 5 );
vbox.PackEnd( TG.GridPager, false,
false, 5 );
TG.hasAssistMenu = false;
TG.hasSelectMenu = false;
TG.hasGridColorAlternate = true;
TG.GridColorAlternate = BlueColor;
TG.DrawDatasheet();
TG.SetColumnHeader( 0, "Product" );
TG.SetColumnHeader( 1, "Container" );
TG.SetColumnHeader( 2, "Location" );
TG.SetColumnHeader( 3, "Quantity" );
TG.SetColumnHeader( 4, "Grade" );
TG.SetColumnHeader( 5, "Ship Date" );
TG.SetColumnWidth( 1, 10 );
TG.SetColumnWidth( 2, 10 );
TG.SetColumnWidth( 3, 8 );
TG.SetColumnWidth( 4, 8 );
TG.SetColumnWidth( 5, 8 );
TG.SetColumnWidth( 6, 20 );
}
} //class
} //namespace
|