summaryrefslogtreecommitdiffstats
path: root/backend/asp-file
diff options
context:
space:
mode:
Diffstat (limited to 'backend/asp-file')
-rw-r--r--backend/asp-file/Default.aspx1
-rw-r--r--backend/asp-file/Default.aspx.cs70
-rw-r--r--backend/asp-file/data/default30
3 files changed, 101 insertions, 0 deletions
diff --git a/backend/asp-file/Default.aspx b/backend/asp-file/Default.aspx
new file mode 100644
index 0000000..5be09a7
--- /dev/null
+++ b/backend/asp-file/Default.aspx
@@ -0,0 +1 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="backend_asp_file_Default" validateRequest="false" %>
diff --git a/backend/asp-file/Default.aspx.cs b/backend/asp-file/Default.aspx.cs
new file mode 100644
index 0000000..6bd232c
--- /dev/null
+++ b/backend/asp-file/Default.aspx.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.IO;
+
+public partial class backend_asp_file_Default : System.Web.UI.Page
+{
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Response.Clear();
+
+ string action = Request.Params["action"].ToLower();
+
+ if (action.Equals("list"))
+ {
+ list();
+ }
+
+ if (action.Equals("load"))
+ {
+ load();
+ }
+
+ if (action.Equals("save"))
+ {
+ save();
+ }
+
+ Response.End();
+ }
+
+ private void list()
+ {
+ string[] filePaths = Directory.GetFiles(Server.MapPath("data"));
+ foreach (string filePath in filePaths)
+ {
+ Response.Write(Path.GetFileName(filePath) + "\n");
+ }
+ }
+
+ private void load()
+ {
+ string fNaam = "data/" + Request.Params["keyword"].ToLower();
+ Response.ContentType = "text/xml";
+ if (File.Exists(Server.MapPath(fNaam)))
+ {
+ Response.WriteFile(Server.MapPath(fNaam));
+ }
+ else
+ {
+ Response.StatusCode = 404;
+ }
+ }
+
+ private void save()
+ {
+ string fNaam = "data/" + Request.Params["keyword"].ToLower();
+ FileStream fs = new FileStream(Server.MapPath(fNaam), FileMode.Create);
+
+ byte[] buffer = new byte[1024];
+ int count;
+ while ((count = Request.InputStream.Read(buffer, 0, buffer.Length)) != 0)
+ fs.Write(buffer, 0, count);
+
+ fs.Close();
+
+ }
+}
diff --git a/backend/asp-file/data/default b/backend/asp-file/data/default
new file mode 100644
index 0000000..a6de8b9
--- /dev/null
+++ b/backend/asp-file/data/default
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" ?><sql><datatypes db="mysql">
+ <group label="Numeric" color="rgb(238,238,170)">
+ <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
+ <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
+ <type label="Single precision" length="0" sql="FLOAT" quote=""/>
+ <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
+ </group>
+
+ <group label="Character" color="rgb(255,200,200)">
+ <type label="Char" length="1" sql="CHAR" quote="'"/>
+ <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
+ <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
+ <type label="Binary" length="1" sql="BINARY" quote="'"/>
+ <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
+ <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
+ </group>
+
+ <group label="Date &amp; Time" color="rgb(200,255,200)">
+ <type label="Date" length="0" sql="DATE" quote="'"/>
+ <type label="Time" length="0" sql="TIME" quote="'"/>
+ <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
+ <type label="Year" length="0" sql="YEAR" quote=""/>
+ <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
+ </group>
+
+ <group label="Miscellaneous" color="rgb(200,200,255)">
+ <type label="ENUM" length="1" sql="ENUM" quote=""/>
+ <type label="SET" length="1" sql="SET" quote=""/>
+ </group>
+</datatypes><table x="50" y="50" name="Producer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="574" y="66" name="Consumer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="195" y="333" name="Product"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Producer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Producer" row="id" /></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="383" y="227" name="Garbage"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Product" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Product" row="id" /></row><row name="id_Consumer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Consumer" row="id" /></row><row name="consumed" null="0" autoincrement="0"><datatype>TIMESTAMP</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql> \ No newline at end of file