From 0ab766a40be30efc8a20d243994261bddb8bf1b4 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 24 Apr 2014 15:05:12 +0200 Subject: [PATCH] Inserito predicato NEW x record Visita Generale --- MedPred/VGen.aspx.cs | 29 ++++++++++++++++++++++++++++- MedPred_Data/DtProxy.cs | 3 +++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/MedPred/VGen.aspx.cs b/MedPred/VGen.aspx.cs index 615cd6e..35f39ca 100644 --- a/MedPred/VGen.aspx.cs +++ b/MedPred/VGen.aspx.cs @@ -1,4 +1,5 @@ using MedPred_Data; +using SteamWare; using System; using System.Collections.Generic; using System.Data; @@ -13,7 +14,33 @@ namespace MedPred { protected void Page_Load(object sender, EventArgs e) { - + if (!Page.IsPostBack) + { + // verifico se ci sia richeista x un comando tipo sel/edit + string cmd = Request.QueryString["cmd"]; + switch (cmd) + { + case "new": + // creo nuova visita in data odierna + DtProxy.man.taVGen.InsertQuery(IdxPaziente, DateTime.Now.Date, 0, 0, 0, 0, 0, 0); + // indico in edit prima (ed unica) riga + grView.EditIndex = 0; + // aggiorno grView! + grView.DataBind(); + break; + case "sel": + break; + default: + break; + } + } + } + protected int IdxPaziente + { + get + { + return memLayer.ML.IntSessionObj("IdxPaziente"); + } } /// /// richiesta nuovo record diff --git a/MedPred_Data/DtProxy.cs b/MedPred_Data/DtProxy.cs index 2c5cb7c..d500659 100644 --- a/MedPred_Data/DtProxy.cs +++ b/MedPred_Data/DtProxy.cs @@ -23,6 +23,7 @@ namespace MedPred_Data protected virtual void avvioTableAdapters() { taAP = new DS_ApplicazioneTableAdapters.AnagPazientiTableAdapter(); + taVGen = new DS_ApplicazioneTableAdapters.VisGenTableAdapter(); } /// /// effettua setup dei connection strings da web.config della singola applicazione @@ -32,6 +33,7 @@ namespace MedPred_Data string connStr = memLayer.ML.confReadString("MedPredConnectionString"); // connections del db vocabolario taAP.Connection.ConnectionString = connStr; + taVGen.Connection.ConnectionString = connStr; } #endregion @@ -39,6 +41,7 @@ namespace MedPred_Data #region area public public DS_ApplicazioneTableAdapters.AnagPazientiTableAdapter taAP; + public DS_ApplicazioneTableAdapters.VisGenTableAdapter taVGen; public static DtProxy man = new DtProxy();