Example #1
0
    protected void Page_Init(object sender, EventArgs e)
    {
        DataRow workRow;

        dtTableTypes.Columns.Add("TableName", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("FilterValue", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("SelectString", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("SortField", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("DescData", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("Col1Data", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("Col1Hdr", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("Col2Data", Type.GetType("System.String"));
        dtTableTypes.Columns.Add("Col2Hdr", Type.GetType("System.String"));
        // The various support tables names and filters are hardcoded here
        workRow = dtTableTypes.NewRow();
        workRow["TableName"]    = "Types of Charges";
        workRow["FilterValue"]  = "GERCHRG";
        workRow["SelectString"] = "Dsc as KeyValue, ChrgTypeDsc as TypeDesc, SpreadMeth , DisplayOrder , convert(varchar(50), pTableID) as pTableID";
        workRow["SortField"]    = "DisplayOrder";
        workRow["DescData"]     = "ChrgTypeDsc";
        workRow["Col1Data"]     = "SpreadMeth";
        workRow["Col1Hdr"]      = "Spread";
        workRow["Col2Data"]     = "DisplayOrder";
        workRow["Col2Hdr"]      = "Order";
        dtTableTypes.Rows.Add(workRow);
        workRow = dtTableTypes.NewRow();
        workRow["TableName"]    = "Types of Receipts";
        workRow["FilterValue"]  = "GERREC";
        workRow["SelectString"] = "Dsc as KeyValue, RcptTypeDsc as TypeDesc, convert(varchar(50), pTableID) as pTableID";
        workRow["SortField"]    = "KeyValue";
        workRow["DescData"]     = "RcptTypeDsc";
        workRow["Col1Data"]     = "";
        workRow["Col1Hdr"]      = "";
        workRow["Col2Data"]     = "";
        workRow["Col2Hdr"]      = "";
        dtTableTypes.Rows.Add(workRow);
        workRow = dtTableTypes.NewRow();
        workRow["TableName"]    = "Ports Of Lading";
        workRow["FilterValue"]  = "GERPORT";
        workRow["SelectString"] = "Dsc as KeyValue, convert(varchar(50), pTableID) as pTableID";
        workRow["SortField"]    = "KeyValue";
        workRow["DescData"]     = "";
        workRow["Col1Data"]     = "";
        workRow["Col1Hdr"]      = "";
        workRow["Col2Data"]     = "";
        workRow["Col2Hdr"]      = "";
        dtTableTypes.Rows.Add(workRow);
        workRow = dtTableTypes.NewRow();
        workRow["TableName"]    = "Tariff Numbers";
        workRow["FilterValue"]  = "GERTARIFF";
        workRow["SelectString"] = "Dsc as KeyValue, ShortDsc as TypeDesc, Pct as Rate , convert(varchar(50), pTableID) as pTableID";
        workRow["SortField"]    = "KeyValue";
        workRow["DescData"]     = "ShortDsc";
        workRow["Col1Data"]     = "Pct";
        workRow["Col1Hdr"]      = "Rate";
        workRow["Col2Data"]     = "";
        workRow["Col2Hdr"]      = "";
        dtTableTypes.Rows.Add(workRow);
        workRow = dtTableTypes.NewRow();
        workRow["TableName"]    = "Charge Adder Functions";
        workRow["FilterValue"]  = "GERADDERFUNC";
        workRow["SelectString"] = "Dsc as KeyValue, convert(varchar(50), pTableID) as pTableID";
        workRow["SortField"]    = "KeyValue";
        workRow["DescData"]     = "";
        workRow["Col1Data"]     = "";
        workRow["Col1Hdr"]      = "";
        workRow["Col2Data"]     = "";
        workRow["Col2Hdr"]      = "";
        dtTableTypes.Rows.Add(workRow);
        workRow = dtTableTypes.NewRow();
        workRow["TableName"]    = "Charge Adder Types";
        workRow["FilterValue"]  = "GERADDERTYP";
        workRow["SelectString"] = "Dsc as KeyValue, convert(varchar(50), pTableID) as pTableID";
        workRow["SortField"]    = "KeyValue";
        workRow["DescData"]     = "";
        workRow["Col1Data"]     = "";
        workRow["Col1Hdr"]      = "";
        workRow["Col2Data"]     = "";
        workRow["Col2Hdr"]      = "";
        dtTableTypes.Rows.Add(workRow);
        TableFilter.DataValueField = "FilterValue";
        TableFilter.DataTextField  = "TableName";
        TableFilter.DataSource     = dtTableTypes;
        TableFilter.DataBind();
    }