* 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
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <returns>The estimate.</returns>
|
||||
/// <param name="client">Client.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
long CreateEstimate (string client, string title);
|
||||
Estimate CreateEstimate (string responsible, string client, string title, string description);
|
||||
/// <summary>
|
||||
/// 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
|
|||
/// </summary>
|
||||
/// <param name="estid">Estid.</param>
|
||||
/// <param name="newTitle">New title.</param>
|
||||
void SetTitle (long estid, string newTitle);
|
||||
/// <summary>
|
||||
/// Sets the descripton for a writting.
|
||||
/// </summary>
|
||||
/// <param name="writid">Writid.</param>
|
||||
/// <param name="newDesc">New desc.</param>
|
||||
void SetDesc (long writid, string newDesc);
|
||||
void UpdateEstimate (Estimate estim);
|
||||
/// <summary>
|
||||
/// Sets the writting status.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
|||
/// </summary>
|
||||
/// <returns>The estimate identifier.</returns>
|
||||
/// <param name="title">Title.</param>
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// A Writting.
|
||||
/// Une ligne d'écriture dans un devis ou une facture
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Writting
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
|
@ -53,7 +54,6 @@
|
|||
<Compile Include="WorkFlow\Writting.cs" />
|
||||
<Compile Include="WorkFlow\Estimate.cs" />
|
||||
<Compile Include="WorkFlow\WFOrder.cs" />
|
||||
<Compile Include="WorkFlow\IContent.cs" />
|
||||
<Compile Include="WorkFlow\IContentProvider.cs" />
|
||||
<Compile Include="WorkFlow\IWFModule.cs" />
|
||||
<Compile Include="WorkFlow\IWFOrder.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue