more tests about ajax and update from service but no chance

This commit is contained in:
Ivan Hörler 2018-08-24 14:09:29 +02:00
parent 8e50539c9c
commit 095e8033e4
4 changed files with 181 additions and 156 deletions

View File

@ -59,6 +59,7 @@ namespace Client
}
private void ButtonSend_Click(object sender, RoutedEventArgs e)
{
LabelRueckmeldungsfeld.Content = "Sende Daten... ";
// wenn die Anzahl im Feld "mehrere Automatisch generieren"
// grösser ist als 0 dann erstelle diese Anzahl automatisch.
// hierzu wird nur die Anzahl an den Server übertragen und
@ -106,7 +107,6 @@ namespace Client
{
try
{
LabelRueckmeldungsfeld.Content = "Sende Daten. ";
// 1. Doctor
Doctor newDoctor = new Doctor(TextboxArztVorname.Text,
TextboxArztName.Text,
@ -269,7 +269,7 @@ namespace Client
catch (Exception ex)
{
LabelRueckmeldungsfeld.Content = "Fehler in der löschung der felder";
System.Diagnostics.Trace.WriteLine(" --e-- Error in Client Save: " + ex);
System.Diagnostics.Trace.WriteLine(" --e-- Error in Client CleanExam: " + ex);
}
}
private void ButtonAutogenerateOne_Click(object sender, RoutedEventArgs e)

View File

@ -4,6 +4,9 @@ using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace EHEC_Server
@ -89,7 +92,8 @@ namespace EHEC_Server
public void ReloadCluster()
{
cluster c = new cluster();
c.Refresh();
}
}
}

View File

@ -1,9 +1,7 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cluster.aspx.cs" Inherits="EHEC_Server.cluster" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head runat="server">
<head runat="server">
<title>CS-EHEC-II</title>
<script type="text/javascript" src="cluster_dependencies/jquery/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="cluster_dependencies/bootstrap/css/bootstrap.css" />
@ -29,13 +27,24 @@
width: 175px;
}
</style>
</head>
<body>
</head>
<body>
<div>
<h1>EHEC Clusteranalysis</h1>
</div>
<form id="form1" runat="server">
<%--<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/cluster.aspx" />
</Services>
</asp:ScriptManager>
<script type="text/javascript">
function RefreshPage()
{
window.location.reload();
console.log("reload..");
}
</script>--%>
<asp:Button
ID="Button1"
runat="server"
@ -74,7 +83,7 @@
springConstant: 0.08,
springLength: 100,
damping: 0.4,
avoidOverlap: 0.5
avoidOverlap: 1
},
maxVelocity: 50,
minVelocity: 0.1,
@ -131,7 +140,7 @@
shape: 'ellipse',
size: 60,
color: {
background: 'yellow',
background: 'yellow'
},
font: {
color: '#111111'
@ -147,7 +156,7 @@
}
},
edges: {
hoverWidth: function (width) {return width+1;},
hoverWidth: function (width) {return width+1;}
}
};
@ -156,5 +165,5 @@
var network = new vis.Network(container, data, options);
</script>
</body>
</body>
</html>

View File

@ -17,20 +17,32 @@ namespace EHEC_Server
ClusterConverter cc = new ClusterConverter();
protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine(" --i-- Cluster Pageload: generating page...");
//Clusterdata = JsonConvert.SerializeObject(cc.WriteJson());
ClusterNodes = cc.WriteJsonNodes();
ClusterEdges = cc.WriteJsonEdges();
//ClusterNodes = JsonConvert.SerializeObject(clusterNodes.GetNodes());
//ClusterEdges = JsonConvert.SerializeObject(clusterEdges.GetEdges());
}
protected void Button1_Click(object sender, EventArgs e)
public void Button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Trace.WriteLine(" --i-- Cluster Click: refreshing data...");
//Clusterdata = JsonConvert.SerializeObject(cc.WriteJson());
ClusterNodes = cc.WriteJsonNodes();
ClusterEdges = cc.WriteJsonEdges();
//ClusterNodes = JsonConvert.SerializeObject(clusterNodes.GetNodes());
//ClusterEdges = JsonConvert.SerializeObject(clusterEdges.GetEdges());
}
public void Refresh()
{
System.Diagnostics.Trace.WriteLine(" --i-- Cluster Refresh: refreshing page...");
//ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "text", "RefreshPage()", true);
//ClientScript.RegisterStartupScript(GetType(), "hwa", "alert('Hello World');", true);
//ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "RefreshPage()", true);
//Response.Redirect(Request.RawUrl);
//Response.Redirect(Request.Url.AbsoluteUri);
//Server.TransferRequest(Request.Url.AbsolutePath, false);
}
}
}