Refactoring book query
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
SOURCE_DIR=$(HOME)/workspace/yavsc
|
SOURCE_DIR=$(HOME)/workspace/yavsc
|
||||||
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
|
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
|
||||||
BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx
|
BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx Resources/Yavsc.Models.Messaging.Resources.resx
|
||||||
BASERESXGEN=$(BASERESX:.resx=.Designer.cs)
|
BASERESXGEN=$(BASERESX:.resx=.Designer.cs)
|
||||||
include $(MAKEFILE_DIR)/versioning.mk
|
include $(MAKEFILE_DIR)/versioning.mk
|
||||||
include $(MAKEFILE_DIR)/dnx.mk
|
include $(MAKEFILE_DIR)/dnx.mk
|
||||||
|
12
src/Yavsc.Abstract/Messaging/IAnnounce.cs
Normal file
12
src/Yavsc.Abstract/Messaging/IAnnounce.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Yavsc.Interfaces;
|
||||||
|
|
||||||
|
namespace Yavsc.Models.Messaging
|
||||||
|
{
|
||||||
|
public interface IAnnounce : IOwned {
|
||||||
|
Reason For { get; set; }
|
||||||
|
string Message { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace Yavsc.Models.Messaging
|
namespace Yavsc.Models.Messaging
|
||||||
{
|
{
|
||||||
using Interfaces.Workflow;
|
using Interfaces.Workflow;
|
||||||
using Yavsc.Abstract.Messaging;
|
using Yavsc.Abstract.Messaging;
|
||||||
|
|
||||||
public class RdvQueryEvent: RdvQueryProviderInfo, IEvent
|
public class RdvQueryEvent: RdvQueryProviderInfo, IEvent
|
||||||
@ -49,8 +49,7 @@ using Interfaces.Workflow;
|
|||||||
|
|
||||||
public string CreateBody()
|
public string CreateBody()
|
||||||
{
|
{
|
||||||
return string.Format(
|
return string.Format(Resources.RdvToPerf,
|
||||||
ResourcesHelpers.GlobalLocalizer["RdvToPerf"],
|
|
||||||
Client.UserName,
|
Client.UserName,
|
||||||
EventDate?.ToString("dddd dd/MM/yyyy à HH:mm"),
|
EventDate?.ToString("dddd dd/MM/yyyy à HH:mm"),
|
||||||
Location.Address,
|
Location.Address,
|
13
src/Yavsc.Abstract/Messaging/Reason.cs
Normal file
13
src/Yavsc.Abstract/Messaging/Reason.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace Yavsc.Models.Messaging
|
||||||
|
{
|
||||||
|
public enum Reason : byte
|
||||||
|
{
|
||||||
|
Private,
|
||||||
|
Corporate,
|
||||||
|
SearchingAPro,
|
||||||
|
Selling,
|
||||||
|
Buying,
|
||||||
|
ServiceProposal
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
52
src/Yavsc.Abstract/Resources/Yavsc.Models.Messaging.Resources.Designer.cs
generated
Normal file
52
src/Yavsc.Abstract/Resources/Yavsc.Models.Messaging.Resources.Designer.cs
generated
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Yavsc.Models.Messaging {
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
public partial class Resources {
|
||||||
|
|
||||||
|
private static System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
public static System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.Equals(null, resourceMan)) {
|
||||||
|
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Abstract.Resources." + "Yavsc.Models.Messaging.Resources"), typeof(Resources).GetTypeInfo().Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
public static System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string RdvToPerf {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("RdvToPerf", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<!--
|
||||||
|
route name for the api controller used to tag the 'BlogPost' entity
|
||||||
|
-->
|
||||||
|
<data name="RdvToPerf"><value>Rendez-vous professionnel</value></data>
|
||||||
|
</root>
|
@ -1,23 +1,16 @@
|
|||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Yavsc.Interfaces;
|
using Yavsc.Interfaces;
|
||||||
|
|
||||||
namespace Yavsc.Models.Messaging
|
namespace Yavsc.Models.Messaging
|
||||||
{
|
{
|
||||||
public enum Reason: byte {
|
|
||||||
Private,
|
|
||||||
Corporate,
|
|
||||||
SearchingAPro,
|
|
||||||
Selling,
|
|
||||||
Buying,
|
|
||||||
ServiceProposal
|
|
||||||
|
|
||||||
}
|
public class Announce : BaseEvent, IAnnounce, IOwned
|
||||||
public class Announce: BaseEvent, IOwned
|
|
||||||
{
|
{
|
||||||
public Reason For { get; set; }
|
public Reason For { get; set; }
|
||||||
|
|
||||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
public string OwnerId { get; set; }
|
public string OwnerId { get; set; }
|
||||||
@ -28,7 +21,7 @@ namespace Yavsc.Models.Messaging
|
|||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
public override string CreateBody()
|
public override string CreateBody()
|
||||||
{
|
{
|
||||||
return $"Annonce de {Owner.UserName}: {For}\n\n{Message}";
|
return $"Annonce de {Owner.UserName}: {For.ToString()}\n\n{Message}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ namespace Yavsc.Services
|
|||||||
// from usr asp.net Id : var hubClient = hubContext.Clients.User(userId);
|
// from usr asp.net Id : var hubClient = hubContext.Clients.User(userId);
|
||||||
var hubClient = hubContext.Clients.Client(cxid);
|
var hubClient = hubContext.Clients.Client(cxid);
|
||||||
var data = new Dictionary<string, object>();
|
var data = new Dictionary<string, object>();
|
||||||
data["event"] = ev;
|
data["event"] = JsonConvert.SerializeObject(ev);
|
||||||
hubClient.push(ev.Topic, JsonConvert.SerializeObject(data));
|
hubClient.push(ev.Topic, JsonConvert.SerializeObject(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
1.0.6-rc06
|
1.0.6-rc07
|
||||||
|
Reference in New Issue
Block a user