controlla matrOp x impegni e lo salva

storico GIAN è ok
This commit is contained in:
Samuele E. Locatelli
2016-02-01 12:42:05 +01:00
parent 039a52bd2c
commit e1297f53ed
27 changed files with 157 additions and 21 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,5 +13,9 @@ namespace WebSCR.WebUserControls
{
}
public void doUpdate()
{
grView.DataBind();
}
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<div class="ui-field-contain" style="visibility: <%: isVisible %>; height: <%: visHeight %>;">
<div data-role="controlgroup" data-type="horizontal" data-mini="true" style="font-size: 0.9em; width: 90%;">
<asp:DropDownList runat="server" ID="ddlTipoCons" DataSourceID="odsTipoCons" DataTextField="DescrConsegna" DataValueField="CodConsegna"></asp:DropDownList>
<asp:LinkButton ID="lbAdd" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Aggiungi" OnClick="lbAdd_Click" />
<asp:LinkButton ID="lbAdd" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Aggiungi" OnClick="lbAdd_Click" Visible='<%# hasMatricola %>' />
</div>
</div>
<asp:ObjectDataSource runat="server" ID="odsTipoCons" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.AnagTipoConsegneTableAdapter" />
+28 -1
View File
@@ -94,6 +94,7 @@ namespace WebSCR.WebUserControls
protected void Page_Load(object sender, EventArgs e)
{
lblWarning.Visible = false;
lbAdd.DataBind();
}
/// <summary>
/// aggiunge il task corrente all'elenco dei task...
@@ -120,7 +121,33 @@ namespace WebSCR.WebUserControls
lblWarning.Text = string.Format("Attenzione: impossibile inserire, tempo complessivo diventerebbe inferiore a soglia minima ({0} min)!", minTempoInt);
}
}
/// <summary>
/// verifica se ci sia matricola in sessione
/// </summary>
public bool hasMatricola
{
get
{
return matrOp != "";
}
}
/// <summary>
/// matricola OP (x utente)
/// </summary>
public string matrOp
{
get
{
string answ = "";
try
{
answ = memLayer.ML.StringSessionObj("matrOp");
}
catch
{ }
return answ;
}
}
protected int minTempoInt
{
get
@@ -17,6 +17,11 @@ namespace WebSCR.WebUserControls
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
doUpdate();
}
public void doUpdate()
{
// leggo impegno
int IdxImpegno = 0;
@@ -31,7 +36,7 @@ namespace WebSCR.WebUserControls
if (IdxImpegno > 0)
{
// cerco DOC...
DS_Applicazione.ImpegniRow riga =DtProxy.man.taImp.getByKey(IdxImpegno)[0];
DS_Applicazione.ImpegniRow riga = DtProxy.man.taImp.getByKey(IdxImpegno)[0];
// se c'è documento...
if (riga.RifOC != "")
{
@@ -35,6 +35,11 @@ namespace WebSCR.WebUserControls
divNewEdit.Visible = isWriteEnabled;
btnAdd.DataBind();
}
public void doUpdate()
{
grView.DataBind();
}
protected void Upload(object sender, EventArgs e)
{
string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);
@@ -86,6 +86,12 @@ namespace WebSCR.WebUserControls
}
catch
{ }
// 2016.02.01 modifica se trovo OC0 --> OC0000000
if (answ == "OC0" || answ == "OC00" || answ == "OC000")
{
answ = "OC0000000";
txtCerca.Text = answ;
}
return answ;
}
set
@@ -129,7 +135,7 @@ namespace WebSCR.WebUserControls
memLayer.ML.emptySessionVal("currDoc");
}
}
catch
catch(Exception exc)
{ }
}
else
+5 -4
View File
@@ -11,14 +11,15 @@
<asp:DropDownList runat="server" ID="ddlSquadra" DataSourceID="odsSquadre" DataTextField="DescrSquadra" DataValueField="CodSquadra" SelectedValue='<%# Bind("CodSquadra") %>'></asp:DropDownList>
</div>
<div class="ui-block-b" style="text-align: right;">
<div class="ui-grid-a">
<%--<div class="ui-grid-a">
<div class="ui-block-a">
<asp:TextBox runat="server" ID="lblDataFrom" type="date" Text='<%# Eval("DataOra","{0:yyyy-MM-dd}") %>' Enabled="false" />
</div>
<div class="ui-block-b">
<asp:DropDownList runat="server" ID="ddlOrario" DataSourceID="odsOrario" DataTextField="Orario" DataValueField="Orario" SelectedValue='<%# Eval("DataOra","{0:HH:mm:00}") %>' Enabled="false"></asp:DropDownList>
</div>
</div>
</div>--%>
<uc1:mod_selDataOra runat="server" ID="mod_selDataOra1" dataOraSel='<%# Bind("DataOra") %>' />
</div>
<div class="ui-block-c text-center">
<%--<label for="lblOrarioCom">ORARIO COMUNICATO</label>--%>
@@ -258,8 +259,8 @@
</div>
</div>
<div style="text-align: center; margin: auto;">
<asp:LinkButton ID="lbEdit" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-edit ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="edit" CommandName="Edit" Text="Modifica" Width="20em" Visible='<%# !disableEdit %>' />
<asp:LinkButton ID="lbDelete" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-delete ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="delete" CommandName="Delete" Text="ELIMINA" Width="20em" Visible='<%# !disableEdit %>' OnClientClick="return confirm('Sei sicuro di voler eliminare il record?')" />
<asp:LinkButton ID="lbEdit" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-edit ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="edit" CommandName="Edit" Text="Modifica" Width="20em" Visible='<%# !disableEdit && hasMatricola %>' />
<asp:LinkButton ID="lbDelete" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-delete ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="delete" CommandName="Delete" Text="ELIMINA" Width="20em" Visible='<%# !disableEdit && hasMatricola %>' OnClientClick="return confirm('Sei sicuro di voler eliminare il record?')" />
</div>
</ItemTemplate>
</asp:FormView>
@@ -25,6 +25,20 @@ namespace WebSCR.WebUserControls
eh_errUpd(this, new EventArgs());
}
}
/// <summary>
/// evento update
/// </summary>
public event EventHandler eh_Upd;
/// <summary>
/// sollevo evento selezione /deselezione
/// </summary>
protected void raiseEventUpd()
{
if (eh_Upd != null)
{
eh_Upd(this, new EventArgs());
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
@@ -37,6 +51,33 @@ namespace WebSCR.WebUserControls
/// </summary>
public bool disableEdit { get; set; }
/// <summary>
/// verifica se ci sia matricola in sessione
/// </summary>
public bool hasMatricola
{
get
{
return matrOp != "";
}
}
/// <summary>
/// matricola OP (x utente)
/// </summary>
public string matrOp
{
get
{
string answ = "";
try
{
answ = memLayer.ML.StringSessionObj("matrOp");
}
catch
{ }
return answ;
}
}
/// <summary>
/// impegno corrente
/// </summary>
public int idxImpegno
@@ -86,6 +127,10 @@ namespace WebSCR.WebUserControls
{
e.InputParameters["NoteGen"] = "";
}
if (e.InputParameters["MatrOp"] == null)
{
e.InputParameters["MatrOp"] = matrOp;
}
}
protected void odsImpegni_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
@@ -36,6 +36,15 @@ namespace WebSCR.WebUserControls
mod_filtroPeriodo.eh_selData += mod_filtroPeriodo_eh_selData;
mod_dettInt.eh_update += mod_dettInt_eh_update;
mod_impegno.eh_errUpd += Mod_impegno_eh_errUpd;
mod_impegno.eh_Upd += Mod_impegno_eh_Upd;
}
private void Mod_impegno_eh_Upd(object sender, EventArgs e)
{
// aggiorno visualizzazione dett a dx
mod_compSquadra.doUpdate();
mod_fileImpegno.doUpdate();
mod_fileUpload.doUpdate();
}
private void Mod_impegno_eh_errUpd(object sender, EventArgs e)
@@ -471,12 +480,14 @@ namespace WebSCR.WebUserControls
memLayer.ML.setSessionVal("matrOp", txtMatrOp.Text.Trim());
errorMess = "Selezionato Operatore";
lblWarning.Text = errorMess;
mod_giornata.doUpdate();
}
else
{
memLayer.ML.emptySessionVal("matrOp");
lblWarning.Text = "";
}
mod_giornata.doUpdate();
mod_impegno.doUpdate();
}
protected override void OnUnload(EventArgs e)
Binary file not shown.
Binary file not shown.
Binary file not shown.
+37 -7
View File
@@ -13659,6 +13659,8 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PianoCons", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserMod", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IntAperto", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOp", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataOra", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataOraComFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DataOraComTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[10] = new global::System.Data.SqlClient.SqlCommand();
@@ -13990,7 +13992,23 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int updateQuery(global::System.Nullable<int> Original_IdxImpegno, string TipoOrario, string CodSquadra, string RifOC, string NoteGen, string UrlDoc, global::System.Nullable<int> NumOp, global::System.Nullable<int> RitUsato, global::System.Nullable<int> Ascensore, global::System.Nullable<int> PianoCons, string UserMod, global::System.Nullable<bool> IntAperto, global::System.Nullable<global::System.DateTime> DataOraComFrom, global::System.Nullable<global::System.DateTime> DataOraComTo) {
public virtual int updateQuery(
global::System.Nullable<int> Original_IdxImpegno,
string TipoOrario,
string CodSquadra,
string RifOC,
string NoteGen,
string UrlDoc,
global::System.Nullable<int> NumOp,
global::System.Nullable<int> RitUsato,
global::System.Nullable<int> Ascensore,
global::System.Nullable<int> PianoCons,
string UserMod,
global::System.Nullable<bool> IntAperto,
string MatrOp,
global::System.Nullable<global::System.DateTime> DataOra,
global::System.Nullable<global::System.DateTime> DataOraComFrom,
global::System.Nullable<global::System.DateTime> DataOraComTo) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[9];
if ((Original_IdxImpegno.HasValue == true)) {
command.Parameters[1].Value = ((int)(Original_IdxImpegno.Value));
@@ -14064,18 +14082,30 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
else {
command.Parameters[12].Value = global::System.DBNull.Value;
}
if ((DataOraComFrom.HasValue == true)) {
command.Parameters[13].Value = ((System.DateTime)(DataOraComFrom.Value));
}
else {
if ((MatrOp == null)) {
command.Parameters[13].Value = global::System.DBNull.Value;
}
if ((DataOraComTo.HasValue == true)) {
command.Parameters[14].Value = ((System.DateTime)(DataOraComTo.Value));
else {
command.Parameters[13].Value = ((string)(MatrOp));
}
if ((DataOra.HasValue == true)) {
command.Parameters[14].Value = ((System.DateTime)(DataOra.Value));
}
else {
command.Parameters[14].Value = global::System.DBNull.Value;
}
if ((DataOraComFrom.HasValue == true)) {
command.Parameters[15].Value = ((System.DateTime)(DataOraComFrom.Value));
}
else {
command.Parameters[15].Value = global::System.DBNull.Value;
}
if ((DataOraComTo.HasValue == true)) {
command.Parameters[16].Value = ((System.DateTime)(DataOraComTo.Value));
}
else {
command.Parameters[16].Value = global::System.DBNull.Value;
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
+2
View File
@@ -735,6 +735,8 @@ FROM v_elencoImpegni</CommandText>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@PianoCons" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@UserMod" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="bit" DbType="Boolean" Direction="Input" ParameterName="@IntAperto" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@MatrOp" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DataOra" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DataOraComFrom" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DataOraComTo" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
+5 -5
View File
@@ -4,24 +4,24 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="65" ViewPortY="253" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="159" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:AnagSquadre" ZOrder="13" X="579" Y="415" Height="305" Width="261" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
<Shape ID="DesignTable:AnagZone" ZOrder="19" X="556" Y="160" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:AnagTipoConsegne" ZOrder="18" X="919" Y="164" Height="286" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:AnagClienti" ZOrder="14" X="330" Y="139" Height="362" Width="212" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:Impegni" ZOrder="4" X="13" Y="159" Height="609" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="349" />
<Shape ID="DesignTable:Impegni" ZOrder="1" X="13" Y="159" Height="609" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="349" />
<Shape ID="DesignTable:DispImpTot" ZOrder="16" X="890" Y="469" Height="172" Width="293" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:DispImpSquadre" ZOrder="17" X="931" Y="666" Height="153" Width="241" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:v_ImpegniCal" ZOrder="3" X="1245" Y="871" Height="210" Width="222" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
<Shape ID="DesignTable:v_ImpegniCal" ZOrder="4" X="1245" Y="871" Height="210" Width="222" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
<Shape ID="DesignTable:Disponibilita" ZOrder="12" X="707" Y="839" Height="248" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:DettImpegno" ZOrder="6" X="14" Y="773" Height="362" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:v_clientiZone" ZOrder="2" X="1034" Y="858" Height="229" Width="186" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:v_clientiZone" ZOrder="3" X="1034" Y="858" Height="229" Width="186" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:DB2_DOCS" ZOrder="11" X="1244" Y="171" Height="516" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="408" />
<Shape ID="DesignTable:AssegnSquadre" ZOrder="9" X="333" Y="730" Height="191" Width="276" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:Dipendenti" ZOrder="8" X="339" Y="514" Height="153" Width="209" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:v_resImp" ZOrder="5" X="1216" Y="700" Height="134" Width="196" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:AssegnSlotSquadreDip" ZOrder="1" X="343" Y="931" Height="286" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:AssegnSlotSquadreDip" ZOrder="2" X="343" Y="931" Height="286" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_Disponibilita_AnagSquadre" ZOrder="15" LineWidth="11">
Binary file not shown.
Binary file not shown.
Binary file not shown.