Refactoring: moving

the Catalog manager and model into the Yavsc.Model.FrontOffice 
namespace
* Web.config:
* Catalog.xml:
* MyClass.cs:
* Note.cs:
* Euro.cs:
* Unit.cs:
* Text.cs:
* Link.cs:
* Price.cs:
* Label.cs:
* Brand.cs:
* Scalar.cs:
* Option.cs:
* Period.cs:
* YavscModel.csproj:
* Catalog.cs:
* Service.cs:
* Product.cs:
* YavscClient.csproj:
* CatalogManager.cs:
* Currency.cs:
* CheckBox.cs:
* SaleForm.cs:
* FormInput.cs:
* CatalogProvider.cs:
* TextInput.cs:
* SelectItem.cs:
* SalesCatalog.csproj:
* FilesInput.cs:
* FormElement.cs:
* SelectInput.cs:
* IValueProvider.cs:
* StockStatus.cs:
* RadioButton.cs:
* Commande.cs:
* ProductImage.cs:
* WebCatalogExtensions.cs:
* TemplateException.cs:
* ProductCategory.cs:
* PhysicalProduct.cs:
* Note.cs:
* Link.cs:
* Text.cs:
* Euro.cs:
* Unit.cs:
* WorkFlowManager.cs:
* Brand.cs:
* Label.cs:
* Price.cs:
* Scalar.cs:
* FrontOfficeController.cs:
* Period.cs:
* Option.cs:
* Product.cs:
* Service.cs:
* Catalog.cs:
* SaleForm.cs:
* Currency.cs:
* CheckBox.cs:
* TextInput.cs:
* FrontOfficeApiController.cs:
* FormInput.cs:
* SelectItem.cs:
* FilesInput.cs:
* XmlCatalog.cs:
* FormElement.cs:
* SelectInput.cs:
* RadioButton.cs:
* StockStatus.cs:
* ProductImage.cs:
* CatalogHelper.cs:
* CatalogManager.cs:
* CatalogProvider.cs:
* ProductCategory.cs:
* PhysicalProduct.cs:
* XmlCatalogProvider.cs:
* CatalogProviderConfigurationElement.cs:
* CatalogProvidersConfigurationSection.cs:
* CatalogProvidersConfigurationCollection.cs:
* CatalogProviderConfigurationElement.cs:
* CatalogProvidersConfigurationSection.cs:
* CatalogProvidersConfigurationCollection.cs: 
* CatalogHelper.cs:
vnext
Paul Schneider 10 years ago
parent 7796467236
commit 3c6c3f19aa
49 changed files with 110 additions and 98 deletions

@ -9,6 +9,7 @@
<OutputType>Library</OutputType>
<RootNamespace>SalesCatalog</RootNamespace>
<AssemblyName>SalesCatalog</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -38,44 +39,10 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Configuration\CatalogProviderConfigurationElement.cs" />
<Compile Include="Configuration\CatalogProvidersConfigurationSection.cs" />
<Compile Include="Configuration\CatalogProvidersConfigurationCollection.cs" />
<Compile Include="CatalogManager.cs" />
<Compile Include="Model\CheckBox.cs" />
<Compile Include="Model\Currency.cs" />
<Compile Include="Model\Euro.cs" />
<Compile Include="Model\FilesInput.cs" />
<Compile Include="Model\FormElement.cs" />
<Compile Include="Model\FormInput.cs" />
<Compile Include="Model\Label.cs" />
<Compile Include="Model\Link.cs" />
<Compile Include="Model\Price.cs" />
<Compile Include="Model\ProductCategory.cs" />
<Compile Include="Model\RadioButton.cs" />
<Compile Include="Model\SelectInput.cs" />
<Compile Include="Model\TextInput.cs" />
<Compile Include="Model\Unit.cs" />
<Compile Include="Model\Brand.cs" />
<Compile Include="CatalogProvider.cs" />
<Compile Include="XmlImplementation\XmlCatalog.cs" />
<Compile Include="CatalogHelper.cs" />
<Compile Include="Tests\TestCatalogInit.cs" />
<Compile Include="Model\Product.cs" />
<Compile Include="Model\Period.cs" />
<Compile Include="Model\Service.cs" />
<Compile Include="Model\PhysicalProduct.cs" />
<Compile Include="Model\Catalog.cs" />
<Compile Include="XmlImplementation\XmlCatalogProvider.cs" />
<Compile Include="Model\Text.cs" />
<Compile Include="Model\SelectItem.cs" />
<Compile Include="Model\StockStatus.cs" />
<Compile Include="Model\Scalar.cs" />
<Compile Include="Tests\TestBrands.cs" />
<Compile Include="Model\SaleForm.cs" />
<Compile Include="Model\ProductImage.cs" />
<Compile Include="Model\Option.cs" />
<Compile Include="Model\Note.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
@ -95,4 +62,10 @@
<Folder Include="XmlImplementation\" />
<Folder Include="Tests\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\yavscModel\YavscModel.csproj">
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
<Name>YavscModel</Name>
</ProjectReference>
</ItemGroup>
</Project>

@ -1,6 +1,6 @@
using System;
using SalesCatalog.Model;
using System.Xml.Serialization;
using Yavsc.Model.FrontOffice;
namespace SalesCatalog.XmlImplementation
{

@ -1,9 +1,9 @@
using System;
using System.Xml.Serialization;
using SalesCatalog.Model;
using System.Configuration;
using System.IO;
using System.Xml;
using Yavsc.Model.FrontOffice;
namespace SalesCatalog.XmlImplementation
{

@ -1,11 +1,10 @@
using System;
using System.Web;
using SalesCatalog;
using SalesCatalog.Model;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Mvc.Html;
using Yavsc.Model.FrontOffice;
namespace Yavsc.CatExts
{

@ -38,17 +38,26 @@
<Id>comment</Id>
<Value xsi:type="xsd:string">Commentaire</Value>
</FormElement>
<!-- <FormElement xsi:type="Text">
<FormElement xsi:type="Text">
<Val>Choisissez le type d'intervention souhaité: </Val>
</FormElement>
- <FormElement xsi:type="SelectInput">
<FormElement xsi:type="TextInput">
<Id>testarray[]</Id>
<Value xsi:type="xsd:string">xxxxxxxxxx</Value>
</FormElement>
<FormElement xsi:type="TextInput">
<Id>testarray[]</Id>
<Value xsi:type="xsd:string"></Value>
</FormElement>
<FormElement xsi:type="SelectInput">
<Id>ad</Id>
<Items>
<string>à distance</string>
<string>sur site</string>
</Items>
<SelectedIndex>0</SelectedIndex>
</FormElement> -->
</FormElement>
</Items>
</DefaultForm>
</Brand>

@ -1,7 +1,6 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Web.Routing;
using System.Threading.Tasks;
using System.Diagnostics;
@ -23,6 +22,7 @@ using System.Text;
using System.Web.Profile;
using System.Collections.Specialized;
using Yavsc.Model;
using Yavsc.Model.FrontOffice;
namespace Yavsc.ApiControllers
{

@ -1,7 +1,5 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Web.Mvc;
using System.Web;
using System.Text.RegularExpressions;

@ -1,7 +1,6 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Web.Routing;
using System.Threading.Tasks;
using System.Diagnostics;

@ -1,7 +1,6 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Web.Routing;
using System.Threading.Tasks;
using System.Diagnostics;

@ -240,7 +240,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
</system.diagnostics>
<catalog defaultProvider="XmlCatalogProvider">
<providers>
<add name="XmlCatalogProvider" connection="/srv/www/yavsc/Catalog.xml" applicationName="/" type="SalesCatalog.XmlImplementation.XmlCatalogProvider, SalesCatalog" />
<add name="XmlCatalogProvider" connection="~/Catalog.xml" applicationName="/" type="SalesCatalog.XmlImplementation.XmlCatalogProvider, SalesCatalog" />
</providers>
</catalog>
<system.net>

@ -1,8 +1,7 @@
using System;
using System.Xml.Serialization;
using System.ComponentModel.DataAnnotations;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Brand
{

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
/// <summary>
/// Catalog.

@ -2,9 +2,9 @@ using System;
using System.Configuration;
using System.Reflection;
using System.Collections.Specialized;
using SalesCatalog.Configuration;
using Yavsc.Model.FrontOffice.Configuration;
namespace SalesCatalog
namespace Yavsc.Model.FrontOffice
{
/// <summary>
/// Catalog helper.

@ -1,7 +1,5 @@
using System;
using SalesCatalog.Model;
namespace SalesCatalog
namespace Yavsc.Model.FrontOffice
{
/// <summary>
/// Catalog manager.

@ -1,8 +1,7 @@
using System;
using System.Configuration.Provider;
using SalesCatalog.Model;
namespace SalesCatalog
namespace Yavsc.Model.FrontOffice
{
/// <summary>
/// Catalog provider.<br/>

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class CheckBox : FormInput
{

@ -1,7 +1,7 @@
using System;
using System.Configuration;
namespace SalesCatalog.Configuration
namespace Yavsc.Model.FrontOffice.Configuration
{
public class CatalogProviderConfigurationElement : ConfigurationElement

@ -2,7 +2,7 @@ using System;
using System.Configuration;
using System.ComponentModel;
namespace SalesCatalog.Configuration
namespace Yavsc.Model.FrontOffice.Configuration
{
public class CatalogProvidersConfigurationCollection : ConfigurationElementCollection
{

@ -2,7 +2,7 @@ using System;
using System.Configuration;
using System.ComponentModel;
namespace SalesCatalog.Configuration
namespace Yavsc.Model.FrontOffice.Configuration
{
public class CatalogProvidersConfigurationSection : ConfigurationSection
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public abstract class Currency: Unit
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Euro : Currency
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class FilesInput : FormInput
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public abstract class FormElement
{

@ -1,7 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public abstract class FormInput: FormElement
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Label:FormElement
{

@ -1,7 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Link:Label
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Note:Text
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Option : FormElement
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Period
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class PhysicalProduct : Product
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Price: Scalar
{
@ -21,7 +21,7 @@ namespace SalesCatalog.Model
}
Currency curr;
public override SalesCatalog.Model.Unit Unit {
public override Unit Unit {
get {
return curr;
}

@ -1,7 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
/// <summary>
/// Product.

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class ProductCategory
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class ProductImage: FormElement
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class RadioButton:FormInput
{

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class SaleForm
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public abstract class Scalar
{

@ -2,7 +2,7 @@ using System;
using System.Text;
using System.Web.Mvc;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class SelectInput: FormInput
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class SelectItem
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Service : Product
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public enum StockStatus
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class Text: FormElement
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public class TextInput:FormInput
{

@ -1,6 +1,6 @@
using System;
namespace SalesCatalog.Model
namespace Yavsc.Model.FrontOffice
{
public abstract class Unit
{

@ -1,9 +1,8 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Collections.Specialized;
using Yavsc.Model.WorkFlow;
using Newtonsoft.Json;
namespace Yavsc.Model.FrontOffice
@ -13,6 +12,9 @@ namespace Yavsc.Model.FrontOffice
public DateTime CreationDate { get; set; }
public long Id { get; set; }
public string ProdRef { get; set; }
public StringDictionary Parameters = new StringDictionary();
public Commande() {
}
@ -22,6 +24,11 @@ namespace Yavsc.Model.FrontOffice
// string catref=collection["catref"]; // Catalog Url from which formdata has been built
cmd.ProdRef=collection["ref"]; // Required product reference
cmd.CreationDate = DateTime.Now;
// stores the parameters:
foreach (string key in collection.AllKeys) {
cmd.Parameters.Add (key, collection [key]);
}
WorkFlowManager wm = new WorkFlowManager ();
wm.RegisterCommand (cmd); // sets cmd.Id
return cmd;

@ -3,7 +3,6 @@ using Yavsc.Model.WorkFlow;
using System.Configuration;
using Yavsc.Model.WorkFlow.Configuration;
using System.Collections.Specialized;
using SalesCatalog.Model;
using Yavsc.Model.FrontOffice;
namespace Yavsc.Model.WorkFlow
@ -111,7 +110,7 @@ namespace Yavsc.Model.WorkFlow
{
if (!string.IsNullOrWhiteSpace(productid)) {
if (Catalog == null)
Catalog = SalesCatalog.CatalogManager.GetCatalog ("/WorkFlowApi");
Catalog = CatalogManager.GetCatalog ("/WorkFlowApi");
if (Catalog == null)
throw new Exception ("No catalog");
Product p = Catalog.FindProduct (productid);

@ -99,6 +99,40 @@
<Compile Include="RssFeeds.cs" />
<Compile Include="FrontOffice\Commande.cs" />
<Compile Include="FrontOffice\Basket.cs" />
<Compile Include="FrontOffice\Catalog\Brand.cs" />
<Compile Include="FrontOffice\Catalog\Catalog.cs" />
<Compile Include="FrontOffice\Catalog\CheckBox.cs" />
<Compile Include="FrontOffice\Catalog\Currency.cs" />
<Compile Include="FrontOffice\Catalog\Euro.cs" />
<Compile Include="FrontOffice\Catalog\FilesInput.cs" />
<Compile Include="FrontOffice\Catalog\FormElement.cs" />
<Compile Include="FrontOffice\Catalog\FormInput.cs" />
<Compile Include="FrontOffice\Catalog\Label.cs" />
<Compile Include="FrontOffice\Catalog\Link.cs" />
<Compile Include="FrontOffice\Catalog\Note.cs" />
<Compile Include="FrontOffice\Catalog\Option.cs" />
<Compile Include="FrontOffice\Catalog\Period.cs" />
<Compile Include="FrontOffice\Catalog\PhysicalProduct.cs" />
<Compile Include="FrontOffice\Catalog\Price.cs" />
<Compile Include="FrontOffice\Catalog\Product.cs" />
<Compile Include="FrontOffice\Catalog\ProductCategory.cs" />
<Compile Include="FrontOffice\Catalog\ProductImage.cs" />
<Compile Include="FrontOffice\Catalog\RadioButton.cs" />
<Compile Include="FrontOffice\Catalog\SaleForm.cs" />
<Compile Include="FrontOffice\Catalog\Scalar.cs" />
<Compile Include="FrontOffice\Catalog\SelectInput.cs" />
<Compile Include="FrontOffice\Catalog\SelectItem.cs" />
<Compile Include="FrontOffice\Catalog\Service.cs" />
<Compile Include="FrontOffice\Catalog\StockStatus.cs" />
<Compile Include="FrontOffice\Catalog\Text.cs" />
<Compile Include="FrontOffice\Catalog\TextInput.cs" />
<Compile Include="FrontOffice\Catalog\Unit.cs" />
<Compile Include="FrontOffice\Catalog\Configuration\CatalogProviderConfigurationElement.cs" />
<Compile Include="FrontOffice\Catalog\Configuration\CatalogProvidersConfigurationCollection.cs" />
<Compile Include="FrontOffice\Catalog\Configuration\CatalogProvidersConfigurationSection.cs" />
<Compile Include="FrontOffice\Catalog\CatalogHelper.cs" />
<Compile Include="FrontOffice\Catalog\CatalogManager.cs" />
<Compile Include="FrontOffice\Catalog\CatalogProvider.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@ -109,12 +143,7 @@
<Folder Include="FileSystem\" />
<Folder Include="Google\" />
<Folder Include="FrontOffice\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SalesCatalog\SalesCatalog.csproj">
<Project>{90BF2234-7252-4CD5-B2A4-17501B19279B}</Project>
<Name>SalesCatalog</Name>
</ProjectReference>
<Folder Include="FrontOffice\Catalog\" />
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>

@ -1,11 +1,11 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using SalesCatalog.Model;
using System.Net.Http.Headers;
using System.Collections.Generic;
using System.Net.Http.Formatting;
using Newtonsoft.Json;
using Yavsc.Model.FrontOffice;
namespace Yavsc
{

@ -51,5 +51,9 @@
<Project>{90BF2234-7252-4CD5-B2A4-17501B19279B}</Project>
<Name>SalesCatalog</Name>
</ProjectReference>
<ProjectReference Include="..\yavscModel\YavscModel.csproj">
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
<Name>YavscModel</Name>
</ProjectReference>
</ItemGroup>
</Project>
Loading…