72 lines
1.8 KiB
C#
72 lines
1.8 KiB
C#
using System;
|
|
|
|
namespace MP_MAG.WebUserControls
|
|
{
|
|
public partial class cmp_destClienti : BaseUserControl
|
|
{
|
|
#region Public Properties
|
|
|
|
public string codCli
|
|
{
|
|
get
|
|
{
|
|
return hfCodCli.Value;
|
|
}
|
|
set
|
|
{
|
|
hfCodCli.Value = value;
|
|
grView.DataBind();
|
|
grView.SelectedIndex = -1;
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Methods
|
|
|
|
/// <summary>
|
|
/// Aggiunta nuovo record
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtAddNew_Click(object sender, EventArgs e)
|
|
{
|
|
// cerco il num di cli esistenti e usi + 1...
|
|
var destCli = MagDataLayerObj.taADC.getByCodCli(codCli);
|
|
string newCodDest = "__CodDestNew";
|
|
if (destCli != null)
|
|
{
|
|
newCodDest = $"D{destCli.Count + 1:0000}";
|
|
}
|
|
MagDataLayerObj.taADC.insertQuery(codCli, newCodDest, "Nuova Destinazione", "Nuovo Indirizzo", "00000", "Nuova Località", "BA", "IT");
|
|
doReset();
|
|
}
|
|
|
|
/// <summary>
|
|
/// comando reset
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtReset_Click(object sender, EventArgs e)
|
|
{
|
|
doReset();
|
|
raiseReset();
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Public Methods
|
|
|
|
public void doReset()
|
|
{
|
|
grView.SelectedIndex = -1;
|
|
grView.DataBind();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |