Completato edit di rettifica quantità UDC

git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@186 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
samuele
2010-08-03 16:52:02 +00:00
parent 156ebfdf21
commit acdf6b5975
14 changed files with 788 additions and 649 deletions
@@ -40,6 +40,7 @@ namespace GMW_Term.WebUserControls
verificaOperatoreInSessione();
if (_validUserInSession)
{
btnLoginPage.Text = "[7]-LogOut";
btnLoginPage.Visible = true;
btnButtonsHome.Visible = true;
lblData.Text = "Inserire Dati...";
+64 -7
View File
@@ -1,8 +1,9 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_execUdc.ascx.cs"
Inherits="GMW_Term.WebUserControls.mod_execUdc" %>
<div id="smallTable">
<asp:FormView ID="frmView" runat="server" DataKeyNames="UDC" DataSourceID="ods">
<EditItemTemplate>
<asp:FormView ID="frmView" runat="server" DataKeyNames="UDC" DataSourceID="ods"
OnItemUpdated="frmView_ItemUpdated" onmodechanged="frmView_ModeChanged" >
<%--<EditItemTemplate>
UDC:
<asp:Label ID="UDCLabel1" runat="server" Text='<%# Eval("UDC") %>' />
<br />
@@ -67,6 +68,59 @@
Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>--%>
<EditItemTemplate>
UDC:
<asp:Label ID="UDCLabel" runat="server" Text='<%# Eval("UDC") %>' />
<br />
Particolare:
<asp:Label ID="ParticolareLabel" runat="server" Text='<%# Bind("Particolare") %>' />
<br />
<asp:Label ID="DescParticolareLabel" runat="server" Text='<%# Bind("DescParticolare") %>' />
DisegnoGrezzo:
<asp:Label ID="DisegnoGrezzoLabel" runat="server" Text='<%# Bind("DisegnoGrezzo") %>' />
<br />
Esponente:
<asp:Label ID="EsponenteLabel" runat="server" Text='<%# Bind("Esponente") %>' />
<br />
Qta:
<asp:TextBox ID="txtQta" runat="server" Text='<%# Bind("Qta") %>' Width="4em" />
<table>
<tr>
<td>
CodMag:
<asp:Label ID="CodMagLabel" runat="server" Text='<%# Bind("CodMag") %>' />
</td>
<td>
CodBlocco:
<asp:Label ID="CodBloccoLabel" runat="server" Text='<%# Bind("CodBlocco") %>' />
</td>
</tr>
</table>
CodCella:
<asp:Label ID="CodCellaLabel" runat="server" Text='<%# Bind("CodCella") %>' />
<table>
<tr>
<td>
X:
<asp:Label ID="XLabel" runat="server" Text='<%# Bind("X") %>' />
</td>
<td>
Y:
<asp:Label ID="YLabel" runat="server" Text='<%# Bind("Y") %>' />
</td>
<td>
Z:
<asp:Label ID="ZLabel" runat="server" Text='<%# Bind("Z") %>' />
</td>
</tr>
</table>
<br />
<asp:Button ID="btnUpdate" runat="server" Width="100px" CausesValidation="True" CommandName="Update"
Text="Update" />
&nbsp;
<asp:Button ID="btnCancel" runat="server" Width="100px" CausesValidation="True" CommandName="Cancel"
Text="Cancel" />
</EditItemTemplate>
<ItemTemplate>
UDC:
@@ -83,9 +137,6 @@
<asp:Label ID="EsponenteLabel" runat="server" Text='<%# Bind("Esponente") %>' />
Qta:
<asp:Label ID="QtaLabel" runat="server" Text='<%# Bind("Qta") %>' />
<br />
DescStato:
<asp:Label ID="DescStatoLabel" runat="server" Text='<%# Bind("DescStato") %>' />
<table>
<tr>
<td>
@@ -182,7 +233,13 @@
</asp:FormView>
</div>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByFullUdc" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter">
SelectMethod="getByFullUdc"
TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter"
onupdating="ods_Updating" UpdateMethod="getByFullUdc">
<UpdateParameters>
<asp:Parameter Name="UDC" Type="String" />
<asp:Parameter Name="CodCS" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:SessionParameter DefaultValue="U" Name="UDC" SessionField="UDC_sel" Type="String" />
<asp:SessionParameter DefaultValue="MM" Name="CodCS" SessionField="CodCS" Type="String" />
@@ -200,7 +257,7 @@
</tr>
<tr>
<td>
<asp:Button ID="btnRettifica" runat="server" Width="100px" />
<asp:Button ID="btnRettifica" runat="server" Width="100px" OnClick="btnRettifica_Click" />
</td>
<td>
<asp:Button ID="btnPreleva" runat="server" Width="100px" />
+139 -61
View File
@@ -11,6 +11,8 @@ namespace GMW_Term.WebUserControls
{
public partial class mod_execUdc : System.Web.UI.UserControl
{
#region variabili globali controllo
/// <summary>
/// codice company/sito in sessione
/// </summary>
@@ -35,6 +37,38 @@ namespace GMW_Term.WebUserControls
memLayer.ML.setSessionVal("UDC_sel", value);
}
}
/// <summary>
/// testo contenuto nella textbox
/// </summary>
public string txtScansione
{
get
{
return txtInput.Text.Trim();
}
set
{
txtInput.Text = value;
}
}
/// <summary>
/// valore della scansione barcode
/// </summary>
public string valoreScanUdc
{
get
{
return memLayer.ML.StringSessionObj("scannedValueUdc");
}
set
{
memLayer.ML.setSessionVal("scannedValueUdc", value, false);
}
}
#endregion
#region setup modulo
/// <summary>
/// caricamento pagina
@@ -98,9 +132,9 @@ namespace GMW_Term.WebUserControls
btnChiudi.Text = "[0] - Home";
btnChiudi.AccessKey = "0";
// buttons secondari
btnConferma.Text = "[5] - Conferma";
btnConferma.Text = "[5] - OK";
btnConferma.AccessKey = "5";
btnCellaPiena.Text = "[6] - Conf.+Cella Piena";
btnCellaPiena.Text = "[6] - OK+Piena";
btnCellaPiena.AccessKey = "6";
}
/// <summary>
@@ -112,17 +146,39 @@ namespace GMW_Term.WebUserControls
{
return user_std.UtSn.Traduci(lemma);
}
#endregion
#region metodi operativi interni
/// <summary>
/// click button deposito
/// effettua salvataggio, mostra cella updated, eventuale set piena della cella
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDeposita_Click(object sender, EventArgs e)
/// <param name="cellaPiena"></param>
private void depositaUdc(bool setCellaPiena)
{
// nasconde/mostra panels
pnlButtons.Visible = false;
pnlInput.Visible = true;
// cerco id della cella...
int idxCella = MagClass.magazzino.IdxCellaByCodCella(memLayer.ML.StringSessionObj("CodCS"), valoreScanUdc);
// salva le info facendo caricamento
MagClass.magazzino.caricaUDC(memLayer.ML.StringSessionObj("CodCS"), UDC, idxCella);
if (setCellaPiena)
{
MagClass.magazzino.taCelle.stp_celle_updPiena(idxCella, true);
}
// sistema visibilità
pnlButtons.Visible = true;
pnlInput.Visible = false;
btnConferma.Visible = false;
// aggiorna dati
frmView.DataBind();
// sistemo buttons
setupBtn();
}
#endregion
#region gestione input barcode
/// <summary>
/// inserito testo nella TextBox
/// </summary>
@@ -174,33 +230,45 @@ namespace GMW_Term.WebUserControls
}
#endregion
#region gestione interazione (buttons & update...)
/// <summary>
/// testo contenuto nella textbox
/// ritorna alla home
/// </summary>
public string txtScansione
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnChiudi_Click(object sender, EventArgs e)
{
get
{
return txtInput.Text.Trim();
}
set
{
txtInput.Text = value;
}
// svuoto da session l'UDC corrente... e pure il barcode corrente...
memLayer.ML.emptySessionVal("scannedValue");
//memLayer.ML.emptySessionVal("UDC_sel");
UDC = "";
memLayer.ML.emptySessionVal("activeTask");
Response.Redirect("Home.aspx");
}
/// <summary>
/// valore della scansione barcode
/// richiesta rettifica dati UDC: qta
/// </summary>
public string valoreScanUdc
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnRettifica_Click(object sender, EventArgs e)
{
get
{
return memLayer.ML.StringSessionObj("scannedValueUdc");
}
set
{
memLayer.ML.setSessionVal("scannedValueUdc", value, false);
}
frmView.ChangeMode(FormViewMode.Edit);
// nascondo i bottoni...
pnlButtons.Visible = false;
}
/// <summary>
/// click button deposito
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDeposita_Click(object sender, EventArgs e)
{
// nasconde/mostra panels
pnlButtons.Visible = false;
pnlInput.Visible = true;
}
/// <summary>
/// richiesto caricamento UDC
@@ -223,43 +291,53 @@ namespace GMW_Term.WebUserControls
depositaUdc(cellaPiena);
}
/// <summary>
/// effettua salvataggio, mostra cella updated, eventuale set piena della cella
/// </summary>
/// <param name="cellaPiena"></param>
private void depositaUdc(bool setCellaPiena)
{
// cerco id della cella...
int idxCella = MagClass.magazzino.IdxCellaByCodCella(memLayer.ML.StringSessionObj("CodCS"), valoreScanUdc);
// salva le info facendo caricamento
MagClass.magazzino.caricaUDC(memLayer.ML.StringSessionObj("CodCS"), UDC, idxCella);
if (setCellaPiena)
{
MagClass.magazzino.taCelle.stp_celle_updPiena(idxCella, true);
}
// sistema visibilità
pnlButtons.Visible = true;
pnlInput.Visible = false;
btnConferma.Visible = false;
// aggiorna dati
frmView.DataBind();
// sistemo buttons
setupBtn();
}
/// <summary>
/// ritorna alla home
/// eseguo alla chiusura della fase di update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnChiudi_Click(object sender, EventArgs e)
protected void frmView_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
// svuoto da session l'UDC corrente... e pure il barcode corrente...
memLayer.ML.emptySessionVal("scannedValue");
//memLayer.ML.emptySessionVal("UDC_sel");
UDC = "";
memLayer.ML.emptySessionVal("activeTask");
Response.Redirect("Home.aspx");
//fixBtnPostUpdateQta();
}
/// <summary>
/// mostra di nuovo buttons post fase di editing
/// </summary>
private void fixBtnPostUpdateQta()
{
// aggiorno frmView
frmView.DataBind();
// mostro di nuovo i buttons...
pnlButtons.Visible = true;
setupBtn();
}
/// <summary>
/// alla chiusura fase di editing
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void frmView_ModeChanged(object sender, EventArgs e)
{
// se sono in item mode mostro di nuovo i buttons...
if (frmView.CurrentMode == FormViewMode.ReadOnly)
{
fixBtnPostUpdateQta();
}
}
/// <summary>
/// evento on update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
// intercetto l'evento e chiamo una stored ad hoc!
MagClass.magazzino.taElencoCartellini.updateQty(UDC, MagClass.magazzino.CodSoggCurrUser, "U", "UDC_QTY", Convert.ToDecimal(e.InputParameters["Qta"]));
// annullo update!
e.Cancel = true;
}
#endregion
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
+15 -12
View File
@@ -242,7 +242,7 @@ namespace GMW_data
/// <returns>esito comando</returns>
public bool rettificaQtaUDC(string UDC, decimal qta)
{
string CodSoggetto = CodSoggCurrUser();
string CodSoggetto = CodSoggCurrUser;
bool answ = false;
try
{
@@ -338,19 +338,22 @@ namespace GMW_data
/// restituisce codice soggetto dell'user corrente
/// </summary>
/// <returns></returns>
public string CodSoggCurrUser()
public string CodSoggCurrUser
{
// ricavo da session...
string codSoggetto = "";
try
get
{
codSoggetto = DataProxy.obj.taSogg2Oper.getByUserDominio(user_std.UtSn.utente, user_std.UtSn.dominio)[0].CodSoggetto;
// ricavo da session...
string codSoggetto = "";
try
{
codSoggetto = DataProxy.obj.taSogg2Oper.getByUserDominio(user_std.UtSn.utente, user_std.UtSn.dominio)[0].CodSoggetto;
}
catch (Exception e)
{
logger.lg.scriviLog(string.Format("Non sono riuscito a recuperare il codice soggetto per l'utente loggato: {0}, errore {1}{2}", user_std.UtSn.userNameAD, Environment.NewLine, e), tipoLog.ERROR);
}
return codSoggetto;
}
catch (Exception e)
{
logger.lg.scriviLog(string.Format("Non sono riuscito a recuperare il codice soggetto per l'utente loggato: {0}, errore {1}{2}", user_std.UtSn.userNameAD, Environment.NewLine, e), tipoLog.ERROR);
}
return codSoggetto;
}
/// <summary>
/// restituisce l'IdxCella dato il CodCella
@@ -470,7 +473,7 @@ namespace GMW_data
string RagioneSociale = "";
// ricavo da session...
string codSoggetto = CodSoggCurrUser();
string codSoggetto = CodSoggCurrUser;
// proseguo SOLO se ho trovato cod soggetto...
if (codSoggetto != "")
{
+1 -1
View File
@@ -49,7 +49,7 @@ namespace GMW_data
{
try
{
utils.obj.taSTP.stp_UDC_delibera(CodTipoDelibera, UDC, MagClass.magazzino.CodSoggCurrUser());
utils.obj.taSTP.stp_UDC_delibera(CodTipoDelibera, UDC, MagClass.magazzino.CodSoggCurrUser);
}
catch (Exception e)
{
Binary file not shown.
Binary file not shown.
Binary file not shown.