home *** CD-ROM | disk | FTP | other *** search
/ 74.208.221.89 / 74.208.221.89.zip / 74.208.221.89 / manage / addflipkart.aspx next >
Text File  |  2015-03-28  |  3KB  |  105 lines

  1. ∩╗┐<%@ Page Language="VB" Debug="true" %>
  2. <%@ Import Namespace="System.Data" %>
  3. <%@ Import Namespace="System.Data.OleDB" %>
  4. <%@ Import namespace="System.IO" %>
  5. <script runat="server">
  6. Dim mycon As New conValue()
  7. Dim permissions As String
  8. Dim K As Integer
  9. Dim swidth,sheight As Integer
  10. Dim sqlstr,stype,sheader,sheadertype,sfields,scolratio,scaption,tablehead,dropdownstring As String
  11. Dim sheader1(),sfields1(),scolratio1(),sheadertype1() As String
  12. Dim str1,str2,str3 As String
  13. Dim i,z As Integer
  14. Dim loc As String
  15. Dim loc1 As String
  16. Dim qr As String
  17. Dim language As String
  18. Dim exclfile As String
  19. Dim exltype As String
  20. Dim fileloc As String
  21. Dim filename As String
  22. Sub page_load()
  23. If (Request.Cookies("gen") Is Nothing) Then
  24. 'Response.Redirect("logout.aspx")
  25. End If
  26. Response.Cookies("cart").Value = Request.QueryString("store")
  27. 'Checking user action. If no user action provide upload option
  28. qr = trim(Request.Querystring("qr")) 
  29. language = trim(Request.Querystring("language"))
  30. filename = trim(Request.Querystring("filename"))
  31. ' Storing folder path
  32. loc = Server.MapPath(".")
  33. loc1 = loc & "\language.xls"
  34.  
  35.  
  36.  
  37.  
  38. End Sub
  39. Sub SubmitButton_Click(Source As Object, e As EventArgs)
  40.     Dim uploadedFiles As HttpFileCollection = Request.Files    
  41.  
  42.        Dim i As Integer = 0
  43.         Do Until i = uploadedFiles.Count
  44.           Dim userPostedFile As HttpPostedFile = uploadedFiles(i)
  45.           
  46.           Try
  47.              If (userPostedFile.ContentLength > 0) Then
  48.                    filename = Path.GetFileName(userPostedFile.FileName)
  49.                 userPostedFile.SaveAs(loc & "\" & Path.GetFileName(userPostedFile.FileName))
  50.               End If
  51.           Catch ex As Exception
  52.           End Try
  53.           i += 1
  54.        Loop       
  55.         Response.Redirect("importExcelRead.aspx?qr=1&language=" & Trim(Request.QueryString("language")) & "&filename=" & filename)
  56.     End Sub
  57. </Script>
  58. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  59. <html xmlns="http://www.w3.org/1999/xhtml">
  60. <head>
  61. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  62. <title>Untitled Document</title>
  63. <style type="text/css">
  64. body {
  65.     margin-left: 0px;
  66.     margin-top: 0px;
  67.     margin-right: 0px;
  68.     margin-bottom: 0px;
  69. }
  70. </style>
  71. <link href="ncss.css" rel="stylesheet" type="text/css" />
  72. </head>
  73.  
  74. <body>
  75. <form runat="server">
  76. <table width="100%" border="0" cellspacing="10" cellpadding="0">
  77.   <tr>
  78.     <td height="40" align="left" class="text1">Add Offers From Flip Kart. The excel file needs to be downloaded from Flip Kart Offers.</td>
  79.   </tr>
  80.   <tr>
  81.     <td align="left">
  82.      <input name="File" Type="File" class="btn btn-default" id="file1" runat="Server">
  83.     </td>
  84.   </tr>
  85.   <tr>
  86.     <td align="left"><asp:Button   CssClass="button1" ID="Button1" runat="server" Text="Add Products"  onClick="SubmitButton_Click" qvalue="button1"/></td>
  87.   </tr>
  88.  
  89.       <tr>
  90.     <td align="left"></td>
  91.   </tr>
  92.       <tr>
  93.     <td align="left">
  94.       <a href="importf.aspx">ADD PRODUCTS THROUGH FTP</a></td>
  95.   </tr>
  96.  
  97.       <tr>
  98.     <td align="left"></td>
  99.   </tr>
  100.  
  101. </table>
  102. </form>
  103. </body>
  104. </html>
  105.