Files
GPW/GPW_Commesse/WebUserControls/mod_commAttivitaDesk.ascx
T
2021-01-11 17:43:12 +01:00

243 lines
16 KiB
Plaintext

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commAttivitaDesk.ascx.cs" Inherits="GPW_Commesse.WebUserControls.mod_commAttivitaDesk" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="mod_dateTime.ascx" TagName="mod_dateTime" TagPrefix="uc1" %>
<%@ Register Src="mod_autocomplete.ascx" TagPrefix="uc2" TagName="mod_autocomplete" %>
<asp:Panel runat="server" ID="pnlHeader" class="row bg-success text-light text-center py-1">
<div class="col-4">
<asp:DropDownList runat="server" ID="ddlGruppo" DataSourceID="odsGruppi" DataTextField="label" AutoPostBack="true" OnSelectedIndexChanged="ddlGruppo_SelectedIndexChanged" DataValueField="value" CssClass="btn btn-secondary btn-sm btn-block" />
<asp:ObjectDataSource runat="server" ID="odsGruppi" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="GPW_data.DS_UtilityTableAdapters.v_selGruppiTableAdapter"></asp:ObjectDataSource>
</div>
<div class="col-4">
<asp:Label runat="server" ID="lblSubtitle" CssClass="font-weight-bold textBig"><%: valoreDateTime.ToString("dddd dd") %></asp:Label>
<br />
<asp:Label runat="server" ID="lblTitle"><%: valoreDateTime.ToString("MMMM yyyy") %></asp:Label>
</div>
<div class="col-4">
<asp:LinkButton runat="server" ID="lnkNew" CausesValidation="False" ToolTip='<%# traduci("AddNew") %>' OnClick="lnkNew_Click" CssClass="btn btn-sm btn-block btn-warning"><i class="fa fa-plus" aria-hidden="true"></i></asp:LinkButton>
</div>
</asp:Panel>
<div class="row">
<div class="col-12">
<asp:GridView ID="grView" runat="server" DataSourceID="odsRA" AutoGenerateColumns="False" OnRowDeleted="grView_RowDeleted"
OnRowCommand="grView_RowCommand" DataKeyNames="idxRA" OnRowDataBound="grView_RowDataBound" OnRowEditing="grView_RowEditing"
ShowHeader="false" Width="100%" OnRowUpdated="grView_RowUpdated" CssClass="table table-sm table-striped table-borderless" OnRowCancelingEdit="grView_RowCancelingEdit">
<EditRowStyle CssClass="bg-primary" />
<FooterStyle CssClass="bg-warning" />
<RowStyle CssClass="text-light" />
<EmptyDataTemplate>
<div style="background-color: #ACACAC;">
Nessun record COMMESSA
</div>
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lnkClona" CausesValidation="False" CommandArgument='<%# Eval("idxRA") %>' CommandName="Update" ToolTip='<%# traduci("Duplica") %>' Visible='<%# enableFull %>' OnClick="lnkClona_Click" CssClass="btn btn-sm btn-primary"><i class="fa fa-magic fa-2x" aria-hidden="true"></i></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
<FooterTemplate>
</FooterTemplate>
<HeaderTemplate>
</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Record Commesse">
<ItemTemplate>
<asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>' CssClass="noLink" Enabled='<%# enableFull %>'>
<div class="row mx-0">
<div class="col-9 text-left">
<div class="text-dark">
<b><%# Eval("RagSociale") %></b> | <span style="fon=0.8em;"><%# Eval("nomeProj") %></span>
</div>
<div class="font-weight-bold text-success">
<%# Eval("nomeFase") %>
</div>
</div>
<div class="col-3 text-right text-nowrap px-1 py-0">
<div class="col-12 border border-dark badge badge-pill badge-light">
<%# Eval("inizio","{0:HH:mm}") %> - <%# Eval("fine","{0:HH:mm}") %>
</div>
<div class="col-12 text-dark px-1 py-0">
<span style="font: 1.2em;"><b><%# formatDurata(Eval("oreTot")) %></b></span> h
</div>
</div>
</div>
<div class="row mx-0">
<div class="col-12">
<div class="text-secondary textCondens">
<%# Eval("descrizione").ToString().Replace(Environment.NewLine,"<br />").Replace("\n","<br />") %>
</div>
</div>
</div>
</asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<div class="row text-light">
<div class="col-12 text-left">
</div>
<div class="col-8 text-left">
<div>
<label for="ddlProgetto" style="font-size: x-small;">
Progetto
</label>
<asp:DropDownList ID="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value" AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" CssClass="btn btn-dark btn-sm btn-block">
</asp:DropDownList>
</div>
<div class="my-1">
<label for="ddlFase" style="font-size: x-small;">
Fase
</label>
<asp:DropDownList ID="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value" OnDataBound="ddlFase_DataBound" CssClass="btn btn-light btn-sm btn-block">
</asp:DropDownList>
</div>
</div>
<div class="col-4 text-right">
<label for="txtSearchFase" style="font-size: x-small;">
<-- Search</label>
<br />
<asp:TextBox runat="server" ID="txtSearchFase" AutoPostBack="true" Width="100%" Font-Size="8pt" OnTextChanged="txtSearchFase_TextChanged" TextMode="MultiLine" />
</div>
</div>
<div class="row text-light my-2">
<div class="col-12">
Periodo
</div>
<div class="col-6 text-left">
<uc1:mod_dateTime ID="dtInizio" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
</div>
<div class="col-6 text-right">
<uc1:mod_dateTime ID="dtFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
</div>
</div>
<div class="row text-light my-2">
<div class="col-12">
<label for="txtDescrizione" style="font-size: x-small;">
descrizione
</label>
<asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="6em" Width="100%" />
</div>
</div>
<div class="row my-2">
<div class="col-6 text-center">
<asp:Button runat="server" ID="btnInsert" Text="Aggiorna" CssClass="btn btn-success btn-block ui-corner-all shadowBox btnNew" CommandName="Update"
CausesValidation="true" />
</div>
<div class="col-6 text-center">
<asp:Button runat="server" ID="btnInsertCancel" Text="Annulla" CssClass="btn btn-danger btn-block ui-corner-all shadowBox btnChiudi" CommandName="Cancel" />
</div>
</div>
</EditItemTemplate>
<FooterTemplate>
<div class="row text-light">
<div class="col-8 text-left">
<div>
<label for="ddlProgetto" style="font-size: x-small;">
Progetto
</label>
<asp:DropDownList ID="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value"
AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" Font-Size="8pt" Width="100%" CssClass="btn btn-dark">
</asp:DropDownList>
</div>
<div class="my-1">
<label for="ddlFase" style="font-size: x-small;">
Fase
</label>
<asp:DropDownList ID="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value" Font-Size="8pt"
OnDataBound="ddlFase_DataBound" Width="100%" CssClass="btn btn-light">
</asp:DropDownList>
</div>
</div>
<div class="col-4 text-right">
<label for="txtSearchFase" style="font-size: x-small;">
<-- Search</label>
<br />
<asp:TextBox runat="server" ID="txtSearchFase" AutoPostBack="true" Width="100%" Font-Size="8pt" OnTextChanged="txtSearchFase_TextChanged" TextMode="MultiLine" />
</div>
</div>
<div class="row text-light my-2">
<div class="col-12">
Periodo
</div>
<div class="col-6 text-left">
<uc1:mod_dateTime ID="dtInizio" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
</div>
<div class="col-6 text-right">
<uc1:mod_dateTime ID="dtFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
</div>
</div>
<div class="row text-light my-2">
<div class="col-12">
<label for="txtDescrizione" style="font-size: x-small;">
descrizione
</label>
<asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="6em" Width="100%" />
</div>
</div>
<div class="row my-2">
<div class="col-6 text-center">
<asp:Button runat="server" ID="btnInsert" Text="Salva" CssClass="btn btn-success btn-block ui-corner-all shadowBox btnNew" CommandName="Insert"
CausesValidation="true" />
</div>
<div class="col-6 text-center">
<asp:Button runat="server" ID="btnInsertCancel" Text="Annulla" CssClass="btn btn-danger btn-block ui-corner-all shadowBox btnChiudi" CommandName="Cancel" />
</div>
</div>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lnkDelete" CausesValidation="False" CommandArgument='<%# Eval("idxRA") %>' CommandName="Delete" ToolTip='<%# traduci("Delete") %>' Visible='<%# enableFull %>' CssClass="btn btn-sm btn-danger"><i class="fa fa-trash fa-2x" aria-hidden="true"></i></asp:LinkButton><asp:ConfirmButtonExtender ID="cbeLnk" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="lnkDelete"></asp:ConfirmButtonExtender>
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsRA" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.regAttDayExplTableAdapter"
DeleteMethod="deleteQuery" InsertMethod="insertQuery" OnInserted="odsRA_Inserted" UpdateMethod="updateQuery" OnUpdating="odsRA_Updating">
<DeleteParameters>
<asp:Parameter Name="Original_idxRA" Type="Int32" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter Name="idxDipendente" SessionField="idxDipCurr" Type="Int32" />
<asp:SessionParameter Name="dataRif" SessionField="dataRif" Type="DateTime" />
</SelectParameters>
<InsertParameters>
<asp:SessionParameter DefaultValue="0" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
<asp:Parameter Name="idxFase" Type="Int32" />
<asp:Parameter Name="inizio" Type="DateTime" />
<asp:Parameter Name="fine" Type="DateTime" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="importo" Type="Decimal" DefaultValue="0" />
</InsertParameters>
<UpdateParameters>
<asp:SessionParameter DefaultValue="0" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
<asp:Parameter Name="idxFase" Type="Int32" />
<asp:Parameter Name="inizio" Type="DateTime" />
<asp:Parameter Name="fine" Type="DateTime" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="importo" Type="Decimal" DefaultValue="0" />
<asp:Parameter Name="Original_idxRA" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsProgetto" runat="server" SelectMethod="getByGruppo" TypeName="GPW_data.DS_UtilityTableAdapters.v_selProgettiTableAdapter">
<SelectParameters>
<asp:SessionParameter SessionField="gruppoSel" DefaultValue="" Name="gruppo" Type="String" />
<%--<asp:ControlParameter ControlID="ddlGruppo" DefaultValue="" Name="gruppo" Type="String" />--%>
<asp:Parameter DefaultValue="true" Name="soloAttivi" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsFase" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio"
TypeName="GPW_data.DS_UtilityTableAdapters.v_selFasiOptTableAdapter">
<SelectParameters>
<asp:SessionParameter SessionField="idxProjSel" DefaultValue="0" Name="conditio" Type="Int32" />
<asp:Parameter DefaultValue="false" Name="soloAttivi" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>