Aggiunta maschera associazione UDC F10/F18

git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@394 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
samuele
2011-12-12 11:42:07 +00:00
parent ffdfb3eba7
commit 58ec550102
13 changed files with 541 additions and 14 deletions
@@ -0,0 +1,47 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_sanpos_associaz_F10_F18.ascx.cs"
Inherits="GMW.WebUserControls.mod_sanpos_associaz_F10_F18" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Panel runat="server" ID="pnlAll" CssClass="stileAttesa" Height="100%">
<div style="height: 100%;">
<div style="float: none; text-align: center; margin: auto;">
<div class="fullPageHeader">
<div style="float: left;">
<asp:Label runat="server" ID="lblPostazione" />
</div>
<div style="float: right;">
<asp:Label runat="server" ID="lblPrinter" />
</div>
<div>
<asp:HyperLink runat="server" ID="hlMenu" NavigateUrl="~/menu.aspx" Text="Main Menu" />
</div>
</div>
<div>
<asp:Label runat="server" ID="lblGitterBoxAttivo" Font-Size="36pt" Text="- no data -" />
</div>
<div class="msgBoxBarcode">
<asp:Label runat="server" ID="lblMessaggi" Text="attesa input utente" Font-Size="18pt" />
</div>
</div>
<div>
<div style="float: none; padding: 4px; text-align: center; margin: auto;">
<div>
<asp:Label runat="server" ID="lblBarcode" Text="Barcode" />
<br />
<asp:TextBox runat="server" ID="txtBarcode" Height="60px" Width="480px" Font-Size="32pt"
AutoPostBack="True" />
<asp:AutoCompleteExtender ID="aceParticolare" runat="server" TargetControlID="txtBarcode"
ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoParticolari" CompletionInterval="1000" />
</div>
<div style="padding-top: 10; padding-bottom: 10;">
<div style="padding-top: 10; padding-bottom: 10;">
<asp:Label runat="server" ID="lblAssociazione" Font-Size="24pt" />
</div>
<div style="padding-top: 10; padding-bottom: 10;">
<asp:Button ID="btnAssocia" runat="server" Font-Size="20pt" Height="120px" OnClick="btnAssocia_Click"
Width="208px" />
</div>
</div>
</div>
</div>
</div>
</asp:Panel>
@@ -0,0 +1,326 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using GMW_data;
namespace GMW.WebUserControls
{
public partial class mod_sanpos_associaz_F10_F18 : System.Web.UI.UserControl
{
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
calcolaPostazione();
traduciObj();
}
doChecks();
lblGitterBoxAttivo.Text = "";
if (currUdcFrom != "")
{
lblGitterBoxAttivo.Text += string.Format("UDC FROM: <b>{0}</b>", currUdcFrom);
}
if (lblGitterBoxAttivo.Text != "")
{
lblGitterBoxAttivo.Text += "<br />";
}
if (currUdcTo != "")
{
lblGitterBoxAttivo.Text += string.Format("UDC TO: <b>{0}</b>", currUdcTo);
}
if (lblGitterBoxAttivo.Text == "")
{
lblGitterBoxAttivo.Text = "...";
}
}
/// <summary>
/// effettua controlli visibilità
/// </summary>
private void doChecks()
{
checkBarcode();
checkStampa();
}
/// <summary>
/// sistemo labels oggetti
/// </summary>
private void traduciObj()
{
// labels
lblPostazione.Text = string.Format("{2}: {0} ({1})", postazione_name, postazione_IP, traduci("postazione"));
lblPrinter.Text = string.Format("{1}: {0}", postazione_printer, traduci("stampante"));
// buttons
btnAssocia.Text = traduci("btnAssocia");
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// calcola postazione corrente (ip, name, printer)
/// </summary>
private void calcolaPostazione()
{
postazione_IP = Request.UserHostName;
postazione_name = dnsUtils.DetermineCompName(postazione_IP);
// cerco stampante x postazione
postazione_printer = "n.d.";
try
{
DS_Applicazione.ElencoPostazioniDataTable tabPost = DataProxy.obj.taElPost.getByCod(postazione_name);
if (tabPost.Rows.Count > 0)
{
postazione_printer = tabPost[0].stampante;
}
else
{
tabPost = DataProxy.obj.taElPost.getByCod("default");
postazione_printer = tabPost[0].stampante;
}
}
catch
{ }
}
/// <summary>
/// indica name della postazione corrente
/// </summary>
protected string postazione_name
{
get
{
return memLayer.ML.StringSessionObj("postazione_name");
}
set
{
memLayer.ML.setSessionVal("postazione_name", value);
}
}
/// <summary>
/// indica ip della postazione corrente
/// </summary>
protected string postazione_IP
{
get
{
return memLayer.ML.StringSessionObj("postazione_IP");
}
set
{
memLayer.ML.setSessionVal("postazione_IP", value);
}
}
/// <summary>
/// indica stampante associata alla postazione corrente
/// </summary>
protected string postazione_printer
{
get
{
return memLayer.ML.StringSessionObj("postazione_printer");
}
set
{
memLayer.ML.setSessionVal("postazione_printer", value);
}
}
/// <summary>
/// indica UDC FROM (F10) selezionato
/// </summary>
protected string currUdcFrom
{
get
{
return memLayer.ML.StringSessionObj("currUdcFrom");
}
set
{
memLayer.ML.setSessionVal("currUdcFrom", value, false);
}
}
/// <summary>
/// indica UDC TO (F18) selezionato
/// </summary>
protected string currUdcTo
{
get
{
return memLayer.ML.StringSessionObj("currUdcTo");
}
set
{
memLayer.ML.setSessionVal("currUdcTo", value, false);
}
}
/// <summary>
/// indica se i caratteri vadano forzati a maiuscoli
/// </summary>
public bool forceUppercase
{
get
{
return memLayer.ML.confReadBool("forceUppercase");
}
}
/// <summary>
/// decodifica il tipo barcode acquisito
/// </summary>
public tipoCodiceBarcode tipoBCode
{
get
{
tipoCodiceBarcode answ = tipoCodiceBarcode.ND;
int trovati = 0;
// controllo non si tratti di un comando...
string preCmd = memLayer.ML.confReadString("prefComandi");
if (barcodeIn.StartsWith(preCmd))
{
answ = tipoCodiceBarcode.Comando;
}
// controllo se sia un particolare "P"
else if (barcodeIn.StartsWith("P"))
{
answ = tipoCodiceBarcode.Particolare;
}
else
{
try
{
// cerco tra gitterbox (UDC)...
trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count;
if (trovati > 0)
{
answ = tipoCodiceBarcode.UDC;
}
}
catch
{
}
}
return answ;
}
}
/// <summary>
/// valore barcode
/// </summary>
public string barcodeIn
{
get
{
return txtBarcode.Text.Trim();
}
set
{
txtBarcode.Text = value;
}
}
/// <summary>
/// controlla se ci sia un barcode
/// </summary>
private void checkBarcode()
{
if (barcodeIn != "")
{
DS_Applicazione.ElencoCartelliniRow rigaCart;
string tipoImballo = "";
lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn);
switch (tipoBCode)
{
case tipoCodiceBarcode.UDC:
// procedo solo se UDC esistente
if (MagClass.magazzino.checkUDC(barcodeIn))
{
// cerco di recuperare riga UDC
try
{
rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0];
tipoImballo = rigaCart.CodImballo;
}
catch
{ }
// controllo il tipo imballo dell'UDC per decidere se sia F10 o F18...
if (tipoImballo == memLayer.ML.confReadString("CodImballoLiquidi"))
{
// salvo UDC from
currUdcFrom = barcodeIn;
}
else if (tipoImballo == memLayer.ML.confReadString("CodImballoLiquidiDaSpedire"))
{
// salvo UDC to
currUdcTo = barcodeIn;
}
else
{
lblMessaggi.Text += " - codice UDC non valido / non trovato.";
pnlAll.CssClass = "stileComandoKo";
}
}
break;
default:
lblMessaggi.Text += " - codice <b>non riconosciuto</b>!";
pnlAll.CssClass = "stileComandoND";
break;
}
barcodeIn = "";
}
else
{
lblMessaggi.Text = "...attesa barcode...";
}
//grView.DataBind();
txtBarcode.Focus();
}
/// <summary>
/// controllo l'abilitazioen alla stampa UDC:
/// - particolare ok
/// - qta > 0
/// - almeno 1 trattamento
/// altrimenti disabilito btn stampa
/// </summary>
private void checkStampa()
{
bool associaOk = false;
if (currUdcFrom != "" && currUdcTo != "")
{
associaOk = true;
}
btnAssocia.Enabled = associaOk;
}
/// <summary>
/// genera i barcode di
/// - trattamenti
/// - nuovo x pezzi liquidi
/// e lancia la relativa stampa
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAssocia_Click(object sender, EventArgs e)
{
if (currUdcFrom != "" && currUdcTo != "")
{
// associo i 2 cartellini
MagClass.magazzino.associaUdcParent(currUdcTo, currUdcFrom);
// indico UDC associati!
lblMessaggi.Text = string.Format("{0} {1} -> {2}", traduci("effettuataAssociazione"), currUdcFrom, currUdcTo);
currUdcFrom = "";
currUdcTo = "";
lblGitterBoxAttivo.Text = "";
}
}
}
}
@@ -0,0 +1,115 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4963
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GMW.WebUserControls {
public partial class mod_sanpos_associaz_F10_F18 {
/// <summary>
/// pnlAll control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnlAll;
/// <summary>
/// lblPostazione control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPostazione;
/// <summary>
/// lblPrinter control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPrinter;
/// <summary>
/// hlMenu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hlMenu;
/// <summary>
/// lblGitterBoxAttivo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblGitterBoxAttivo;
/// <summary>
/// lblMessaggi control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMessaggi;
/// <summary>
/// lblBarcode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblBarcode;
/// <summary>
/// txtBarcode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtBarcode;
/// <summary>
/// aceParticolare control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.AutoCompleteExtender aceParticolare;
/// <summary>
/// lblAssociazione control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblAssociazione;
/// <summary>
/// btnAssocia control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAssocia;
}
}
@@ -23,7 +23,7 @@
</div>
</div>
<div>
<div style="float: left; padding: 4px; text-align: left;">
<div style="float: left; padding: 4px; text-align: left; width: 220px; height: 300px;">
<div>
<asp:Label runat="server" ID="lblNumTratt" />
</div>
@@ -52,7 +52,7 @@
</div>
</div>
</div>
<div style="float: right; padding: 4px; text-align: right;">
<div style="float: right; padding: 4px; text-align: right; width: 220px; height: 300px;">
<div style="float: left; text-align: left;">
<asp:Label runat="server" ID="lblQta" />
<br />
@@ -39,8 +39,8 @@ namespace GMW.WebUserControls
/// </summary>
private void doChecks()
{
checkStampa();
checkBarcode();
checkStampa();
}
/// <summary>
/// sistemo labels oggetti
@@ -43,7 +43,7 @@
<asp:Label runat="server" ID="lblBarcode" Text="Barcode" />
<br />
<asp:TextBox runat="server" ID="txtBarcode" Height="60px" Width="480px"
Font-Size="32pt" AutoPostBack="True" ontextchanged="txtBarcode_TextChanged" />
Font-Size="32pt" AutoPostBack="True" />
<asp:AutoCompleteExtender ID="aceParticolare" runat="server" TargetControlID="txtBarcode"
ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoParticolari" CompletionInterval="1000" />
</div>
@@ -38,8 +38,8 @@ namespace GMW.WebUserControls
/// </summary>
private void doChecks()
{
checkStampa();
checkBarcode();
checkStampa();
}
/// <summary>
/// sistemo labels oggetti
@@ -357,14 +357,5 @@ namespace GMW.WebUserControls
MagClass.magazzino.stampaUdc(newUdcChild, postazione_printer, tipoCartellino.cartFin);
}
}
/// <summary>
/// controllo campo barcode
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtBarcode_TextChanged(object sender, EventArgs e)
{
//doChecks();
}
}
}
Binary file not shown.
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/AjaxSimpleFull.Master" AutoEventWireup="true" CodeBehind="sanpos_associaz_F10_F18.aspx.cs" Inherits="GMW.sanpos_associaz_F10_F18" %>
<%@ Register src="WebUserControls/mod_sanpos_associaz_F10_F18.ascx" tagname="mod_sanpos_associaz_F10_F18" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<uc1:mod_sanpos_associaz_F10_F18 ID="mod_sanpos_associaz_F10_F181"
runat="server" />
</asp:Content>
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GMW
{
public partial class sanpos_associaz_F10_F18 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
+25
View File
@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4963
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GMW {
public partial class sanpos_associaz_F10_F18 {
/// <summary>
/// mod_sanpos_associaz_F10_F181 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::GMW.WebUserControls.mod_sanpos_associaz_F10_F18 mod_sanpos_associaz_F10_F181;
}
}
Binary file not shown.