* rc20-alpah2 + empty Model set from Yavsc

main
Paul Schneider 8 years ago
parent f7d4447594
commit 1ea3cb749c
6 changed files with 9 additions and 14 deletions

@ -11,16 +11,12 @@ namespace Yavsc.Models.Messaging
public class EstimationEvent: IEvent public class EstimationEvent: IEvent
{ {
public EstimationEvent(ApplicationDbContext context, Estimate estimate, IStringLocalizer SR) public EstimationEvent( Estimate estimate, IStringLocalizer SR)
{ {
Topic = "Estimation"; Topic = "Estimation";
Estimation = estimate; Estimation = estimate;
perfer = context.Performers.Include( perfer = estimate.Owner;
p=>p.Performer
).FirstOrDefault(
p => p.PerformerId == estimate.OwnerId
);
// Use estimate.OwnerId;
ProviderInfo = new ProviderClientInfo { ProviderInfo = new ProviderClientInfo {
Rate = perfer.Rate, Rate = perfer.Rate,
UserName = perfer.Performer.UserName, UserName = perfer.Performer.UserName,
@ -52,7 +48,7 @@ namespace Yavsc.Models.Messaging
public string CreateBody() public string CreateBody()
{ {
return string.Format(_localizer["EstimationMessageToClient"], perfer.Performer.UserName, this.Estimation.Bill.Addition()); return string.Format( _localizer["EstimationMessageToClient"], perfer.Performer.UserName, this.Estimation.Bill.Addition());
} }
} }
} }

@ -125,7 +125,7 @@ namespace Yavsc.ApiControllers
// Notify the client // Notify the client
var locstr = _localizer["EstimationMessageToClient"]; 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(); var regids = estimate.Client.Devices.Select(d => d.GCMRegistrationId).ToArray();
bool gcmSent = false; bool gcmSent = false;

@ -9,6 +9,6 @@ namespace Yavsc.Models.Access
} }
// Abstract method to compute any authorization on a resource // 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 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,2 +1 @@
20-alpha2 20-alpha3
Loading…