Advertisement
Advertisement
| 11.21.2007 at 10:04AM PST, ID: 22976095 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: |
aspx page
<p>
<asp:DropDownList ID="hardGoodsChoices" runat="server" AutoPostBack="True">
<asp:ListItem>--PLEASE CHOOSE--</asp:ListItem>
<asp:ListItem>General</asp:ListItem>
<asp:ListItem>Weights and Measures</asp:ListItem>
<asp:ListItem>Sales Programs/Pricing Info</asp:ListItem>
</asp:DropDownList>
</p>
<asp:GridView ID="gridview" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" PageSize="15">
<Columns>
<asp:TemplateField HeaderText="File Name" SortExpression="fileName">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"fileName") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Hyperlink ID="Hyperlink1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"fileName") %>'
NavigateUrl='<%# DataBinder.Eval(Container.DataItem,"fileName", "~/hr/pdfs/{0} ") %>' Target="_blank"></asp:Hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="fileDate" HeaderText="File Date" SortExpression="fileDate" />
<asp:BoundField DataField="fileSize" HeaderText="File Size" SortExpression="fileSize" />
</Columns>
</asp:GridView>
<%=Test%>
==================aspx.vb page================
Imports System.IO
Imports System.Text.RegularExpressions
Partial Class files_hardGoods
Inherits System.Web.UI.Page
Public test As String
'Public sFolder As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Master.Page.Header.Title = "Hard Goods"
If Page.IsPostBack Then
BindGrid()
End If
End Sub
Private Sub BindGrid()
'The line below is for my local machine use the line after is for web server use
'Dim sFolder As String = "C:\Documents and Settings\Roderick Morales\Desktop\newIntranet\hr\pdfs"
'the line below is for webserver machine
Dim sFolder As String
If hardGoodsChoices.Text = "General" Then
sFolder = "C:\Inetpub\NewIntranet\files\filesUploaded\hard_goods\sales"
test = "files/filesUploaded/hard_goods/sales"
ElseIf hardGoodsChoices.Text = "Weights and Measures" Then
sFolder = "C:\Inetpub\NewIntranet\files\filesUploaded\hard_goods\weights_measures"
test = "files/filesUploaded/hard_goods/weights_measures"
ElseIf hardGoodsChoices.Text = "Sales Programs/Pricing Info" Then
sFolder = "C:\Inetpub\NewIntranet\files\filesUploaded\hard_goods\pricing"
test = "files/filesUploaded/hard_goods/pricing"
Else
Response.Redirect("hardGoods.aspx")
End If
Dim dtFiles As New Data.DataTable
'dtFiles.Columns.Add(New Data.DataColumn("fileName"))
'dtFiles.Columns.Add(New Data.DataColumn("fileDate"))
'dtFiles.Columns.Add(New Data.DataColumn("fileSize"))
'the lines above just call the columns but without giving them a data type
'the lines below gives the columns a datatype so that they can be sorted
dtFiles.Columns.Add(New Data.DataColumn("fileName", System.Type.GetType("System.String")))
dtFiles.Columns.Add(New Data.DataColumn("fileDate", System.Type.GetType("System.DateTime")))
dtFiles.Columns.Add(New Data.DataColumn("fileSize", System.Type.GetType("System.Int64")))
For Each file As String In System.IO.Directory.GetFiles(sFolder, "*.*")
Dim fInfo As System.IO.FileInfo = New System.IO.FileInfo(file)
Dim dr As Data.DataRow = dtFiles.NewRow
dr("fileName") = fInfo.Name
dr("fileDate") = fInfo.LastWriteTime
dr("fileSize") = fInfo.Length
dtFiles.Rows.Add(dr)
dtFiles.AcceptChanges()
Next
'gridview.DataSource = dtFiles
Dim dv As System.Data.DataView = New System.Data.DataView(dtFiles)
If gridSortExpression <> "" Then
dv.Sort = gridSortExpression + " " + IIf(gridSortDirection = SortDirection.Ascending, "DESC", "ASC")
End If
gridview.DataSource = dv
gridview.DataBind()
'gridview.DataBind()
End Sub
|