For code format

main
Paul Schneider 7 years ago
parent e70b48fed4
commit c14f749866
1 changed files with 44 additions and 40 deletions

@ -65,7 +65,7 @@ namespace Yavsc.Controllers
.Include(x => x.PerformerProfile) .Include(x => x.PerformerProfile)
.Include(x => x.PerformerProfile.Performer) .Include(x => x.PerformerProfile.Performer)
.Include(x => x.Location) .Include(x => x.Location)
.Where(x=> x.ClientId == uid || x.PerformerId == uid) .Where(x => x.ClientId == uid || x.PerformerId == uid)
.ToListAsync()); .ToListAsync());
} }
@ -155,7 +155,8 @@ namespace Yavsc.Controllers
var existingLocation = _context.Locations.FirstOrDefault(x => x.Address == command.Location.Address var existingLocation = _context.Locations.FirstOrDefault(x => x.Address == command.Location.Address
&& x.Longitude == command.Location.Longitude && x.Latitude == command.Location.Latitude); && x.Longitude == command.Location.Longitude && x.Latitude == command.Location.Latitude);
if (existingLocation!=null) { if (existingLocation != null)
{
command.Location = existingLocation; command.Location = existingLocation;
} }
else _context.Attach<Location>(command.Location); else _context.Attach<Location>(command.Location);
@ -170,14 +171,16 @@ namespace Yavsc.Controllers
&& pro.AcceptPublicContact) && pro.AcceptPublicContact)
{ {
try { try
if (pro.Performer.Devices.Count > 0) { {
_logger.LogInformation("sending GCM");
if (pro.Performer.Devices.Count > 0)
{
var regids = command.PerformerProfile.Performer var regids = command.PerformerProfile.Performer
.Devices.Select(d => d.GCMRegistrationId); .Devices.Select(d => d.GCMRegistrationId);
grep = await _GCMSender.NotifyBookQueryAsync(regids, yaev); grep = await _GCMSender.NotifyBookQueryAsync(regids, yaev);
} }
_logger.LogError("sending GCM");
// TODO setup a profile choice to allow notifications // TODO setup a profile choice to allow notifications
// both on mailbox and mobile // both on mailbox and mobile
@ -189,7 +192,8 @@ namespace Yavsc.Controllers
_logger.LogError(ex.Message); _logger.LogError(ex.Message);
} }
try { try
{
ViewBag.EmailSent = await _emailSender.SendEmailAsync( ViewBag.EmailSent = await _emailSender.SendEmailAsync(
command.PerformerProfile.Performer.UserName, command.PerformerProfile.Performer.UserName,
command.PerformerProfile.Performer.Email, command.PerformerProfile.Performer.Email,

Loading…