Fix procedura duplicazione progetti
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettaglioProgetto.ascx.cs" Inherits="GPW_Admin.WebUserControls.mod_dettaglioProgetto" %>
|
||||
|
||||
<asp:FormView ID="fmView" runat="server" DataSourceID="ods" Width="100%">
|
||||
<ItemTemplate>
|
||||
<div class="card border border-info">
|
||||
<div class="card-header bg-info text-light">
|
||||
<h5>Resoconto progetto</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card border border-info">
|
||||
<div class="card-header bg-info text-light">
|
||||
<h5>Resoconto progetto</h5>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<asp:FormView ID="fmView" runat="server" DataSourceID="ods" Width="100%">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
<div class="col-6 text-left">
|
||||
<div class="text-secondary">
|
||||
@@ -91,16 +91,32 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:FormView>
|
||||
</div>
|
||||
<div class="card-footer p-1">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
Nome
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<asp:LinkButton runat="server" ID="btnDuplica" CssClass="btn btn-block btn-primary" OnClick="btnDuplica_Click" ToolTip="Duplica struttura progetto e budget fasi"><i class="fa fa-clone" aria-hidden="true"></i> Duplica</asp:LinkButton>
|
||||
<div>
|
||||
<asp:TextBox runat="server" ID="txtNewProjName"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:FormView>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
Sost. anno in fasi
|
||||
</div>
|
||||
<div>
|
||||
<asp:CheckBox runat="server" ID="chkSostAnno" Checked="true"></asp:CheckBox>
|
||||
</div>
|
||||
</div>
|
||||
<asp:LinkButton runat="server" ID="btnDuplica" CssClass="btn btn-block btn-primary" OnClick="btnDuplica_Click" ToolTip="Duplica struttura progetto e budget fasi"><i class="fa fa-clone" aria-hidden="true"></i> Duplica</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_statsProjTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfIdxProgetto" DefaultValue="0" Name="idxProgetto" PropertyName="Value" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfIdxProgetto" />
|
||||
<asp:HiddenField runat="server" ID="hfIdxProgetto" />
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
//memLayer.ML.IntSessionObj("idxProgetto_sel")
|
||||
int answ = 0;
|
||||
int.TryParse(hfIdxProgetto.Value, out answ);
|
||||
return answ;
|
||||
@@ -33,7 +32,15 @@ namespace GPW_Admin.WebUserControls
|
||||
set
|
||||
{
|
||||
hfIdxProgetto.Value = $"{value}";
|
||||
|
||||
// salvo nuovo nome progetto...
|
||||
int answ = 0;
|
||||
int.TryParse($"{value}", out answ);
|
||||
var tabProj = DataProxy.DP.taAP.getByIdxPrj(answ);
|
||||
if (tabProj != null && tabProj.Rows.Count > 0)
|
||||
{
|
||||
int anno = DateTime.Today.Year;
|
||||
txtNewProjName.Text = tabProj[0].nomeProj.Replace($"{anno - 1}", $"{anno }");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +55,8 @@ namespace GPW_Admin.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnDuplica_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
DataProxy.DP.taAP.duplicateProj(IdxProgetto);
|
||||
// chiamo duplicazione
|
||||
DataProxy.DP.taAP.duplicateProj(IdxProgetto, txtNewProjName.Text, chkSostAnno.Checked);
|
||||
// rileggo...
|
||||
Response.Redirect("progetti");
|
||||
}
|
||||
|
||||
@@ -23,6 +23,33 @@ namespace GPW_Admin.WebUserControls
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.FormView fmView;
|
||||
|
||||
/// <summary>
|
||||
/// txtNewProjName 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 txtNewProjName;
|
||||
|
||||
/// <summary>
|
||||
/// chkSostAnno 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.CheckBox chkSostAnno;
|
||||
|
||||
/// <summary>
|
||||
/// btnDuplica 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.LinkButton btnDuplica;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user