* rc20-alpah2 + empty Model set from Yavsc
This commit is contained in:
@ -125,7 +125,7 @@ namespace Yavsc.ApiControllers
|
||||
// Notify the client
|
||||
var locstr = _localizer["EstimationMessageToClient"];
|
||||
|
||||
var yaev = new EstimationEvent(dbContext,estimate,_localizer);
|
||||
var yaev = new EstimationEvent(estimate,_localizer);
|
||||
|
||||
var regids = estimate.Client.Devices.Select(d => d.GCMRegistrationId).ToArray();
|
||||
bool gcmSent = false;
|
||||
|
@ -9,6 +9,6 @@ namespace Yavsc.Models.Access
|
||||
|
||||
}
|
||||
// Abstract method to compute any authorization on a resource
|
||||
public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement);
|
||||
public abstract bool Allow(string userId, TResource resource, TRequirement requirement);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace Yavsc.Models.Access
|
||||
{
|
||||
public abstract class RuleSet <TResource,TRequirement>:List<Rule<TResource,TRequirement>> {
|
||||
|
||||
public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement);
|
||||
public abstract bool Allow(string userId, TResource resource, TRequirement requirement);
|
||||
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
using System.Linq;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Interfaces.Workflow;
|
||||
using Billing;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
public class EstimationEvent: IEvent
|
||||
{
|
||||
public EstimationEvent(ApplicationDbContext context, Estimate estimate, IStringLocalizer SR)
|
||||
{
|
||||
Topic = "Estimation";
|
||||
Estimation = estimate;
|
||||
perfer = context.Performers.Include(
|
||||
p=>p.Performer
|
||||
).FirstOrDefault(
|
||||
p => p.PerformerId == estimate.OwnerId
|
||||
);
|
||||
// Use estimate.OwnerId;
|
||||
ProviderInfo = new ProviderClientInfo {
|
||||
Rate = perfer.Rate,
|
||||
UserName = perfer.Performer.UserName,
|
||||
Avatar = perfer.Performer.Avatar,
|
||||
UserId = perfer.PerformerId
|
||||
};
|
||||
Sender = perfer.Performer.UserName;
|
||||
_localizer = SR;
|
||||
}
|
||||
// TODO via e-mail only: Message = string.Format(
|
||||
// SR["EstimationMessageToClient"],perfer.Performer.UserName, estimate.Title,estimate.Bill.Addition());
|
||||
//
|
||||
ProviderClientInfo ProviderInfo { get; set; }
|
||||
Estimate Estimation { get; set; }
|
||||
|
||||
private PerformerProfile perfer;
|
||||
|
||||
public string Topic
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Sender
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private IStringLocalizer _localizer;
|
||||
|
||||
public string CreateBody()
|
||||
{
|
||||
return string.Format(_localizer["EstimationMessageToClient"], perfer.Performer.UserName, this.Estimation.Bill.Addition());
|
||||
}
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
<dependencies>
|
||||
<dependency id="Yavsc.Abstract" version="$version$"></dependency>
|
||||
<dependency id="Yavsc.Server" version="$version$"></dependency>
|
||||
</dependencies>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="bin/$config$/dnx451/Yavsc.dll" target="lib/portable-net45+win8+wp8+wpa81+Xamarin.Mac+MonoAndroid10+MonoTouch10+Xamarin.iOS10" />
|
||||
|
Reference in New Issue
Block a user