+
+
+
-
+
@@ -94,9 +100,11 @@
+ .selected *, .odd .selected { font-size-adjust: +1; background-color: rgb(0,64,0); }
+
+
diff --git a/web/Views/FrontOffice/Estimates.aspx b/web/Views/FrontOffice/Estimates.aspx
new file mode 100644
index 00000000..bec15cd3
--- /dev/null
+++ b/web/Views/FrontOffice/Estimates.aspx
@@ -0,0 +1,8 @@
+<%@ Page Title="My estimates" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage
>" %>
+
+<% foreach (Estimate estim in Model) { %>
+ <%= Html.ActionLink(estim.Id.ToString(),"Estimate",new {Id=estim.Id}) %>
+<% } %>
+
+
+
diff --git a/web/Web.config b/web/Web.config
index 0d7b2d8a..db2b31a1 100644
--- a/web/Web.config
+++ b/web/Web.config
@@ -140,6 +140,15 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
+
+
+
+
+
+
+
+
+
diff --git a/web/Web.csproj b/web/Web.csproj
index e263cb21..0b413c24 100644
--- a/web/Web.csproj
+++ b/web/Web.csproj
@@ -116,6 +116,9 @@
+
+
+
@@ -148,6 +151,12 @@
+
+ Estim.tt
+
+
+
+
@@ -225,6 +234,7 @@
+
@@ -246,6 +256,11 @@
+
+ TextTemplatingFilePreprocessor
+ Estim.cs
+
+
@@ -260,10 +275,6 @@
{90BF2234-7252-4CD5-B2A4-17501B19279B}
SalesCatalog
-
- {821FF72D-9F4B-4A2C-B95C-7B965291F119}
- WorkFlowProvider
-
{59E1DF7B-FFA0-4DEB-B5F3-76EBD98D5356}
WebControls
@@ -276,5 +287,9 @@
{68F5B80A-616E-4C3C-91A0-828AA40000BD}
YavscModel
+
+ {821FF72D-9F4B-4A2C-B95C-7B965291F119}
+ NpgsqlWorkflow
+
diff --git a/web/install/instdb.sql b/web/install/instdb.sql
new file mode 100644
index 00000000..5f282702
--- /dev/null
+++ b/web/install/instdb.sql
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/templates/Estim.tex b/web/templates/Estim.tex
new file mode 100644
index 00000000..4425dae5
--- /dev/null
+++ b/web/templates/Estim.tex
@@ -0,0 +1,167 @@
+\documentclass[french,11pt]{article}
+\usepackage{babel}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[a4paper]{geometry}
+\usepackage{units}
+\usepackage{bera}
+\usepackage{graphicx}
+\usepackage{fancyhdr}
+\usepackage{fp}
+
+\def\TVA{20} % Taux de la TVA
+
+\def\TotalHT{0}
+\def\TotalTVA{0}
+
+
+\newcommand{\AjouterService}[2]{% Arguments : Désignation, prix
+ \FPround{\montant}{#2}{2}
+ \FPadd{\TotalHT}{\TotalHT}{\montant}
+ \eaddto\ListeProduits{#1 & \montant \cr}
+}
+
+
+\newcommand{\AfficheResultat}{%
+ \ListeProduits
+
+ \FPeval{\TotalTVA}{\TotalHT * \TVA / 100}
+ \FPadd{\TotalTTC}{\TotalHT}{\TotalTVA}
+ \FPround{\TotalHT}{\TotalHT}{2}
+ \FPround{\TotalTVA}{\TotalTVA}{2}
+ \FPround{\TotalTTC}{\TotalTTC}{2}
+ \global\let\TotalHT\TotalHT
+ \global\let\TotalTVA\TotalTVA
+ \global\let\TotalTTC\TotalTTC
+
+ \cr
+ \hline
+ \textbf{Total} & & & \TotalHT
+}
+
+\newcommand*\eaddto[2]{% version développée de \addto
+ \edef\tmp{#2}%
+ \expandafter\addto
+ \expandafter#1%
+ \expandafter{\tmp}%
+}
+
+\newcommand{\ListeProduits}{}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
+
+\def\FactureNum {} % Numéro de facture
+\def\FactureAcquittee {non} % Facture acquittée : oui/non
+\def\FactureLieu {Suresnes} % Lieu de l'édition de la facture
+\def\FactureObjet {Facture} % Objet du document
+% Description de la facture
+\def\FactureDescr {%
+
+Cette facture concerne la prestation de coiffure a domicile du Mardi 23 Septembre 2014 à Meudon, 6 rue de la Verrerie.
+}
+
+% Infos Client
+\def\ClientNom{M. Dupont} % Nom du client
+\def\ClientAdresse{% % Adresse du client
+ Zenosphere : Anthony Courtois (DG)\\
+ 6 rue de la Verrerie\\
+ 92190 MEUDON\\
+ Mobile: 06 47 60 25 50
+}
+
+% Liste des produits facturés : Désignation, prix
+\AjouterService {Forfait Coiffure} {75}
+%\AjouterService {Frais de déplacement} {0.84}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+
+\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
+
+\thispagestyle{fancy}
+\pagestyle{fancy}
+\setlength{\parindent}{0pt}
+
+\renewcommand{\headrulewidth}{0pt}
+\cfoot{
+ Soraya Coiffure - 2 boulevard Aristide Briand - 92150 SURESNES \newline
+ \small{
+ E-mail: soraya.boudjouraf@free.fr\\
+ Téléphone mobile: +33(0)6 37 57 42 74\\
+ Téléphone fixe: +33(0)9 80 90 36 42
+ }
+}
+
+
+
+\begin{document}
+
+% Logo de la société
+%\includegraphics{logo.jpg}
+
+% Nom et adresse de la société
+Soraya Schneider\\
+2 boulevard Aristide Briand\\
+Bat V\\
+92150 SURESNES\\
+
+Facture n°\FactureNum
+
+
+{\addtolength{\leftskip}{10.5cm} %in ERT
+ \textbf{\ClientNom} \\
+ \ClientAdresse \\
+
+} %in ERT
+
+
+\hspace*{10.5cm}
+\FactureLieu, le \today
+
+~\\~\\
+
+\textbf{Objet : \FactureObjet \\}
+
+\textnormal{\FactureDescr}
+
+~\\
+
+\begin{center}
+ \begin{tabular}{lrrr}
+ \textbf{Désignation ~~~~~~} & \textbf{Montant (EUR)} \\
+ \hline
+ \AfficheResultat{}
+ \end{tabular}
+\end{center}
+
+\begin{flushright}
+\textit{Auto entreprise en franchise de TVA}\\
+
+\end{flushright}
+~\\
+
+\ifthenelse{\equal{\FactureAcquittee}{oui}}{
+ Facture acquittée.
+}{
+
+ À régler par chèque ou par virement bancaire :
+
+ \begin{center}
+ \begin{tabular}{|c c c c|}
+ \hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB} \\
+ 20041 & 00001 & 1225647F020 & 05 \\
+ \hline \textbf{IBAN N°} & \multicolumn{3}{|l|}{ FR 91 20041 00001 1225647F020 05 } \\
+ \hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ PSSTFRPPPAR } \\
+ \hline
+ \end{tabular}
+ \end{center}
+
+}
+
+\end{document}
diff --git a/web/templates/Estim.tt b/web/templates/Estim.tt
new file mode 100644
index 00000000..cf195db7
--- /dev/null
+++ b/web/templates/Estim.tt
@@ -0,0 +1,188 @@
+<#@ template language="C#" #>
+<#@ output extension=".tex" #>
+<#@ assembly name="System.Core" #>
+<#@ assembly name="$(SolutionDir)/web/bin/YavscModel.dll" #>
+<#@ import namespace="System.Linq" #>
+<#@ import namespace="System.Text" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ import namespace="Yavsc.Model.WorkFlow" #>
+<#@ import namespace="Yavsc.Model.RolesAndMembers" #>
+
+<#@ parameter type="Estimate" name="estim" #>
+<#@ parameter type="Profile" name="from" #>
+<#@ parameter type="Profile" name="to" #>
+
+
+\documentclass[french,11pt]{article}
+\usepackage{babel}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[a4paper]{geometry}
+\usepackage{units}
+\usepackage{bera}
+\usepackage{graphicx}
+\usepackage{fancyhdr}
+\usepackage{fp}
+
+\def\TVA{20} % Taux de la TVA
+
+\def\TotalHT{0}
+\def\TotalTVA{0}
+
+
+\newcommand{\AjouterService}[2]{% Arguments : Désignation, prix
+ \FPround{\montant}{#2}{2}
+ \FPadd{\TotalHT}{\TotalHT}{\montant}
+ \eaddto\ListeProduits{#1 & \montant \cr}
+}
+
+
+\newcommand{\AfficheResultat}{%
+ \ListeProduits
+
+ \FPeval{\TotalTVA}{\TotalHT * \TVA / 100}
+ \FPadd{\TotalTTC}{\TotalHT}{\TotalTVA}
+ \FPround{\TotalHT}{\TotalHT}{2}
+ \FPround{\TotalTVA}{\TotalTVA}{2}
+ \FPround{\TotalTTC}{\TotalTTC}{2}
+ \global\let\TotalHT\TotalHT
+ \global\let\TotalTVA\TotalTVA
+ \global\let\TotalTTC\TotalTTC
+
+
+ \cr
+ \hline
+ \textbf{Total} & & & \TotalHT
+}
+
+\newcommand*\eaddto[2]{% version développée de \addto
+ \edef\tmp{#2}%
+ \expandafter\addto
+ \expandafter#1%
+ \expandafter{\tmp}%
+}
+
+\newcommand{\ListeProduits}{}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
+
+\def\FactureNum {<#= estim.Id.ToString() #>} % Numéro de facture
+\def\FactureAcquittee {non} % Facture acquittée : oui/non
+\def\FactureLieu {<#= from.CityAndState #>} % Lieu de l'édition de la facture
+\def\FactureObjet {Facture} % Objet du document
+% Description de la facture
+\def\FactureDescr {%
+ <#= estim.Title #>
+}
+
+% Infos Client
+\def\ClientNom{<#= to.Name #>} % Nom du client
+\def\ClientAdresse{% % Adresse du client
+ <#= to.Address #>\\
+ <#= to.ZipCode #> <#= to.CityAndState #>\\
+<# if (!string.IsNullOrWhiteSpace(to.Phone)) { #>
+ Téléphone fixe: <#= to.Phone #>\\
+<# } #>
+<# if (!string.IsNullOrWhiteSpace(to.Mobile)) { #>
+ Mobile: <#= to.Mobile #>\\
+<# } #>
+ E-mail: <#= to.Email #>
+}
+
+% Liste des produits facturés : Désignation, prix
+
+ <# foreach (Writting wr in estim.Lines) { #>
+\AjouterService {<#=wr.Description#> <# if (!string.IsNullOrWhiteSpace(wr.ProductReference)) { #>
+ (<#=wr.ProductReference#>)<# } #>} {<#=wr.UnitaryCost*wr.Count#>}
+ <# } #>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+
+\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
+
+\thispagestyle{fancy}
+\pagestyle{fancy}
+\setlength{\parindent}{0pt}
+
+\renewcommand{\headrulewidth}{0pt}
+\cfoot{
+ <#=from.Name#> - <#=from.Address #> - <#= from.CityAndState #> \newline
+ \small{
+ E-mail: <#= from.Email #>
+ <# if (!string.IsNullOrWhiteSpace(from.Mobile)) { #> - Téléphone mobile: <#= from.Mobile #><# } #>
+ <# if (!string.IsNullOrWhiteSpace(from.Phone)) { #> - Téléphone fixe: <#= from.Phone #><# } #>
+ }
+}
+
+\begin{document}
+
+% Logo de la société
+%\includegraphics{logo.jpg}
+
+% Nom et adresse de la société
+<#= from.Name #>\\
+<#= from.Address #>\\
+<#=from.ZipCode #> <#=from.CityAndState#>\\
+
+Facture n°\FactureNum
+
+
+{\addtolength{\leftskip}{10.5cm} %in ERT
+ \textbf{\ClientNom} \\
+ \ClientAdresse \\
+
+} %in ERT
+
+
+\hspace*{10.5cm}
+\FactureLieu, le \today
+
+~\\~\\
+
+\textbf{Objet : \FactureObjet \\}
+
+\textnormal{\FactureDescr}
+
+~\\
+
+\begin{center}
+ \begin{tabular}{lrrr}
+ \textbf{Désignation ~~~~~~} & \textbf{Montant (EUR)} \\
+ \hline
+ \AfficheResultat{}
+ \end{tabular}
+\end{center}
+
+\begin{flushright}
+\textit{Auto entreprise en franchise de TVA}\\
+
+\end{flushright}
+~\\
+
+\ifthenelse{\equal{\FactureAcquittee}{oui}}{
+ Facture acquittée.
+}{
+
+ À régler par chèque ou par virement bancaire :
+
+ \begin{center}
+ \begin{tabular}{|c c c c|}
+ \hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB} \\
+ <#= from.BankCode #> & <#= from.WicketCode #> & <#=from.AccountNumber #> & <#=from.BankedKey#> \\
+ \hline \textbf{IBAN N°} & \multicolumn{3}{|l|}{ <#= from.IBAN #> } \\
+ \hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ <#= from.BIC #> } \\
+ \hline
+ \end{tabular}
+ \end{center}
+
+}
+
+\end{document}
diff --git a/web/templates/T4TemplateEstimate.cs b/web/templates/T4TemplateEstimate.cs
new file mode 100644
index 00000000..4b2b42c4
--- /dev/null
+++ b/web/templates/T4TemplateEstimate.cs
@@ -0,0 +1,2 @@
+
+
diff --git a/web/templates/TexEstimInit.cs b/web/templates/TexEstimInit.cs
new file mode 100644
index 00000000..ea25eee4
--- /dev/null
+++ b/web/templates/TexEstimInit.cs
@@ -0,0 +1,33 @@
+//
+// TexEstimInit.cs
+//
+// Author:
+// Paul Schneider
+//
+// Copyright (c) 2014 Paul Schneider
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see .
+using System;
+
+namespace Yavsc.templates
+{
+ public partial class Estim
+ {
+ public void Init ()
+ {
+ this.Initialize();
+ }
+ }
+}
+
diff --git a/yavscModel/RolesAndMemebers/Profile.cs b/yavscModel/RolesAndMemebers/Profile.cs
index 9b65fa8f..c466d35c 100644
--- a/yavscModel/RolesAndMemebers/Profile.cs
+++ b/yavscModel/RolesAndMemebers/Profile.cs
@@ -2,63 +2,158 @@ using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Profile;
+using System.Web.Security;
namespace Yavsc.Model.RolesAndMembers
{
public class Profile
{
- [DisplayName("Adresse")]
- [StringLength(2047)]
+ [DisplayName ("Nom complet")]
+ [StringLength (1024)]
+ public string Name { get; set; }
+
+ [DisplayName ("Adresse")]
+ [StringLength (2047)]
public string Address { get; set; }
- [DisplayName("Ville")]
- [StringLength(255)]
+ [DisplayName ("Ville")]
+ [StringLength (255)]
public string CityAndState { get; set; }
- [DisplayName("Code Postal")]
- [StringLength(9)]
+ [DisplayName ("Code Postal")]
+ [StringLength (9)]
public string ZipCode { get; set; }
- [DisplayName("Pays")]
- [StringLength(99)]
+ [DisplayName ("Pays")]
+ [StringLength (99)]
public string Country { get; set; }
- [DisplayName("Site Web")]
- [StringLength(255)]
+ [DisplayName ("Site Web")]
+ [StringLength (255)]
public string WebSite { get; set; }
- [DisplayName("Blog visible")]
+ [DisplayName ("Blog visible")]
public bool BlogVisible { get; set; }
- [DisplayName("Titre du blog")]
+ [DisplayName ("Titre du blog")]
+ [StringLength (255)]
public string BlogTitle { get; set; }
-
- public Profile():base()
+
+ [DisplayName ("Téléphone fixe")]
+ [StringLength (15)]
+ public string Phone { get; set; }
+
+ [DisplayName ("Portable")]
+ [StringLength (15)]
+ public string Mobile { get; set; }
+
+ [DisplayName ("E-mail")]
+ [StringLength (1024)]
+ public string Email { get; set; }
+
+ [DisplayName ("Code BIC")]
+ [StringLength (15)]
+ public string BIC { get; set; }
+
+ [DisplayName ("Code IBAN")]
+ [StringLength (33)]
+ public string IBAN { get; set; }
+
+
+ [DisplayName ("Code Banque")]
+ [StringLength (5)]
+ public string BankCode { get; set; }
+
+ [DisplayName ("Code Guichet")]
+ [StringLength (5)]
+ public string WicketCode { get; set; }
+
+ [DisplayName ("Numéro de compte")]
+ [StringLength (15)]
+ public string AccountNumber { get; set; }
+
+ [DisplayName ("Clé RIB")]
+ public int BankedKey { get; set; }
+
+ public bool IsBankable { get {
+ return IsBillable
+ && !string.IsNullOrWhiteSpace (BankCode)
+ && !string.IsNullOrWhiteSpace (BIC)
+ && !string.IsNullOrWhiteSpace (IBAN)
+ && !string.IsNullOrWhiteSpace (BankCode)
+ && !string.IsNullOrWhiteSpace (WicketCode)
+ && !string.IsNullOrWhiteSpace (AccountNumber)
+ && BankedKey != 0; } }
+
+ public bool IsBillable {
+ get {
+ return !string.IsNullOrWhiteSpace (Name)
+ && !string.IsNullOrWhiteSpace (Address)
+ && !string.IsNullOrWhiteSpace (CityAndState)
+ && !string.IsNullOrWhiteSpace (ZipCode)
+ && !string.IsNullOrWhiteSpace (Email)
+ && !(string.IsNullOrWhiteSpace (Phone) &&
+ string.IsNullOrWhiteSpace (Mobile));
+ }
+ }
+
+ public Profile () : base ()
{
}
- public Profile(ProfileBase profile)
+ public Profile (ProfileBase profile)
{
- object b = profile.GetPropertyValue ("BlogVisible");
- BlogVisible = (b is DBNull) ? true : (bool)b;
+ object b = profile.GetPropertyValue ("BlogVisible");
+ BlogVisible = (b == null) ? true : (bool)b;
- object s = profile.GetPropertyValue ("BlogTitle");
- BlogTitle = (s is DBNull) ? null : (string)s;
+ object s = profile.GetPropertyValue ("BlogTitle");
+ BlogTitle = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("Address");
+ Address = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("CityAndState");
+ CityAndState = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("Country");
+ Country = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("ZipCode");
+ ZipCode = (s is DBNull) ? null : (string)s;
- s = profile.GetPropertyValue("Address");
- Address = (s is DBNull)?null:(string)s;
+ s = profile.GetPropertyValue ("WebSite");
+ WebSite = (s is DBNull) ? null : (string)s;
- s = profile.GetPropertyValue("CityAndState");
- CityAndState = (s is DBNull)?null:(string)s;
+ s = profile.GetPropertyValue ("Name");
+ Name = (s is DBNull) ? null : (string)s;
- s = profile.GetPropertyValue("Country");
- Country = (s is DBNull)?null:(string)s;
+ s = profile.GetPropertyValue ("Phone");
+ Phone = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("Mobile");
+ Mobile = (s is DBNull) ? null : (string)s;
+
+ MembershipUser u = Membership.GetUser (profile.UserName);
+ Email = u.Email;
+
+ s = profile.GetPropertyValue ("BankCode");
+ BankCode = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("IBAN");
+ IBAN = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("BIC");
+ BIC = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("WicketCode");
+ WicketCode = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("AccountNumber");
+ this.AccountNumber = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("BankedKey");
+ BankedKey = (s == null) ? 0 : (int)s;
- s = profile.GetPropertyValue("ZipCode");
- ZipCode = (s is DBNull)?null:(string)s;
-
- s = profile.GetPropertyValue ("WebSite");
- WebSite = (s is DBNull) ? null : (string)s;
}
}
}
diff --git a/yavscModel/WorkFlow/Estimate.cs b/yavscModel/WorkFlow/Estimate.cs
index 027616c0..73966ba5 100644
--- a/yavscModel/WorkFlow/Estimate.cs
+++ b/yavscModel/WorkFlow/Estimate.cs
@@ -1,15 +1,30 @@
using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel;
namespace Yavsc.Model.WorkFlow
{
- public class Estimate
+ [Serializable]
+ public class Estimate
{
public Estimate ()
{
}
+ [Required]
+ [DisplayName("Titre")]
public string Title { get; set; }
- public string Owner { get; set; }
+ [Required]
+ [DisplayName("Description")]
+ public string Description { get; set; }
+ [Required]
+ [DisplayName("Responsable")]
+ public string Responsible { get; set; }
+ [Required]
+ [DisplayName("Client")]
+ public string Client { get; set; }
+
public long Id { get; set; }
+ [DisplayName("Chiffre")]
public decimal Ciffer {
get {
decimal total = 0;
@@ -20,6 +35,7 @@ namespace Yavsc.Model.WorkFlow
return total;
}
}
+
public Writting[] Lines { get; set; }
}
}
diff --git a/yavscModel/WorkFlow/IContent.cs b/yavscModel/WorkFlow/IContent.cs
deleted file mode 100644
index 14bc7ee4..00000000
--- a/yavscModel/WorkFlow/IContent.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Yavsc.Model.WorkFlow
-{
- public interface IContent
- {
- object Data { get; set; }
- string MimeType { get; set; }
-
- }
-}
-
diff --git a/yavscModel/WorkFlow/IContentProvider.cs b/yavscModel/WorkFlow/IContentProvider.cs
index f9068bc9..0a1f14ef 100644
--- a/yavscModel/WorkFlow/IContentProvider.cs
+++ b/yavscModel/WorkFlow/IContentProvider.cs
@@ -42,7 +42,7 @@ namespace Yavsc.Model.WorkFlow
/// The estimate.
/// Client.
/// Title.
- long CreateEstimate (string client, string title);
+ Estimate CreateEstimate (string responsible, string client, string title, string description);
///
/// Add a line to the specified estimate by id,
/// using the specified desc, ucost, count and productid.
@@ -97,13 +97,7 @@ namespace Yavsc.Model.WorkFlow
///
/// Estid.
/// New title.
- void SetTitle (long estid, string newTitle);
- ///
- /// Sets the descripton for a writting.
- ///
- /// Writid.
- /// New desc.
- void SetDesc (long writid, string newDesc);
+ void UpdateEstimate (Estimate estim);
///
/// Sets the writting status.
///
diff --git a/yavscModel/WorkFlow/NewEstimateEvenArgs.cs b/yavscModel/WorkFlow/NewEstimateEvenArgs.cs
index 3d0d9081..0ca45ba2 100644
--- a/yavscModel/WorkFlow/NewEstimateEvenArgs.cs
+++ b/yavscModel/WorkFlow/NewEstimateEvenArgs.cs
@@ -8,19 +8,11 @@ namespace Yavsc.Model.WorkFlow
{
public class NewEstimateEvenArgs: EventArgs
{
- private string clientName;
- private string estimateTitle;
- private long eid;
-
- public string ClientName{ get { return clientName; } }
- public string EstimateTitle { get { return estimateTitle; } }
- public long EstimateId { get { return eid; } }
-
- public NewEstimateEvenArgs(long estid, string client, string title)
+ private Estimate data=null;
+ public Estimate Data{ get { return data; } }
+ public NewEstimateEvenArgs(Estimate created)
{
- clientName = client;
- estimateTitle = title;
- eid = estid;
+ data = created;
}
}
diff --git a/yavscModel/WorkFlow/WorkFlowManager.cs b/yavscModel/WorkFlow/WorkFlowManager.cs
index 9b1b3f77..21448b37 100644
--- a/yavscModel/WorkFlow/WorkFlowManager.cs
+++ b/yavscModel/WorkFlow/WorkFlowManager.cs
@@ -17,9 +17,9 @@ namespace Yavsc.Model.WorkFlow
public static Catalog Catalog { get; set; }
- public static void SetTitle (long id, string title)
+ public static void UpdateEstimate (Estimate estim)
{
- ContentProvider.SetTitle (id, title);
+ ContentProvider.UpdateEstimate (estim);
}
public static event EventHandler NewOrder;
@@ -95,12 +95,13 @@ namespace Yavsc.Model.WorkFlow
///
/// The estimate identifier.
/// Title.
- public static long CreateEstimate(string client, string title)
+
+ public static Estimate CreateEstimate(string responsible, string client, string title, string description)
{
- long estid = ContentProvider.CreateEstimate (client, title);
+ Estimate created = ContentProvider.CreateEstimate (responsible, client, title, description);
if (NewOrder != null)
- NewOrder.Invoke(ContentProvider, new NewEstimateEvenArgs(estid,client,title));
- return estid;
+ NewOrder.Invoke(ContentProvider, new NewEstimateEvenArgs(created));
+ return created;
}
public static long Write(long estid, string desc, decimal ucost, int count, string productid)
diff --git a/yavscModel/WorkFlow/Writting.cs b/yavscModel/WorkFlow/Writting.cs
index 2d18c21d..f2cff738 100644
--- a/yavscModel/WorkFlow/Writting.cs
+++ b/yavscModel/WorkFlow/Writting.cs
@@ -7,6 +7,7 @@ namespace Yavsc.Model.WorkFlow
/// A Writting.
/// Une ligne d'écriture dans un devis ou une facture
///
+ [Serializable]
public class Writting
{
///
diff --git a/yavscModel/YavscModel.csproj b/yavscModel/YavscModel.csproj
index b28d52c9..9c410919 100644
--- a/yavscModel/YavscModel.csproj
+++ b/yavscModel/YavscModel.csproj
@@ -35,6 +35,7 @@
+
@@ -53,7 +54,6 @@
-