Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Oracle VB.NET
Private Sub fill_pointer()
 
        Dim id As Integer = intEditID
        Dim oDM As New DAL.DatabaseManager
        Dim oDS As New DAL.IMaCSDataset
        Dim dt As New DataTable
 
        If ddlst_Scale_Type.SelectedValue = "1" Then
 

            oDS = oDM.getDataset("SELECT  " _
                                     & "    MRE.SCALE_ANSWER,   " _
                                     & "    MRE.MIN,  " _
                                     & "    MRE.MAX,  " _
                                     & "    MRE.DESCRIPTION1 ,  " _
                                     & "    MRE.DESCRIPTION2 ,  " _
                                     & "    MSP.CURRENCY_NAME , " _
                                     & "    MB.MEASURE_UNIT , " _
                                     & "    MRE.MST_CURRENCY_ID,  " _
                                     & "    MRE.MST_MEASURE_UNIT_ID,  " _
                                     & "    MRE.MST_SCALE_CONFIG_ID" _
                                     & "    from trn_rcsa_scale MRE,  Mst_Currency MSP ,Mst_Measure_Unit MB " _
                                     & "    where MSP.ID = MRE.MST_CURRENCY_ID And MB.ID = MRE.MST_MEASURE_UNIT_ID And MRE.MST_SCALE_CONFIG_ID = " & intEditID & "  order by MRE.id ")
           
            dt.Columns.Add("Answer")
            dt.Columns.Add("MIN")
            dt.Columns.Add("MAX")
            dt.Columns.Add("DES1")
            dt.Columns.Add("DES2")
            dt.Columns.Add("CURR")
            dt.Columns.Add("MEAS")
 
            For i As Integer = 0 To ddlstPointer.SelectedValue - 1
 
                dt.Rows.Add(oDS.getValue(i, 0), oDS.getValue(i, 1), oDS.getValue(i, 2), oDS.getValue(i, 3), oDS.getValue(i, 4), oDS.getValue(i, 5), oDS.getValue(i, 6))
 

            Next
 
        Else
 
            oDS = oDM.getDataset("SELECT " _
                                    & "    MRE.SCALE_ANSWER,   " _
                                    & "    MRE.MIN,  " _
                                    & "    MRE.MAX,  " _
                                    & "    MRE.DESCRIPTION1 ,  " _
                                    & "    MRE.DESCRIPTION2 ,  " _
                                    & "    MRE.MST_CURRENCY_ID,  " _
                                    & "    MRE.MST_MEASURE_UNIT_ID,  " _
                                    & "    MRE.MST_SCALE_CONFIG_ID" _
                                    & "    from trn_rcsa_scale MRE " _
                                    & "    where MRE.MST_SCALE_CONFIG_ID = " & intEditID & "  order by MRE.id ")
 
            dt.Columns.Add("Answer")
            dt.Columns.Add("MIN")
            dt.Columns.Add("MAX")
            dt.Columns.Add("DES1")
            dt.Columns.Add("DES2")
 

            For i As Integer = 0 To ddlstPointer.SelectedValue - 1
 
                dt.Rows.Add(oDS.getValue(i, 0), oDS.getValue(i, 1), oDS.getValue(i, 2), oDS.getValue(i, 3), oDS.getValue(i, 4))
            Next
 
            DataGrid1.Columns(5).Visible = False
            DataGrid1.Columns(6).Visible = False
 
        End If
 
        DataGrid1.DataSource = dt
        DataGrid1.DataBind()
 
        If ddlst_Scale_Type.SelectedValue = "1" Then
 
            For Each row As DataGridItem In DataGrid1.Items
               
                pklst = row.FindControl("pklstcurr")
                pklst.setPicklistType(PickList.PickListTypes.MST_CURRENCY)
                ClientOnSubmit_AddValidation(PickList_RequiredField, pklst.ClientID, "Currency")
                ddlst = row.FindControl("ddlstScaleMultiplier")
                ddlst.dataSourceTable = ddlstManager.getTable(DropDownList_Type.dd_mst_measure_unit)
                ClientOnSubmit_AddValidation(DropDownListBox_RequiredField, ddlst.ClientID, "Scale Multiplier")
 
                For i As Integer = 0 To ddlstPointer.SelectedValue - 1
 
                    pklst.SelectedValue = oDS.getValue(i, 7)
                    pklst.SelectedText = oDS.getValue(i, 5)
 
                    ddlst.SelectedValue = oDS.getValue(i, 6)
 
                Next
            Next
 
        End If
 
    End Sub
Posted 14-Mar-13 3:39am
Edited 14-Mar-13 3:46am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 315
1 OriginalGriff 273
2 Aajmot Sk 224
3 Marcin Kozub 210
4 Richard MacCutchan 200
0 OriginalGriff 7,853
1 Sergey Alexandrovich Kryukov 7,107
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 14 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100