home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comredis.cab / update.aspx < prev    next >
Encoding:
Text File  |  2000-06-12  |  5.8 KB  |  209 lines

  1. <%@ Import Namespace="System.IO" %>
  2. <%@ Import Namespace="System.Collections" %>
  3. <%@ Import Namespace="System.Web" %>
  4. <%@ Import Namespace="System.Web.Util" %>
  5.  
  6. <style>
  7.  
  8.  
  9. body           { margin:0,0,0,0; }
  10. table, td      { font-size=10pt;font-family:Verdana; }
  11. td.products td { text-align:center; font-size:8pt; vertical-align:top; height:248 }
  12.  
  13. td.select      { color:ffffff; background-color:000000; font-size:14pt;}
  14. td.select select { width:130 }
  15. td.cart        { height:2500 }
  16. td.cart td     { font-size:9pt; font-weight:700} 
  17. td.cart a      { font-size:11pt; font-weight:700}
  18.  
  19. h3             { font-size:22 }
  20. h2             { font-size:22 }
  21. a:link         { color:blue; }
  22. a:visited      { color:blue; }
  23.  
  24. div.details {background-color:ffffcc; padding-top:15; padding-bottom:20; }
  25. div.details table { width:280; }
  26. div.details table td { font-family:Verdana; font-size:8pt; }
  27.  
  28. table.nutr td  { font-family: Verdana; font-size:8pt; } 
  29.  
  30. img.selected { border-color:DC6035;border-style:solid;}
  31. img.unselected { border-color:ffffcc;border-style:solid;}
  32.  
  33. table.details td { font-family: Verdana; font-size:12pt; padding-right:50; width:50%  }
  34.  
  35. span.blurb { font-size:9pt;}
  36. table.form td { padding-right:15 }
  37.  
  38. .weblet { font-family:Arial;font-style:italic;font-weight:bold;font-size:10pt; color:#66ff66 }
  39. .weblettext { font-family:Verdona;font-size:10pt }
  40. .loginname { font-family:Tahoma; font-weight:bold;font-size:50pt;color:#6699cc}
  41. .topbanner { font-family:Arial;font-weight:bold;font-size:10pt;color:white }
  42. .topbutton { font-family:Arial;font-weight:bold;font-size:11pt;color:black }
  43. .subscriptiontitle { font-family:Arial;font-style:italic;font-weight:bold;font-size:16pt; color:#9C0001 }
  44.  
  45.  
  46. </style>
  47.  
  48. <script runat="server" language="C#">
  49.  
  50. public bool update = false;
  51.  
  52. public void Page_Load(Object sender, EventArgs e) 
  53. {
  54.     if (!IsPostBack) 
  55.     {
  56.     String appurl = Request.QueryString["url"];
  57.     MyWebApplication app = MyWeb.GetApplication(appurl);
  58.  
  59.         //checking if local
  60.         
  61.         if(app.LocalApplication)
  62.         {
  63.           Response.Redirect("myweb://Home/myweb2.aspx?success=local" );
  64.         }
  65.         else if (app != null && appurl != null && appurl.Length>0) 
  66.         {
  67.       UrlHidden.Value = appurl;
  68.       AppName.Text =(app.Manifest.Name.Length >0) ? (app.Manifest.Name):"the Local Application selected";;
  69.             String oldVersion = app.Manifest.Version;
  70.             oldVersion = oldVersion.ToLower();
  71.             MyWebManifest newManifest = MyWeb.GetManifest(appurl);
  72.  
  73.             if(newManifest == null)
  74.             {
  75.                 Response.Redirect("myweb://Home/myweb2.aspx?success=notfound");
  76.             }
  77.  
  78.             else
  79.             {
  80.                 String newVersion = newManifest.Version;
  81.                 newVersion = newVersion.ToLower();
  82.                     
  83.                 if (!oldVersion.Equals(newVersion) )
  84.                 {    
  85.                     update=true;
  86.                     NewVersion.Text = newVersion;
  87.                     OldVersion.Text = oldVersion;
  88.                 }
  89.             }
  90.     }
  91.   }
  92. }
  93.  
  94. public void Submit_Click(Object sender, EventArgs e) 
  95. {
  96.   MyWebApplication app = MyWeb.GetApplication(UrlHidden.Value);
  97.   
  98.   if (app != null)
  99.   {    
  100.     if (app.Update())
  101.     {     
  102.       Response.Redirect("myweb://Home/myweb2.aspx?success=yes&URL="+UrlHidden.Value);
  103.     }
  104.     else if (!app.Update() )
  105.     {
  106.             Response.Redirect("myweb://Home/myweb2.aspx?success=no");
  107.     }
  108.  
  109.   }
  110.   else if (app ==null)
  111.   {
  112.     Response.Redirect("myweb://Home/myweb2.aspx?success=NoApp");
  113.   }
  114.             
  115. }
  116.  
  117.  
  118. </script>
  119.  
  120. <body bgcolor="ffffff">
  121.  
  122. <form runat="server" method="GET" action="update.aspx">
  123. <input type="hidden" id="UrlHidden" runat="server"/>
  124.  
  125. <!-----Main toolbar Starts here -------->
  126.  
  127. <table width=100% cellspacing=0 cellpadding=0>
  128. <tr>
  129. <td>                        
  130.   <table width="100%" bgcolor="#336699">
  131.   <tr height=70>
  132.     <td width=15><!-- Space Filler --></td>
  133.     <td align=left class="loginname">MyWeb </td>
  134.   <td valign=bottom class="topbutton"> </td>
  135.   </tr>
  136.   </table>
  137. </td>
  138. </tr>
  139.             
  140. <tr>
  141. <td>
  142.   <table bgcolor="#003366" cellspacing=0 width=100% cellpadding=0>
  143.   <tr height=20 class="topbanner">
  144.   <td width=50><!----- Space Filler ----></td>
  145.   <td align=right>
  146.     <a id="StartBtn" style="color:#99ccff;text-decoration:none;font-size:9pt" href="install.aspx">Install Application</a>  
  147.     <span style="font-weight:100;color:#99ccff"> | </span>
  148.     <a style="color:#99ccff;text-decoration:none;font-size:9pt;" href="myweb://home">Home</a>    
  149.   </td>
  150.   </tr>
  151.   </table>
  152. </td>
  153. </tr>
  154.  
  155.  
  156. <!------End of main toolbar ----->
  157.             
  158. <tr>
  159. <td align="center">  
  160.   <br><br>
  161.  
  162.   <!------ Beginning of Dialog Box ------>
  163.   <table width="80%" cellpadding=0 cellspacing=0>
  164.     <tr>
  165.     <td>
  166.       <font face=verdana size=4 color=#003366><b>Update Application</b> </font>
  167.     </td>
  168.   </tr>
  169.  
  170.     <tr>
  171.     <td>
  172.         <table bordercolor="#f5deb3" bgcolor=#fffff0 width=100% border=1 cellpadding=20 cellspacing=0>
  173.         <tr>
  174.         <td align=center>
  175.             <% if (update) { %> 
  176.                             
  177.         Version <b><asp:Label id="OldVersion" runat="server"/></b> of <b><asp:Label id="AppName" runat="server"/></b> is currently installed on your machine.<br>Version <b><asp:Label id="NewVersion" runat="server"/></b> is now available for update. This version will now be installed on your machine.<br><br>
  178.         <input type="submit" OnServerClick="Submit_Click" value="  OK  " runat="server"> 
  179.         <input type="button" value="   Cancel   " OnClick="javascript:window.navigate('myweb://home')"/>
  180.                               
  181.             <% } else { %> 
  182.  
  183.                 The most recent version of this application has already been installed.<br>An update is not necessary.<br><br>
  184.                 <input type="button" value="   Return to Home Page   " OnClick="javascript:window.navigate('myweb://home')"/>
  185.  
  186.             <% } %> 
  187.                     
  188.                                            
  189.       <br>
  190.         </td>
  191.         </tr>
  192.     </table>
  193.     </td>
  194.     </tr>
  195.  
  196.     </table>
  197.  
  198.         
  199.         
  200.         <!------- end of dialog box -------->
  201.  
  202. </td>
  203. </tr>
  204. </table>
  205.  
  206. </form>
  207. </body>
  208. </html>
  209.