* New features:

- New Client at estimation, ala ajax 
- Admins can now edit user's profiles
This commit is contained in:
Paul Schneider 2015-04-15 03:03:20 +02:00
commit 0755dd62b3
33 changed files with 634 additions and 234 deletions

View file

@ -70,6 +70,12 @@ namespace Yavsc.Model {
}
}
public static string My_Estimates {
get {
return ResourceManager.GetString("My_Estimates", resourceCulture);
}
}
public static string UserName {
get {
return ResourceManager.GetString("UserName", resourceCulture);

View file

@ -47,4 +47,5 @@
<data name="role_created"><value>Rôle créé</value></data>
<data name="Item_added_to_basket"><value>Article ajouté au panier</value></data>
<data name="Estimate_not_found"><value>Devis non trouvé</value></data>
<data name="My_Estimates"><value>Mes estimations</value></data>
</root>

View file

@ -49,4 +49,5 @@
<data name="Estimate_not_found"><value>Estimate not found</value></data>
<data name="DuplicateEmail"><value>This email adress is already used ({0}).</value></data>
<data name="DuplicateUserName"><value>This user name is already used ({0}).</value></data>
<data name="My_Estimates"><value>My estimates</value></data>
</root>

View file

@ -168,28 +168,45 @@ namespace Yavsc.Model.RolesAndMembers
/// Gets a value indicating whether this instance has bank account.
/// </summary>
/// <value><c>true</c> if this instance has bank account; otherwise, <c>false</c>.</value>
public bool HasBankAccount { get {
return IsBillable
&& !string.IsNullOrWhiteSpace (BankCode)
&& !string.IsNullOrWhiteSpace (BIC)
&& !string.IsNullOrWhiteSpace (IBAN)
&& !string.IsNullOrWhiteSpace (WicketCode)
&& !string.IsNullOrWhiteSpace (AccountNumber)
&& BankedKey != 0; } }
public bool HasBankAccount {
get {
return !(
(
string.IsNullOrWhiteSpace (BankCode)
|| string.IsNullOrWhiteSpace (WicketCode)
|| string.IsNullOrWhiteSpace (AccountNumber)
|| BankedKey == 0
)
&&
( string.IsNullOrWhiteSpace (BIC)
|| string.IsNullOrWhiteSpace (IBAN))
); } }
/// <summary>
/// Gets a value indicating whether this instance is billable.
/// Returns true when
/// Name is not null and all of
/// Address, CityAndState and ZipCode are not null,
/// or one of Email or Phone or Mobile is not null
///
/// </summary>
/// <value><c>true</c> if this instance is billable; otherwise, <c>false</c>.</value>
public bool IsBillable {
get {
// true if
// Name is not null and
// (
// (Address and CityAndState and ZipCode)
// or Email or Phone or Mobile
// )
return !string.IsNullOrWhiteSpace (Name)
&& !string.IsNullOrWhiteSpace (Address)
&& !string.IsNullOrWhiteSpace (CityAndState)
&& !string.IsNullOrWhiteSpace (ZipCode)
&& !string.IsNullOrWhiteSpace (Email)
&& !(string.IsNullOrWhiteSpace (Phone) &&
string.IsNullOrWhiteSpace (Mobile));
&& !( (
string.IsNullOrWhiteSpace (Address)
|| string.IsNullOrWhiteSpace (CityAndState)
|| string.IsNullOrWhiteSpace (ZipCode))
&& string.IsNullOrWhiteSpace (Email)
&& string.IsNullOrWhiteSpace (Phone)
&& string.IsNullOrWhiteSpace (Mobile));
}
}

View file

@ -0,0 +1,71 @@
//
// RegisterClientModel.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 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 <http://www.gnu.org/licenses/>.
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.RolesAndMembers
{
/// <summary>
/// Register client model.
/// </summary>
public class RegisterClientModel : RegisterModel
{
/// <summary>
/// Gets or sets the full name.
/// </summary>
/// <value>The full name.</value>
[DisplayName("Nom complet")]
[Required(ErrorMessage="S'il vous plait, saisissez le nom complet")]
public string Name { get; set; }
/// <summary>
/// Gets or sets the address.
/// </summary>
/// <value>The address.</value>
[DisplayName("Addresse")]
public string Address { get; set; }
/// <summary>
/// Gets or sets the state of the city and.
/// </summary>
/// <value>The state of the city and.</value>
[DisplayName("Ville")]
public string CityAndState { get; set; }
/// <summary>
/// Gets or sets the zip code.
/// </summary>
/// <value>The zip code.</value>
[DisplayName("Code postal")]
public string ZipCode { get; set; }
/// <summary>
/// Gets or sets the phone.
/// </summary>
/// <value>The phone.</value>
[DisplayName("Téléphone fixe")]
public string Phone { get; set; }
/// <summary>
/// Gets or sets the mobile.
/// </summary>
/// <value>The mobile.</value>
[DisplayName("Téléphone mobile")]
public string Mobile { get; set; }
}
}

View file

@ -55,8 +55,15 @@ namespace Yavsc.Model.RolesAndMembers
[Required(ErrorMessage = "S'il vous plait, entrez un e-mail valide")]
public string Email { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is approuved.
/// </summary>
/// <value><c>true</c> if this instance is approuved; otherwise, <c>false</c>.</value>
public bool IsApprouved { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.RolesAndMembers.RegisterModel"/> class.
/// </summary>
public RegisterModel()
{
IsApprouved = false;

View file

@ -62,11 +62,19 @@ namespace Yavsc.Model.WorkFlow
/// <param name="estimid">Estimid.</param>
Estimate GetEstimate (long estimid);
/// <summary>
/// Gets the estimates created for a specified client.
/// Gets the estimates created by
/// or for the given user by user name.
/// </summary>
/// <returns>The estimates.</returns>
/// <param name="username">user name.</param>
Estimate [] GetEstimates(string username);
/// <summary>
/// Gets the estimates.
/// </summary>
/// <returns>The estimates.</returns>
/// <param name="client">Client.</param>
Estimate [] GetEstimates(string client);
/// <param name="responsible">Responsible.</param>
Estimate [] GetEstimates(string client, string responsible);
/// <summary>
/// Drops the writting.
/// </summary>

View file

@ -48,15 +48,30 @@ namespace Yavsc.Model.WorkFlow
return ContentProvider.GetEstimate (estid);
}
/// <summary>
/// Gets the estimates.
/// Gets the estimates, refering the
/// given client or username .
/// </summary>
/// <returns>The estimates.</returns>
/// <param name="client">Client.</param>
public Estimate [] GetEstimates (string client)
/// <param name="responsible">Responsible.</param>
public Estimate [] GetResponsibleEstimates (string responsible)
{
return ContentProvider.GetEstimates (client);
return ContentProvider.GetEstimates (null, responsible);
}
/// <summary>
/// Gets the client estimates.
/// </summary>
/// <returns>The client estimates.</returns>
/// <param name="client">Client.</param>
public Estimate [] GetClientEstimates (string client)
{
return ContentProvider.GetEstimates (client, null);
}
public Estimate [] GetUserEstimates (string username)
{
return ContentProvider.GetEstimates (username);
}
/// <summary>
/// Gets the stock for a given product reference.
/// </summary>

View file

@ -143,6 +143,7 @@
<Compile Include="Google\GDate.cs" />
<Compile Include="Google\Resource.cs" />
<Compile Include="RolesAndMemebers\RegisterModel.cs" />
<Compile Include="RolesAndMemebers\RegisterClientModel.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>