Refactoring book query

vnext
Paul Schneider 5 years ago
parent 7559b09103
commit d36c594027
9 changed files with 152 additions and 18 deletions

@ -1,6 +1,6 @@
SOURCE_DIR=$(HOME)/workspace/yavsc
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)
include $(MAKEFILE_DIR)/versioning.mk
include $(MAKEFILE_DIR)/dnx.mk

@ -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; }
}
}

@ -49,8 +49,7 @@ using Interfaces.Workflow;
public string CreateBody()
{
return string.Format(
ResourcesHelpers.GlobalLocalizer["RdvToPerf"],
return string.Format(Resources.RdvToPerf,
Client.UserName,
EventDate?.ToString("dddd dd/MM/yyyy à HH:mm"),
Location.Address,

@ -0,0 +1,13 @@
namespace Yavsc.Models.Messaging
{
public enum Reason : byte
{
Private,
Corporate,
SearchingAPro,
Selling,
Buying,
ServiceProposal
}
}

@ -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,19 +1,12 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Interfaces;
namespace Yavsc.Models.Messaging
{
public enum Reason: byte {
Private,
Corporate,
SearchingAPro,
Selling,
Buying,
ServiceProposal
}
public class Announce: BaseEvent, IOwned
public class Announce : BaseEvent, IAnnounce, IOwned
{
public Reason For { get; set; }
@ -28,7 +21,7 @@ namespace Yavsc.Models.Messaging
public string Message { get; set; }
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);
var hubClient = hubContext.Clients.Client(cxid);
var data = new Dictionary<string, object>();
data["event"] = ev;
data["event"] = JsonConvert.SerializeObject(ev);
hubClient.push(ev.Topic, JsonConvert.SerializeObject(data));
}

@ -1 +1 @@
1.0.6-rc06
1.0.6-rc07

Loading…