* InputCircle.cs: An input control specialized for circle selection

* UserCard.cs: Displays user informations on a little div

* Estim.cs:
* WebControls.csproj:
* CircleInfo.cs:
* CircleProvider.cs:
* CircleApiController.cs:
* BasketApiController.cs:
* ITContentProvider.csproj:
* CalendarApiController.cs:
* WorkFlowApiController.cs:
* NpgsqlCircleProvider.cs:
* FrontOfficeApiController.cs:

* InputUserName.cs: Fixes the ToolBoxData attribute

* Web.csproj:
* Circle.cs: refactoring

* instdbws.sql: Foreign keys are cascading updates and deletions

* Estim.tt:
* Profile.cs: User's profile does not contain anymore the main e-mail
  address, it conflicts with registration informations, it is not part
  of the profile data
This commit is contained in:
Paul Schneider 2015-06-10 23:38:18 +02:00
commit 6680addcc8
24 changed files with 796 additions and 227 deletions

View file

@ -1,3 +1,14 @@
2015-06-10 Paul Schneider <paul@pschneider.fr>
* Circle.cs: refactoring
* CircleInfo.cs:
* CircleProvider.cs:
* Profile.cs: User's profile does not contain anymore the main
e-mail address, it conflicts with registration informations,
it is not part of the profile data
2015-06-10 Paul Schneider <paul@pschneider.fr>
* CircleManager.cs: initializes the default provider

View file

@ -23,7 +23,6 @@ using System.Collections.Generic;
namespace Yavsc.Model.Circles
{
/// <summary>
/// Circle.
/// </summary>
@ -40,11 +39,17 @@ namespace Yavsc.Model.Circles
/// <value>The title.</value>
public string Title { get; set; }
/// <summary>
/// Gets or sets the owner.
/// </summary>
/// <value>The owner.</value>
public string Owner { get; set; }
/// <summary>
/// Gets or sets the users.
/// </summary>
/// <value>The users.</value>
public string [] Users { get; set; }
public string [] Members { get; set; }
/// <summary>
/// Union the specified that.
@ -54,7 +59,7 @@ namespace Yavsc.Model.Circles
{
List<string> content = new List<string>();
foreach (Circle c in those) {
foreach (string user_name in c.Users) {
foreach (string user_name in c.Members) {
if (!content.Contains (user_name))
content.Add (user_name);
}

View file

@ -30,13 +30,19 @@ namespace Yavsc.Model.Circles
/// </summary>
public class CircleInfo
{
long Id { get; set; }
string Title { get; set; }
CircleInfo(Circle c)
public long Id { get; set; }
public string Title { get; set; }
public CircleInfo(Circle c)
{
Id = c.Id;
Title = c.Title;
}
public CircleInfo(long id, string title)
{
Id = id;
Title = title;
}
}
}

View file

@ -39,27 +39,38 @@ namespace Yavsc.Model.Circles
/// <param name="owner">Owner.</param>
/// <param name="title">Title.</param>
/// <param name="users">Users.</param>
public abstract void Add(string owner, string title, string [] users);
public abstract long Create(string owner, string title, string [] users);
/// <summary>
/// Delete the specified owner and title.
/// Add the specified user.
/// </summary>
/// <param name="owner">Owner.</param>
/// <param name="title">Title.</param>
public abstract void Delete(string owner, string title) ;
/// <param name="id">circle Identifier.</param>
/// <param name="username">User name.</param>
public abstract void Add(long id, string username);
/// <summary>
/// Get the specified owner and title.
/// Remove the specified user.
/// </summary>
/// <param name="owner">Owner.</param>
/// <param name="title">Title.</param>
public abstract Circle Get(string owner, string title);
/// <param name="id">circle Identifier.</param>
/// <param name="username">User name.</param>
public abstract void Remove(long id, string username);
/// <summary>
/// Delete the specified id.
/// </summary>
/// <param name="id">Identifier.</param>
public abstract void Delete(long id) ;
/// <summary>
/// Get the specified id.
/// </summary>
/// <param name="id">Identifier.</param>
public abstract Circle Get(long id);
/// <summary>
/// List this instance.
/// </summary>
public abstract CircleInfoCollection List();
public abstract CircleInfoCollection List(string user);
}

View file

@ -13,8 +13,6 @@ namespace Yavsc.Model.RolesAndMembers
/// </summary>
public class Profile
{
/// <summary>
/// Gets or sets the name.
/// </summary>
@ -107,14 +105,6 @@ namespace Yavsc.Model.RolesAndMembers
[StringLength (15)]
public string Mobile { get; set; }
/// <summary>
/// Gets or sets the email.
/// </summary>
/// <value>The email.</value>
[DisplayName ("E-mail")]
[StringLength (1024)]
public string Email { get; set; }
/// <summary>
/// Gets or sets the BI.
/// </summary>
@ -187,7 +177,10 @@ namespace Yavsc.Model.RolesAndMembers
( string.IsNullOrWhiteSpace (BIC)
|| string.IsNullOrWhiteSpace (IBAN))
); } }
/// <summary>
/// Gets a value indicating whether this instance has postal address.
/// </summary>
/// <value><c>true</c> if this instance has postal address; otherwise, <c>false</c>.</value>
public bool HasPostalAddress {
get {
return !string.IsNullOrWhiteSpace (Address)
@ -206,23 +199,24 @@ namespace Yavsc.Model.RolesAndMembers
/// <value><c>true</c> if this instance is billable; otherwise, <c>false</c>.</value>
public bool IsBillable {
get {
// true if
// true if has a name and, either a postal address, an email, or a Mobile phone number
// 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 (Address)
|| string.IsNullOrWhiteSpace (CityAndState)
|| string.IsNullOrWhiteSpace (ZipCode))
&& string.IsNullOrWhiteSpace (Email)
&& string.IsNullOrWhiteSpace (Phone)
&& string.IsNullOrWhiteSpace (Mobile));
}
}
/// <summary>
/// Gets or sets the name of the user.
/// </summary>
/// <value>The name of the user.</value>
public string UserName { get ; set; }
public Profile () : base ()
@ -276,9 +270,6 @@ namespace Yavsc.Model.RolesAndMembers
UserName = profile.UserName;
MembershipUser u = Membership.GetUser (profile.UserName);
Email = u.Email;
s = profile.GetPropertyValue ("BankCode");
BankCode = (s is DBNull) ? null : (string)s;