149 lines
4.1 KiB
C#
149 lines
4.1 KiB
C#
using MagData;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace MP_MAG.WebUserControls
|
|
{
|
|
public partial class cmp_OrderList : BaseUserControl
|
|
{
|
|
#region Public Properties
|
|
|
|
public bool EnableEdit
|
|
{
|
|
get
|
|
{
|
|
bool answ = false;
|
|
bool.TryParse(hfEnableEdit.Value, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
hfEnableEdit.Value = $"{value}";
|
|
}
|
|
}
|
|
|
|
public int PackListID
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfPackListID.Value, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
hfPackListID.Value = $"{value}";
|
|
cmp_OrderListAdd.PackListID = value;
|
|
doUpdate();
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e)
|
|
{
|
|
grView.PageSize = cmp_numRow.numRow;
|
|
}
|
|
|
|
private void Cmp_OrderListAdd_eh_addNew(object sender, EventArgs e)
|
|
{
|
|
resetSelezione();
|
|
}
|
|
|
|
private void resetSelezione()
|
|
{
|
|
grView.SelectedIndex = -1;
|
|
grView.DataBind();
|
|
cmp_OrderListAdd.Visible = false;
|
|
raiseReset();
|
|
}
|
|
|
|
#endregion Private Methods
|
|
|
|
#region Protected Methods
|
|
|
|
/// <summary>
|
|
/// comando ADD
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtAddNew_Click(object sender, EventArgs e)
|
|
{
|
|
// mostro area add new
|
|
cmp_OrderListAdd.Visible = !cmp_OrderListAdd.Visible;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Avvia stampa report pedana
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtPrintReport_Click(object sender, EventArgs e)
|
|
{
|
|
// lancio il report x l'elenco pedane CARICATE
|
|
MagDataLayerObj.taPJQ.insertQuery($"{tipoDocumento.docPackList}", $"{PackListID}", ddlPost.SelectedValue);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Avvia stampa report COMPLETO richieste
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtPrintReportFull_Click(object sender, EventArgs e)
|
|
{
|
|
// lancio il report x l'elenco COMPLETO con dettaglio con/senza pedane + contenuto
|
|
MagDataLayerObj.taPJQ.insertQuery($"{tipoDocumento.docPackListFull}", $"{PackListID}", ddlPost.SelectedValue);
|
|
}
|
|
|
|
/// <summary>
|
|
/// comando reset
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtReset_Click(object sender, EventArgs e)
|
|
{
|
|
resetSelezione();
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
cmp_OrderListAdd.Visible = false;
|
|
lbtPrintReport.DataBind();
|
|
grView.PageSize = cmp_numRow.numRow;
|
|
lbtPrintReport.DataBind();
|
|
lbtPrintReportFull.DataBind();
|
|
}
|
|
cmp_OrderListAdd.eh_addNew += Cmp_OrderListAdd_eh_addNew;
|
|
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Public Methods
|
|
|
|
public void doUpdate()
|
|
{
|
|
// calcolo il codcliente
|
|
var tabPackList = MagDataLayer.man.taPList.getByKey(PackListID);
|
|
if (tabPackList != null)
|
|
{
|
|
if (tabPackList.Count > 0)
|
|
{
|
|
cmp_OrderListAdd.CodCliente = tabPackList[0].CodCliente;
|
|
}
|
|
}
|
|
cmp_OrderListAdd.Visible = false;
|
|
grView.DataBind();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |