* Web.csproj:
* jquery-latest.js: * IITContent.cs: * ITContent.csproj: * YavscModel.csproj: * Write.aspx: * jquery.tablesorter.min.js: * AssemblyInfo.cs: * NewEstimateEvenArgs.cs: * jquery.metadata.js: ajax call Write * jquery.tablesorter.js: Estimate table sorting * Catalog.cs: Find a product by reference * NpgsqlContentProvider.cs: Npgsql provider could not get the Postgresql data type "money" * Yavsc.sln: Removing an empty project * MyClass.cs: implements IModule * fortune.csproj: uses Configuration * FrontOfficeApiController.cs: Url: GetEstimate/5 * WorkFlowController.cs: debugging ajax call * RemoveUserQuery.aspx: no more "head" place holder * Estimate.aspx: Ajax call to add a line to estimates * Web.config: using the "Deploy" target * IModule.cs: Install & uninstall using a System.Data.IDbConnection * IContentProvider.cs: refactoring * WorkFlowManager.cs: an event at creating an estimate (NewOrder) * Writting.cs: ProductReference is a string
This commit is contained in:
parent
886bb31882
commit
f157c6edb9
25 changed files with 1569 additions and 167 deletions
|
|
@ -1,10 +1,11 @@
|
|||
<%@ Page Title="Devis" Language="C#" Inherits="System.Web.Mvc.ViewPage<Estimate>" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<script type="text/javascript" src="/js/jquery-latest.js"></script>
|
||||
<script type="text/javascript" src="/js/jquery.tablesorter.js"></script>
|
||||
<%= Html.ValidationSummary("Devis") %>
|
||||
<% using (Html.BeginForm("Estimate","FrontOffice")) { %>
|
||||
<%= Html.LabelFor(model => model.Title) %>:<br/>
|
||||
<%= Html.TextBox( "Title" ) %>
|
||||
<%= Html.LabelFor(model => model.Title) %>:<%= Html.TextBox( "Title" ) %>
|
||||
<%= Html.ValidationMessage("Title", "*") %>
|
||||
<% if (Model.Id > 0) { %>
|
||||
<br/>
|
||||
|
|
@ -16,27 +17,129 @@
|
|||
<%= Html.LabelFor(model => model.Id) %>:<%=Model.Id%>
|
||||
<%= Html.Hidden( "Id" ) %>
|
||||
<br/>
|
||||
|
||||
<% if (Model.Lines ==null || Model.Lines.Length == 0) { %>
|
||||
<i>Pas de ligne.</i>
|
||||
<%
|
||||
} else { %>
|
||||
<ul>
|
||||
<% foreach (Writting wr in Model.Lines) { %>
|
||||
<li><%=wr.Count%>/<%=wr.Id%>/<%=wr.ProductReference%>/<%=wr.UnitaryCost%>/<%=wr.Description%></li>
|
||||
<% } %>
|
||||
</ul>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if (Model.Id==0) { %>
|
||||
<input type="submit" name="submit" value="Create"/>
|
||||
<% } else { %>
|
||||
<input type="submit" name="submit" value="Update"/>
|
||||
<% }
|
||||
%>
|
||||
|
||||
<script type="text/javascript" >
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<% } %>
|
||||
<% if (Model.Lines ==null || Model.Lines.Length == 0) { %>
|
||||
<i>Pas de ligne.</i>
|
||||
<%
|
||||
} else { %>
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Description</th>
|
||||
<th>Product Reference</th>
|
||||
<th>Count</th>
|
||||
<th>Unitary Cost</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="wrts">
|
||||
<% foreach (Writting wr in Model.Lines) { %>
|
||||
<tr>
|
||||
<td><%=wr.Id%></td>
|
||||
<td><%=wr.Description%></td>
|
||||
<td><%=wr.ProductReference%></td>
|
||||
<td><%=wr.Count%></td>
|
||||
<td><%=wr.UnitaryCost%></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<% } %>
|
||||
|
||||
<% } %>
|
||||
|
||||
<% } %>
|
||||
|
||||
<script type="text/javascript" >
|
||||
function ShowHideBtn(btn,id)
|
||||
{
|
||||
var shdiv = document.getElementById(id);
|
||||
var wanit = shdiv.style.display == "none"; // switch button
|
||||
shdiv.style.display = wanit ? "block" : "none";
|
||||
btn.value = wanit ? "-" : "+";
|
||||
}
|
||||
</script>
|
||||
|
||||
<form id="writeform">
|
||||
<input type="button" onclick="ShowHideBtn(this,'writearea');" value="+"/>
|
||||
<div id="writearea" style="display:none;">
|
||||
<input type="hidden" name="estid" id="estid" value="<%=Model.Id%>"/>
|
||||
<label for="desc">Description:</label>
|
||||
<input type="text" name="desc" id="desc" />
|
||||
<label for="ucost">Prix unitaire:</label>
|
||||
<input type="number" name="ucost" id="ucost"/>
|
||||
<label for="count">Quantité:</label>
|
||||
<input type="number" name="count" id="count"/>
|
||||
<label for="productid">Référence du produit:</label>
|
||||
<input type="text" name="productid" id="productid"/>
|
||||
<input type="button" name="btnapply" id="btnapply" value="Écrire"/>
|
||||
<input type="hidden" name="wrid" id="wrid" />
|
||||
<tt id="dbgv"></tt>
|
||||
<input type="button" name="btnview" id="btnview" value="View Values"/>
|
||||
|
||||
<script>
|
||||
|
||||
jQuery.support.cors = false;
|
||||
function GetWritting () {
|
||||
var estid = parseInt($("#estid").val());
|
||||
var ucost = Number($("#ucost").val());
|
||||
var count = parseInt($("#count").val());
|
||||
var desc = $("#desc").val();
|
||||
var productid = $("#productid").val();
|
||||
return {
|
||||
estid:estid,
|
||||
desc:desc,
|
||||
ucost:ucost,
|
||||
count:count,
|
||||
productid:productid
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#btnapply").click(function () {
|
||||
|
||||
$.ajax({
|
||||
url: "http://localhost:8080/api/WorkFlow/Write",
|
||||
type: "Get",
|
||||
dataType: "json",
|
||||
data: GetWritting(),
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
success: function (data) {
|
||||
$("#wrid").val(data);
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
$("#dbgv").text(xhr.status+" : "+xhr.responseText);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btnview").click(function () {
|
||||
$("#dbgv").text(JSON.stringify(GetWritting()));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</form>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue