* Estimates as Tex or Pdf
* Estimate edition [mix Mvc&Ajax] * Billable&Bankable properties on profiles
This commit is contained in:
parent
2ac2338939
commit
b39a444cf0
31 changed files with 1101 additions and 218 deletions
|
|
@ -5,14 +5,25 @@
|
|||
</asp:Content>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ActionLink("Changer de mot de passe","ChangePassword", "Account")%>
|
||||
|
||||
|
||||
<%= Html.ValidationSummary() %>
|
||||
<% using(Html.BeginForm("UpdateProfile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %>
|
||||
<% using(Html.BeginForm("Profile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %>
|
||||
<% { %>
|
||||
|
||||
<h2>Informations générales</h2>
|
||||
<table class="layout">
|
||||
<tr><td align="right">
|
||||
<%= Html.LabelFor(model => model.Name) %></td><td>
|
||||
<%= Html.TextBox("Name") %>
|
||||
<%= Html.ValidationMessage("Name", "*") %></td></tr>
|
||||
<tr><td align="right">
|
||||
<%= Html.LabelFor(model => model.Phone) %></td><td>
|
||||
<%= Html.TextBox("Phone") %>
|
||||
<%= Html.ValidationMessage("Phone", "*") %></td></tr>
|
||||
<tr><td align="right">
|
||||
<%= Html.LabelFor(model => model.Mobile) %></td><td>
|
||||
<%= Html.TextBox("Mobile") %>
|
||||
<%= Html.ValidationMessage("Mobile", "*") %></td></tr>
|
||||
<tr><td align="right">
|
||||
<%= Html.LabelFor(model => model.Address) %></td><td>
|
||||
<%= Html.TextBox("Address") %>
|
||||
<%= Html.ValidationMessage("Address", "*") %></td></tr>
|
||||
|
|
@ -21,6 +32,10 @@
|
|||
<%= Html.TextBox("CityAndState") %>
|
||||
<%= Html.ValidationMessage("CityAndState", "*") %></td></tr>
|
||||
<tr><td align="right">
|
||||
<%= Html.LabelFor(model => model.ZipCode) %></td><td>
|
||||
<%= Html.TextBox("ZipCode") %>
|
||||
<%= Html.ValidationMessage("ZipCode", "*") %></td></tr>
|
||||
<tr><td align="right">
|
||||
<%= Html.LabelFor(model => model.Country) %></td><td>
|
||||
<%= Html.TextBox("Country") %>
|
||||
<%= Html.ValidationMessage("Country", "*") %></td></tr>
|
||||
|
|
@ -42,6 +57,74 @@ Avatar </td><td> <img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["User
|
|||
<%= Html.ValidationMessage("AvatarFile", "*") %></td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h2>Informations de facturation</h2>
|
||||
<table class="layout">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= Html.LabelFor(model => model.BankCode) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= Html.TextBox("BankCode") %>
|
||||
<%= Html.ValidationMessage("BankCode", "*") %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= Html.LabelFor(model => model.WicketCode) %></td>
|
||||
<td>
|
||||
<%= Html.TextBox("WicketCode") %>
|
||||
<%= Html.ValidationMessage("WicketCode", "*") %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= Html.LabelFor(model => model.AccountNumber) %></td>
|
||||
<td>
|
||||
<%= Html.TextBox("AccountNumber") %>
|
||||
<%= Html.ValidationMessage("AccountNumber", "*") %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= Html.LabelFor(model => model.BankedKey) %></td>
|
||||
<td>
|
||||
<%= Html.TextBox("BankedKey") %>
|
||||
<%= Html.ValidationMessage("BankedKey", "*") %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= Html.LabelFor(model => model.BIC) %></td>
|
||||
<td>
|
||||
<%= Html.TextBox("BIC") %>
|
||||
<%= Html.ValidationMessage("BIC", "*") %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= Html.LabelFor(model => model.IBAN) %></td>
|
||||
<td>
|
||||
<%= Html.TextBox("IBAN") %>
|
||||
<%= Html.ValidationMessage("IBAN", "*") %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
<asp:Content ID="MASC1" ContentPlaceHolderID="MASContent" runat="server">
|
||||
<%= Html.ActionLink("Changer de mot de passe","ChangePassword", "Account")%>
|
||||
</asp:Content>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,12 +13,16 @@
|
|||
<% using (Html.BeginForm("Estimate","FrontOffice")) { %>
|
||||
<%= Html.LabelFor(model => model.Title) %>:<%= Html.TextBox( "Title" ) %>
|
||||
<%= Html.ValidationMessage("Title", "*") %>
|
||||
<% if (Model.Id > 0) { %>
|
||||
<br/>
|
||||
<%= Html.LabelFor(model => model.Owner) %>:<%=Model.Owner%>
|
||||
<%= Html.ValidationMessage("Owner", "*") %>
|
||||
<%= Html.LabelFor(model => model.Responsible) %>:<%=Model.Responsible%>
|
||||
<%= Html.Hidden ("Responsible") %>
|
||||
<%= Html.ValidationMessage("Responsible", "*") %>
|
||||
<br/>
|
||||
<%= Html.LabelFor(model => model.Ciffer) %>:<%=Model.Ciffer%>
|
||||
<%= Html.LabelFor(model => model.Client) %>:<%=Html.TextBox( "Client" ) %>
|
||||
<%= Html.ValidationMessage("Client", "*") %>
|
||||
<br/>
|
||||
<%= Html.LabelFor(model => model.Description) %>:<%=Html.TextArea( "Description") %>
|
||||
<%= Html.ValidationMessage("Description", "*") %>
|
||||
<br/>
|
||||
<%= Html.LabelFor(model => model.Id) %>:<%=Model.Id%>
|
||||
<%= Html.Hidden( "Id" ) %>
|
||||
|
|
@ -31,7 +35,7 @@
|
|||
<% } %>
|
||||
|
||||
|
||||
|
||||
<% if (Model.Id>0) { %>
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
|
|
@ -76,12 +80,14 @@
|
|||
|
||||
<form id="writeform">
|
||||
<input type="button" id="btndtl" value="+"/>
|
||||
<div id="writearea" style="display:none;">
|
||||
|
||||
<div id="writearea" style="display:none;">
|
||||
<input type="button" id="btnnew" value="Nouvelle écriture"/>
|
||||
<input type="hidden" name="estid" id="estid" value="<%=Model.Id%>"/>
|
||||
<label for="Description">Description:</label>
|
||||
<input type="text" name="Description" id="Description" />
|
||||
<label for="UnitaryCost">Prix unitaire:</label>
|
||||
<input type="number" name="UnitaryCost" id="UnitaryCost"/>
|
||||
<input type="number" name="UnitaryCost" id="UnitaryCost" step="0.01"/>
|
||||
<label for="Count">Quantité:</label>
|
||||
<input type="number" name="Count" id="Count"/>
|
||||
<label for="ProductReference">Référence du produit:</label>
|
||||
|
|
@ -94,9 +100,11 @@
|
|||
<tt id="msg" class="message"></tt>
|
||||
<style>
|
||||
.row { cursor:pointer; }
|
||||
table.tablesorter td:hover { background-color: rgb(64,0,0); }
|
||||
table.tablesorter td:hover { background-color: rgba(0,64,0,0.5); }
|
||||
.hidden { display:none; }
|
||||
</style>
|
||||
.selected *, .odd .selected { font-size-adjust: +1; background-color: rgb(0,64,0); }
|
||||
|
||||
</style>
|
||||
<script>
|
||||
|
||||
jQuery.support.cors = true;
|
||||
|
|
@ -112,7 +120,11 @@
|
|||
|
||||
function wredit(pwrid)
|
||||
{
|
||||
|
||||
$("#wr"+wrid.value).removeClass("selected");
|
||||
$("#wrid").val(pwrid);
|
||||
if (wrid.value!=0)
|
||||
$("#wr"+wrid.value).addClass("selected");
|
||||
if (pwrid>0) {
|
||||
$("#btncreate").addClass("hidden");
|
||||
$("#btnmodify").removeClass("hidden");
|
||||
|
|
@ -123,11 +135,8 @@
|
|||
$("#btndrop").addClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// bug at no row: $(".tablesorter").tablesorter( {sortList: [[0,0], [1,0]]} );
|
||||
|
||||
function delRow() {
|
||||
|
||||
function delRow() {
|
||||
$.ajax({
|
||||
url: "<%=ViewData["WebApiUrl"]+"/DropWritting"%>",
|
||||
type: "Get",
|
||||
|
|
@ -148,6 +157,7 @@
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
function setRow() {
|
||||
var wrt = GetWritting();
|
||||
|
||||
|
|
@ -167,9 +177,9 @@
|
|||
$("#msg").text(xhr.status+" : "+xhr.responseText);}
|
||||
});
|
||||
}
|
||||
//data: {estid: estid, wr: { Id: 0, UnitaryCost: wrt.UnitaryCost, Count: wrt.Count, ProductReference: wrt.ProductReference, Description: wrt.Description}},
|
||||
|
||||
function addRow(){
|
||||
|
||||
|
||||
function addRow(){
|
||||
var wrt = GetWritting();
|
||||
var estid = parseInt($("#Id").val());
|
||||
$.ajax({
|
||||
|
|
@ -181,35 +191,47 @@
|
|||
success: function (data) {
|
||||
wrt.Id = Number(data);
|
||||
wredit(wrt.Id);
|
||||
$("<tr class=\"row\" id=\"wr"+wrt.Id+"\"><td>"+wrt.Description+"</td><td>"+wrt.ProductReference+"</td><td>"+wrt.Count+"</td><td>"+wrt.UnitaryCost+"</td></tr>").appendTo("#wrts")
|
||||
},
|
||||
$("<tr class=\"row\" id=\"wr"+wrt.Id+"\"><td>"+wrt.Description+"</td><td>"+wrt.ProductReference+"</td><td>"+wrt.Count+"</td><td>"+wrt.UnitaryCost+"</td></tr>").appendTo("#wrts");
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
$("#msg").text(xhr.status+" : "+xhr.responseText);}
|
||||
});
|
||||
|
||||
$(".wr"+wrt.Id).click(onEditRow(e));
|
||||
}
|
||||
|
||||
$("#btncreate").click(addRow);
|
||||
$("#btnmodify").click(setRow);
|
||||
$("#btndrop").click(delRow);
|
||||
function ShowDtl(val)
|
||||
{
|
||||
document.getElementById("writearea").style.display = val ? "block" : "none";
|
||||
document.getElementById("btndtl").value = val ? "-" : "+";
|
||||
}
|
||||
|
||||
$("#btndtl").click(function(){ShowDtl(document.getElementById("writearea").style.display != "block");});
|
||||
|
||||
$(".row").click(function (e) {
|
||||
function onEditRow(e) {
|
||||
ShowDtl(true);
|
||||
var cells = e.delegateTarget.getElementsByTagName("TD");
|
||||
var wrid = Number(e.delegateTarget.id.substr(2));
|
||||
wredit(wrid);
|
||||
var hid=e.delegateTarget.id;
|
||||
var vwrid = Number(hid.substr(2));
|
||||
wredit(vwrid);
|
||||
$("#Description").val(cells[0].innerHTML);
|
||||
$("#ProductReference").val(cells[1].innerHTML);
|
||||
$("#Count").val(cells[2].innerHTML);
|
||||
$("#UnitaryCost").val(Number(cells[3].innerHTML.replace(",",".")));
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// bug when no row: $(".tablesorter").tablesorter( {sortList: [[0,0], [1,0]]} );
|
||||
|
||||
$("#btncreate").click(addRow);
|
||||
$("#btnmodify").click(setRow);
|
||||
$("#btndrop").click(delRow);
|
||||
$("#btndtl").click(function(){ShowDtl(document.getElementById("writearea").style.display != "block");});
|
||||
$(".row").click(function (e) {onEditRow(e);});
|
||||
$("#btnnew").click(function () {
|
||||
wredit(0);
|
||||
$("#Description").val("");
|
||||
$("#ProductReference").val("");
|
||||
$("#Count").val(1);
|
||||
$("#UnitaryCost").val(0);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
|
|
|||
8
web/Views/FrontOffice/Estimates.aspx
Normal file
8
web/Views/FrontOffice/Estimates.aspx
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<%@ Page Title="My estimates" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Estimate>>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<% foreach (Estimate estim in Model) { %>
|
||||
<%= Html.ActionLink(estim.Id.ToString(),"Estimate",new {Id=estim.Id}) %>
|
||||
<% } %>
|
||||
</asp:Content>
|
||||
<asp:Content ID="MASContentContent" ContentPlaceHolderID="MASContent" runat="server">
|
||||
</asp:Content>
|
||||
Loading…
Add table
Add a link
Reference in a new issue