en supprimant Yavsc.Api
This commit is contained in:
parent
46295cc25e
commit
a44f99ce8d
102 changed files with 326 additions and 80 deletions
|
|
@ -1,26 +0,0 @@
|
||||||
|
|
||||||
namespace Yavsc.Models.Market {
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
public enum BillingMode {
|
|
||||||
Unitary,
|
|
||||||
SetPrice,
|
|
||||||
ByExecutionTime
|
|
||||||
}
|
|
||||||
public partial class Service : BaseProduct
|
|
||||||
{
|
|
||||||
public string ContextId { get; set; }
|
|
||||||
[ForeignKey("ContextId")]
|
|
||||||
public virtual Activity Context { get; set; }
|
|
||||||
|
|
||||||
public BillingMode? Billing { get; set; }
|
|
||||||
// TODO public ServiceSpecification Specification { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// In euro, either by hour or by release
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public decimal? Pricing { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -24,8 +24,7 @@
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": {
|
"net451": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Yavsc.Client": "1.0.0-*"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -751,13 +751,9 @@
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"lib/net45/_._": {}
|
"lib/net45/_._": {}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Yavsc.Client/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"framework": ".NETPortable,Version=v4.5,Profile=Profile111"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
".NETFramework,Version=v4.5.1/win7-x86": {
|
".NETFramework,Version=v4.5.1/debian.8-x86": {
|
||||||
"EntityFramework.Commands/7.0.0-rc1-final": {
|
"EntityFramework.Commands/7.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -1506,13 +1502,9 @@
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"lib/net45/_._": {}
|
"lib/net45/_._": {}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Yavsc.Client/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"framework": ".NETPortable,Version=v4.5,Profile=Profile111"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
".NETFramework,Version=v4.5.1/win7-x64": {
|
".NETFramework,Version=v4.5.1/debian.8-x64": {
|
||||||
"EntityFramework.Commands/7.0.0-rc1-final": {
|
"EntityFramework.Commands/7.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -2261,18 +2253,10 @@
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"lib/net45/_._": {}
|
"lib/net45/_._": {}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Yavsc.Client/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"framework": ".NETPortable,Version=v4.5,Profile=Profile111"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libraries": {
|
"libraries": {
|
||||||
"Yavsc.Client/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"path": "../wrap/Yavsc.Client/project.json"
|
|
||||||
},
|
|
||||||
"EntityFramework.Commands/7.0.0-rc1-final": {
|
"EntityFramework.Commands/7.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"serviceable": true,
|
"serviceable": true,
|
||||||
|
|
@ -3057,8 +3041,6 @@
|
||||||
"Newtonsoft.Json >= 9.0.1",
|
"Newtonsoft.Json >= 9.0.1",
|
||||||
"System.Json >= 4.0.20126.16343"
|
"System.Json >= 4.0.20126.16343"
|
||||||
],
|
],
|
||||||
".NETFramework,Version=v4.5.1": [
|
".NETFramework,Version=v4.5.1": []
|
||||||
"Yavsc.Client >= 1.0.0-*"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
99
Yavsc/Helpers/SimpleJsonPostMethod.cs
Normal file
99
Yavsc/Helpers/SimpleJsonPostMethod.cs
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
//
|
||||||
|
// PostJson.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.Net;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Json;
|
||||||
|
|
||||||
|
namespace Yavsc.Helpers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Simple json post method.
|
||||||
|
/// </summary>
|
||||||
|
public class SimpleJsonPostMethod : IDisposable
|
||||||
|
{
|
||||||
|
private HttpWebRequest request=null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the Yavsc.Helpers.SimpleJsonPostMethod class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pathToMethod">Path to method.</param>
|
||||||
|
public SimpleJsonPostMethod (string pathToMethod, string authorizationHeader = null)
|
||||||
|
{
|
||||||
|
request = (HttpWebRequest) WebRequest.Create (pathToMethod);
|
||||||
|
request.Method = "POST";
|
||||||
|
request.Accept = "application/json";
|
||||||
|
request.ContentType = "application/json";
|
||||||
|
request.SendChunked = true;
|
||||||
|
request.TransferEncoding = "UTF-8";
|
||||||
|
if (authorizationHeader!=null)
|
||||||
|
request.Headers["Authorization"]=authorizationHeader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
request.Abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invoke the specified query.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query">Query.</param>
|
||||||
|
public TAnswer Invoke<TAnswer>(object query)
|
||||||
|
{
|
||||||
|
|
||||||
|
using (Stream streamQuery = request.GetRequestStream()) {
|
||||||
|
using (StreamWriter writer = new StreamWriter(streamQuery)) {
|
||||||
|
writer.Write (JsonConvert.SerializeObject(query));
|
||||||
|
}}
|
||||||
|
TAnswer ans = default (TAnswer);
|
||||||
|
using (WebResponse response = request.GetResponse ()) {
|
||||||
|
using (Stream responseStream = response.GetResponseStream ()) {
|
||||||
|
using (StreamReader rdr = new StreamReader (responseStream)) {
|
||||||
|
ans = (TAnswer) JsonConvert.DeserializeObject<TAnswer> (rdr.ReadToEnd ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<JsonValue> InvokeJson(object query)
|
||||||
|
{
|
||||||
|
JsonValue jsonDoc=null;
|
||||||
|
using (Stream streamQuery = request.GetRequestStream()) {
|
||||||
|
using (StreamWriter writer = new StreamWriter(streamQuery)) {
|
||||||
|
writer.Write (JsonConvert.SerializeObject(query));
|
||||||
|
}}
|
||||||
|
using (WebResponse response = request.GetResponse ()) {
|
||||||
|
using (Stream stream = response.GetResponseStream ()) {
|
||||||
|
if (stream.Length>0)
|
||||||
|
jsonDoc = await Task.Run (() => JsonObject.Load (stream));
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
return jsonDoc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
9
Yavsc/Interfaces/IAccountBalance.cs
Normal file
9
Yavsc/Interfaces/IAccountBalance.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace Yavsc.Models
|
||||||
|
{
|
||||||
|
public interface IAccountBalance
|
||||||
|
{
|
||||||
|
long ContactCredits { get; set; }
|
||||||
|
decimal Credits { get; set; }
|
||||||
|
string UserId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
16
Yavsc/Interfaces/IApplicationUser.cs
Normal file
16
Yavsc/Interfaces/IApplicationUser.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Yavsc.Models.Identity;
|
||||||
|
|
||||||
|
namespace Yavsc.Models
|
||||||
|
{
|
||||||
|
public interface IApplicationUser
|
||||||
|
{
|
||||||
|
IAccountBalance AccountBalance { get; set; }
|
||||||
|
IList<IContact> Book { get; set; }
|
||||||
|
IList<ICircle> Circles { get; set; }
|
||||||
|
string DedicatedGoogleCalendar { get; set; }
|
||||||
|
IList<IGoogleCloudMobileDeclaration> Devices { get; set; }
|
||||||
|
ILocation PostalAddress { get; set; }
|
||||||
|
IList<IBlog> Posts { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Yavsc/Interfaces/IBlog.cs
Normal file
17
Yavsc/Interfaces/IBlog.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Yavsc.Models
|
||||||
|
{
|
||||||
|
public interface IBlog
|
||||||
|
{
|
||||||
|
string AuthorId { get; set; }
|
||||||
|
string bcontent { get; set; }
|
||||||
|
long Id { get; set; }
|
||||||
|
DateTime modified { get; set; }
|
||||||
|
string photo { get; set; }
|
||||||
|
DateTime posted { get; set; }
|
||||||
|
int rate { get; set; }
|
||||||
|
string title { get; set; }
|
||||||
|
bool visible { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Yavsc/Interfaces/ICircle.cs
Normal file
13
Yavsc/Interfaces/ICircle.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Yavsc.Models
|
||||||
|
{
|
||||||
|
public interface ICircle
|
||||||
|
{
|
||||||
|
long Id { get; set; }
|
||||||
|
IList<ICircleMember> Members { get; set; }
|
||||||
|
string Name { get; set; }
|
||||||
|
IApplicationUser Owner { get; set; }
|
||||||
|
string OwnerId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Yavsc/Interfaces/ICircleMember.cs
Normal file
9
Yavsc/Interfaces/ICircleMember.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace Yavsc.Models
|
||||||
|
{
|
||||||
|
public interface ICircleMember
|
||||||
|
{
|
||||||
|
ICircle Circle { get; set; }
|
||||||
|
long Id { get; set; }
|
||||||
|
IApplicationUser Member { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Yavsc/Interfaces/IContact.cs
Normal file
9
Yavsc/Interfaces/IContact.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace Yavsc.Models
|
||||||
|
{
|
||||||
|
public interface IContact
|
||||||
|
{
|
||||||
|
IApplicationUser Owner { get; set; }
|
||||||
|
string OwnerId { get; set; }
|
||||||
|
string UserId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
18
Yavsc/Interfaces/IGoogleCloudMobileDeclaration.cs
Normal file
18
Yavsc/Interfaces/IGoogleCloudMobileDeclaration.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
namespace Yavsc.Models.Identity
|
||||||
|
{
|
||||||
|
public interface IGCMDeclaration
|
||||||
|
{
|
||||||
|
string DeviceId { get; set; }
|
||||||
|
string GCMRegistrationId { get; set; }
|
||||||
|
string Model { get; set; }
|
||||||
|
string Platform { get; set; }
|
||||||
|
string Version { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IGoogleCloudMobileDeclaration: IGCMDeclaration
|
||||||
|
{
|
||||||
|
IApplicationUser DeviceOwner { get; set; }
|
||||||
|
string DeviceOwnerId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Yavsc/Interfaces/ILocation.cs
Normal file
8
Yavsc/Interfaces/ILocation.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace Yavsc
|
||||||
|
{
|
||||||
|
public interface ILocation
|
||||||
|
{
|
||||||
|
string Address { get; set; }
|
||||||
|
long Id { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Yavsc/Interfaces/IPosition.cs
Normal file
8
Yavsc/Interfaces/IPosition.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace Yavsc
|
||||||
|
{
|
||||||
|
public interface IPosition
|
||||||
|
{
|
||||||
|
double Latitude { get; set; }
|
||||||
|
double Longitude { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ namespace Yavsc.Models
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public virtual IApplicationUser Owner { get; set; }
|
public virtual ApplicationUser Owner { get; set; }
|
||||||
|
|
||||||
[Required,Display(Name="Credits in €")]
|
[Required,Display(Name="Credits in €")]
|
||||||
public decimal Credits { get; set; }
|
public decimal Credits { get; set; }
|
||||||
11
Yavsc/Model/Billing/Contract.cs
Normal file
11
Yavsc/Model/Billing/Contract.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
using Yavsc.Models.Market;
|
||||||
|
|
||||||
|
namespace Yavsc.Models.Billing
|
||||||
|
{
|
||||||
|
|
||||||
|
public class ServiceContract<P> where P : Service
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ using Yavsc.Models.Booking;
|
||||||
|
|
||||||
namespace Yavsc.Models.Billing
|
namespace Yavsc.Models.Billing
|
||||||
{
|
{
|
||||||
public partial class RDVEstimate
|
public partial class Estimate
|
||||||
{
|
{
|
||||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Yavsc.Models.Billing
|
namespace Yavsc.Models.Billing
|
||||||
{
|
{
|
||||||
public partial class EstimateAgreement : RDVEstimate
|
public partial class Contract : Estimate
|
||||||
{
|
{
|
||||||
|
[Required]
|
||||||
public DateTime ClientValidationDate { get; set; }
|
public DateTime ClientValidationDate { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,22 +4,28 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
public partial class Blog: IBlog
|
public partial class Blog
|
||||||
{
|
{
|
||||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
[Display(Name="Content")]
|
||||||
public string bcontent { get; set; }
|
public string bcontent { get; set; }
|
||||||
|
|
||||||
[DisplayAttribute(Name="Modified")]
|
[Display(Name="Modified")]
|
||||||
public DateTime modified { get; set; }
|
public DateTime modified { get; set; }
|
||||||
|
[Display(Name="Photo")]
|
||||||
public string photo { get; set; }
|
public string photo { get; set; }
|
||||||
|
[Display(Name="Posted")]
|
||||||
public DateTime posted { get; set; }
|
public DateTime posted { get; set; }
|
||||||
|
[Display(Name="Rate")]
|
||||||
public int rate { get; set; }
|
public int rate { get; set; }
|
||||||
|
[Display(Name="Title")]
|
||||||
public string title { get; set; }
|
public string title { get; set; }
|
||||||
[Required]
|
|
||||||
public string AuthorId { get; set; }
|
public string AuthorId { get; set; }
|
||||||
[ForeignKey("AuthorId")]
|
[ForeignKey("AuthorId")]
|
||||||
public IApplicationUser Author { set; get; }
|
public ApplicationUser Author { set; get; }
|
||||||
|
[Display(Name="Visible")]
|
||||||
public bool visible { get; set; }
|
public bool visible { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,25 +8,25 @@ using Yavsc.Models.Identity;
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
|
|
||||||
public class ApplicationUser : IdentityUser, IApplicationUser
|
public class ApplicationUser : IdentityUser
|
||||||
{
|
{
|
||||||
|
|
||||||
[Display(Name="AccountBalance")]
|
[Display(Name="AccountBalance")]
|
||||||
public virtual IAccountBalance AccountBalance { get; set; }
|
public virtual AccountBalance AccountBalance { get; set; }
|
||||||
|
|
||||||
[InverseProperty("Author")]
|
[InverseProperty("Author")]
|
||||||
public virtual IList<IBlog> Posts { get; set; }
|
public virtual List<Blog> Posts { get; set; }
|
||||||
|
|
||||||
[InverseProperty("Owner")]
|
[InverseProperty("Owner")]
|
||||||
public virtual IList<IContact> Book { get; set; }
|
public virtual List<Contact> Book { get; set; }
|
||||||
|
|
||||||
[InverseProperty("DeviceOwner")]
|
[InverseProperty("DeviceOwner")]
|
||||||
public virtual IList<IGoogleCloudMobileDeclaration> Devices { get; set; }
|
public virtual List<GoogleCloudMobileDeclaration> Devices { get; set; }
|
||||||
|
|
||||||
[InverseProperty("Owner")]
|
[InverseProperty("Owner")]
|
||||||
|
|
||||||
public virtual IList<ICircle> Circles { get; set; }
|
public virtual List<Circle> Circles { get; set; }
|
||||||
public virtual ILocation PostalAddress { get; set; }
|
public virtual Location PostalAddress { get; set; }
|
||||||
|
|
||||||
public string DedicatedGoogleCalendar { get; set; }
|
public string DedicatedGoogleCalendar { get; set; }
|
||||||
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
@ -18,7 +19,7 @@ namespace Yavsc.Models.Identity
|
||||||
public string Platform { get; set; }
|
public string Platform { get; set; }
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
public string DeviceOwnerId { get; set; }
|
public string DeviceOwnerId { get; set; }
|
||||||
|
public DateTime DeclarationDate { get; set; }
|
||||||
[JsonIgnore,ForeignKey("DeviceOwnerId")]
|
[JsonIgnore,ForeignKey("DeviceOwnerId")]
|
||||||
public virtual ApplicationUser DeviceOwner { get; set; }
|
public virtual ApplicationUser DeviceOwner { get; set; }
|
||||||
}
|
}
|
||||||
67
Yavsc/Model/Market/Service.cs
Normal file
67
Yavsc/Model/Market/Service.cs
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
|
||||||
|
namespace Yavsc.Models.Market {
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
public enum BillingMode {
|
||||||
|
Unitary,
|
||||||
|
SetPrice,
|
||||||
|
ByExecutionTime
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IUnit<VType> {
|
||||||
|
string Name { get; }
|
||||||
|
bool CanConvertFrom(IUnit<VType> other);
|
||||||
|
VType ConvertFrom (IUnit<VType> other, VType orgValue) ;
|
||||||
|
}
|
||||||
|
public class Money : IUnit<decimal>
|
||||||
|
{
|
||||||
|
public Money(string name, decimal euroExchangeRate)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
EuroExchangeRate = euroExchangeRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get; private set ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public decimal EuroExchangeRate
|
||||||
|
{
|
||||||
|
get; private set ;
|
||||||
|
}
|
||||||
|
public bool CanConvertFrom(IUnit<decimal> other)
|
||||||
|
{
|
||||||
|
if (other is Money)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public decimal ConvertFrom(IUnit<decimal> other, decimal orgValue)
|
||||||
|
{
|
||||||
|
if (other is Money) {
|
||||||
|
var om = other as Money;
|
||||||
|
return orgValue * om.EuroExchangeRate / EuroExchangeRate;
|
||||||
|
}
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Service : BaseProduct
|
||||||
|
{
|
||||||
|
public string ContextId { get; set; }
|
||||||
|
[ForeignKey("ContextId")]
|
||||||
|
public virtual Activity Context { get; set; }
|
||||||
|
|
||||||
|
public BillingMode? Billing { get; set; }
|
||||||
|
// TODO public ServiceSpecification Specification { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// In euro
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public decimal? Pricing { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
public partial class Circle: ICircle {
|
public partial class Circle {
|
||||||
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
|
@ -13,9 +13,9 @@ namespace Yavsc.Models
|
||||||
public string OwnerId { get; set; }
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("OwnerId")]
|
[ForeignKey("OwnerId")]
|
||||||
public virtual IApplicationUser Owner { get; set; }
|
public virtual ApplicationUser Owner { get; set; }
|
||||||
|
|
||||||
[InverseProperty("Circle")]
|
[InverseProperty("Circle")]
|
||||||
public virtual IList<ICircleMember> Members { get; set; }
|
public virtual List<CircleMember> Members { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
public class Contact: IContact
|
public class Contact
|
||||||
{
|
{
|
||||||
[Required()]
|
[Required()]
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
@ -13,6 +13,6 @@ namespace Yavsc.Models
|
||||||
public string OwnerId { get; set; }
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
[ForeignKeyAttribute("OwnerId")]
|
[ForeignKeyAttribute("OwnerId")]
|
||||||
public virtual IApplicationUser Owner { get; set; }
|
public virtual ApplicationUser Owner { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ namespace Yavsc
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Position.
|
/// Position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Position: IPosition
|
public class Position
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The longitude.
|
/// The longitude.
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Yavsc
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Location : Position, ILocation {
|
public class Location : Position {
|
||||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
[Required(),
|
[Required(),
|
||||||
|
|
@ -36,7 +36,5 @@ namespace Yavsc.Models
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
string ModeratorGroupName { get; set; }
|
string ModeratorGroupName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,8 +8,8 @@ namespace Yavsc.Models.Workflow
|
||||||
public class PerformerProfile {
|
public class PerformerProfile {
|
||||||
|
|
||||||
[Key]
|
[Key]
|
||||||
public string PerfomerId { get; set; }
|
public string PerformerId { get; set; }
|
||||||
[ForeignKey("PerfomerId"),Display(Name="Performer")]
|
[ForeignKey("PerformerId"),Display(Name="Performer")]
|
||||||
public virtual ApplicationUser Performer { get; set; }
|
public virtual ApplicationUser Performer { get; set; }
|
||||||
|
|
||||||
[Display(Name="Activity"),Required]
|
[Display(Name="Activity"),Required]
|
||||||
|
|
@ -21,10 +21,10 @@ namespace Yavsc.Models.Workflow
|
||||||
RegularExpression(@"^[0-9]{9,14}$", ErrorMessage = "Only numbers are allowed here")]
|
RegularExpression(@"^[0-9]{9,14}$", ErrorMessage = "Only numbers are allowed here")]
|
||||||
public string SIREN { get; set; }
|
public string SIREN { get; set; }
|
||||||
|
|
||||||
public long OrganisationAddressId { get; set; }
|
public long OrganizationAddressId { get; set; }
|
||||||
|
|
||||||
[Required,Display(Name="Organisation address"),ForeignKey("OrganisationAddressId")]
|
[Required,Display(Name="Organization address"),ForeignKey("OrganizationAddressId")]
|
||||||
public virtual Location OrganisationAddress { get; set; }
|
public virtual Location OrganizationAddress { get; set; }
|
||||||
|
|
||||||
[ForeignKey("ActivityCode"),Display(Name="Activity")]
|
[ForeignKey("ActivityCode"),Display(Name="Activity")]
|
||||||
public virtual Activity Activity { get; set; }
|
public virtual Activity Activity { get; set; }
|
||||||
|
|
@ -35,8 +35,8 @@ namespace Yavsc.Models.Workflow
|
||||||
[Display(Name="Accept notifications from non-VIP users")]
|
[Display(Name="Accept notifications from non-VIP users")]
|
||||||
public bool AcceptPublicContact { get; set; }
|
public bool AcceptPublicContact { get; set; }
|
||||||
|
|
||||||
[Display(Name="Allow my geolocatisation, nearby my clients")]
|
[Display(Name="Allow my geo-localization, nearby my clients")]
|
||||||
public bool AcceptGeoLocalisation { get; set; }
|
public bool AcceptGeoLocalization { get; set; }
|
||||||
|
|
||||||
[Display(Name="Web site")]
|
[Display(Name="Web site")]
|
||||||
public string WebSite { get; set; }
|
public string WebSite { get; set; }
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue