refactoring

vnext
Paul Schneider 10 years ago
parent 347ffc8a5a
commit b5d19c5da6
38 changed files with 149 additions and 117 deletions

@ -30,12 +30,6 @@
</PropertyGroup> </PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
<Compile Include="Configuration\BlogProviderConfigurationElement.cs" />
<Compile Include="Configuration\BlogProvidersConfigurationCollection.cs" />
<Compile Include="Configuration\BlogProvidersConfigurationSection.cs" />
<Compile Include="BlogHelper.cs" />
<Compile Include="BlogManager.cs" />
<Compile Include="BlogProvider.cs" />
<Compile Include="NpgsqlBlogProvider.cs" /> <Compile Include="NpgsqlBlogProvider.cs" />
<Compile Include="AssemblyInfo.cs" /> <Compile Include="AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>

@ -31,9 +31,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="nunit.framework, Version=2.6.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"> <Reference Include="nunit.framework, Version=2.6.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
<Package>nunit</Package>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

@ -15,13 +15,16 @@ namespace SalesCatalog.XmlImplementation
{ {
// Assert fileName != null // Assert fileName != null
FileInfo fi = new FileInfo (fileName); FileInfo fi = new FileInfo (fileName);
if (!fi.Exists)
throw new ConfigurationErrorsException(
string.Format("No catalog found ({0})",fileName));
if (fi.LastWriteTime > lastModification) if (fi.LastWriteTime > lastModification)
LoadCatalog (); LoadCatalog ();
return catInstance; return catInstance;
} }
protected XmlCatalog catInstance = null; protected XmlCatalog catInstance = null;
protected DateTime lastModification; protected DateTime lastModification = new DateTime(0);
protected string fileName = null; protected string fileName = null;
#endregion #endregion
@ -32,8 +35,9 @@ namespace SalesCatalog.XmlImplementation
} }
private void LoadCatalog () private void LoadCatalog ()
{ {
try {
FileInfo fi = new FileInfo (fileName); FileInfo fi = new FileInfo (fileName);
if (!fi.Exists) if (!fi.Exists)
throw new Exception ( throw new Exception (
string.Format ("Le fichier Xml decrivant le catalogue n'existe pas ({0})", fi.FullName)); string.Format ("Le fichier Xml decrivant le catalogue n'existe pas ({0})", fi.FullName));
XmlSerializer xsr = new XmlSerializer (typeof(XmlCatalog),new Type[]{ XmlSerializer xsr = new XmlSerializer (typeof(XmlCatalog),new Type[]{
@ -49,6 +53,11 @@ namespace SalesCatalog.XmlImplementation
} }
fileName = fi.FullName; fileName = fi.FullName;
lastModification = fi.LastWriteTime; lastModification = fi.LastWriteTime;
}
catch (Exception e) {
lastModification = new DateTime (0);
throw e;
}
} }
} }
} }

@ -38,10 +38,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="NpgsqlContentProvider.cs" /> <Compile Include="NpgsqlContentProvider.cs" />
<Compile Include="WFManager.cs" />
<Compile Include="Configuration\WorkflowConfiguration.cs" />
<Compile Include="Configuration\ProviderCollection.cs" />
<Compile Include="Configuration\Provider.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
@ -50,7 +46,4 @@
<Name>YavscModel</Name> <Name>YavscModel</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Configuration\" />
</ItemGroup>
</Project> </Project>

@ -6,11 +6,68 @@ using System.Web.Mvc;
using System.Web.Mvc.Ajax; using System.Web.Mvc.Ajax;
using System.Web.Security; using System.Web.Security;
using Yavsc.Model.RolesAndMembers; using Yavsc.Model.RolesAndMembers;
using Yavsc.Model.Admin;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {
public class AdminController : Controller public class AdminController : Controller
{ {
[Authorize(Roles="Admin")]
public ActionResult Index(DataAccess model)
{
return View (model);
}
[Authorize(Roles="Admin")]
public ActionResult Backups(DataAccess model)
{
return View (model);
}
[Authorize(Roles="Admin")]
public ActionResult CreateBackup(DataAccess datac)
{
if (datac != null) {
if (ModelState.IsValid) {
if (string.IsNullOrEmpty (datac.Password))
ModelState.AddModelError ("Password", "Invalid passord");
DataManager ex = new DataManager (datac);
Export e = ex.CreateBackup ();
if (e.ExitCode > 0)
ModelState.AddModelError ("Password", "Operation Failed");
return View ("BackupCreated", e);
}
} else {
datac = new DataAccess ();
}
return View (datac);
}
[Authorize(Roles="Admin")]
public ActionResult CreateUserBackup(DataAccess datac,string username)
{
throw new NotImplementedException();
}
[Authorize(Roles="Admin")]
public ActionResult Upgrade(DataAccess datac) {
throw new NotImplementedException();
}
[Authorize(Roles="Admin")]
public ActionResult Restore(DataAccess datac,string backupName,bool dataOnly=true)
{
ViewData ["BackupName"] = backupName;
if (ModelState.IsValid) {
DataManager mgr = new DataManager (datac);
ViewData ["BackupName"] = backupName;
ViewData ["DataOnly"] = dataOnly;
TaskOutput t = mgr.Restore (backupName,dataOnly);
return View ("Restored", t);
}
return View (datac);
}
[Authorize(Roles="Admin")] [Authorize(Roles="Admin")]
public ActionResult RemoveFromRole(string username, string rolename, string returnUrl) public ActionResult RemoveFromRole(string username, string rolename, string returnUrl)
{ {

@ -4,69 +4,18 @@ using System.Linq;
using System.Web; using System.Web;
using System.Web.Mvc; using System.Web.Mvc;
using Yavsc.Admin; using Yavsc.Admin;
using Yavsc.Model.Admin;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {
public class BackOfficeController : Controller public class BackOfficeController : Controller
{ {
[Authorize(Roles="Admin")] public ActionResult Estimate()
public ActionResult Index(DataAccess model)
{ {
return View (model);
}
[Authorize(Roles="Admin")]
public ActionResult Backups(DataAccess model)
{
return View (model);
}
[Authorize(Roles="Admin")]
public ActionResult CreateBackup(DataAccess datac)
{
if (datac != null) {
if (ModelState.IsValid) {
if (string.IsNullOrEmpty (datac.Password))
ModelState.AddModelError ("Password", "Invalid passord");
DataManager ex = new DataManager (datac);
Export e = ex.CreateBackup ();
if (e.ExitCode > 0)
ModelState.AddModelError ("Password", "Operation Failed");
return View ("BackupCreated", e);
}
} else {
datac = new DataAccess ();
}
return View (datac);
}
[Authorize(Roles="Admin")]
public ActionResult CreateUserBackup(DataAccess datac,string username)
{
throw new NotImplementedException();
} }
[Authorize(Roles="Admin")] public ActionResult Index ()
public ActionResult Upgrade(DataAccess datac) {
throw new NotImplementedException();
}
[Authorize(Roles="Admin")]
public ActionResult Restore(DataAccess datac,string backupName,bool dataOnly=true)
{ {
ViewData ["BackupName"] = backupName;
if (ModelState.IsValid) {
DataManager mgr = new DataManager (datac);
ViewData ["BackupName"] = backupName;
ViewData ["DataOnly"] = dataOnly;
TaskOutput t = mgr.Restore (backupName,dataOnly);
return View ("Restored", t);
}
return View (datac);
} }
/*[Authorize(Roles="Admin")]
public ActionResult Estimate*/
} }
} }

@ -42,7 +42,7 @@ namespace Yavsc.ApiControllers
[Authorize] [Authorize]
public Estimate[] YourEstimates() public Estimate[] YourEstimates()
{ {
return WorkFlowProvider.WFManager.GetEstimates ( return WorkFlowManager.GetEstimates (
Membership.GetUser().UserName); Membership.GetUser().UserName);
} }

@ -73,7 +73,7 @@ namespace Yavsc.ApiControllers
/// <param name="estid">Estid.</param> /// <param name="estid">Estid.</param>
public Estimate GetEstimate (long estid) public Estimate GetEstimate (long estid)
{ {
Estimate est = WFManager.ContentProvider.GetEstimate (estid); Estimate est = WorkFlowManager.ContentProvider.GetEstimate (estid);
return est; return est;
} }

@ -22,7 +22,7 @@ namespace Yavsc.Controllers
{ {
if (ModelState.IsValid) { if (ModelState.IsValid) {
if (e.Id > 0) { if (e.Id > 0) {
Estimate f = WFManager.GetEstimate (e.Id); Estimate f = WorkFlowManager.GetEstimate (e.Id);
if (e.Owner != f.Owner) if (e.Owner != f.Owner)
if (!Roles.IsUserInRole ("FrontOffice")) if (!Roles.IsUserInRole ("FrontOffice"))
throw new UnauthorizedAccessException ("You're not allowed to modify this estimate"); throw new UnauthorizedAccessException ("You're not allowed to modify this estimate");

@ -29,7 +29,7 @@ namespace Yavsc.ApiControllers
[Authorize] [Authorize]
public long CreateEstimate (string title) public long CreateEstimate (string title)
{ {
return WFManager.CreateEstimate ( return WorkFlowManager.CreateEstimate (
Membership.GetUser().UserName,title); Membership.GetUser().UserName,title);
} }
@ -37,20 +37,20 @@ namespace Yavsc.ApiControllers
[Authorize] [Authorize]
public void DropWritting(long wrid) public void DropWritting(long wrid)
{ {
WFManager.DropWritting (wrid); WorkFlowManager.DropWritting (wrid);
} }
[HttpGet] [HttpGet]
[Authorize] [Authorize]
public void UpdateWritting(Writting wr) public void UpdateWritting(Writting wr)
{ {
WFManager.UpdateWritting (wr); WorkFlowManager.UpdateWritting (wr);
} }
[HttpGet] [HttpGet]
[Authorize] [Authorize]
public void DropEstimate(long estid) public void DropEstimate(long estid)
{ {
WFManager.DropEstimate (estid); WorkFlowManager.DropEstimate (estid);
} }
[HttpGet] [HttpGet]
[Authorize] [Authorize]
@ -68,7 +68,7 @@ namespace Yavsc.ApiControllers
public long Write (long estid, string desc, decimal ucost, int count, long productid=0) { public long Write (long estid, string desc, decimal ucost, int count, long productid=0) {
// TODO ensure estid owner matches the current one // TODO ensure estid owner matches the current one
return WFManager.Write(estid, desc, ucost, count, productid); return WorkFlowManager.Write(estid, desc, ucost, count, productid);
} }

@ -2,7 +2,7 @@
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<% using(Html.BeginForm("DoAddRole", "Account")) %> <% using(Html.BeginForm("DoAddRole")) %>
<% { %> <% { %>
Nom du rôle : Nom du rôle :
<%= Html.TextBox( "RoleName" ) %> <%= Html.TextBox( "RoleName" ) %>

@ -17,7 +17,7 @@
</h2> </h2>
<p><%= Html.ValidationSummary() %> </p> <p><%= Html.ValidationSummary() %> </p>
<% using ( Html.BeginForm("Admin", "Account") ) { %> <% using ( Html.BeginForm("Admin", "Admin") ) { %>
<%= Html.LabelFor(model => model.UserName) %> : <%= Html.LabelFor(model => model.UserName) %> :
<%= Html.DropDownListFor(model => model.UserName, (List<SelectListItem>)ViewData["useritems"] ) %> <%= Html.DropDownListFor(model => model.UserName, (List<SelectListItem>)ViewData["useritems"] ) %>

@ -1,6 +1,6 @@
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %> <%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.ActionLink("Create a database backup", "CreateBackup", "BackOffice")%><br/> <%=Html.ActionLink("Create a database backup", "CreateBackup")%><br/>
<%=Html.ActionLink("Restaurations", "Restore", "BackOffice")%><br/> <%=Html.ActionLink("Restaurations", "Restore")%><br/>
</asp:Content> </asp:Content>

@ -1,7 +1,7 @@
<%@ Page Title="Backup creation" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %> <%@ Page Title="Backup creation" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<%= Html.ValidationSummary("CreateBackup") %> <%= Html.ValidationSummary("CreateBackup") %>
<% using (Html.BeginForm("CreateBackup","BackOffice")) { %> <% using (Html.BeginForm("CreateBackup")) { %>
<%= Html.LabelFor(model => model.Host) %>: <%= Html.LabelFor(model => model.Host) %>:
<%= Html.TextBox( "Host" ) %> <%= Html.TextBox( "Host" ) %>

@ -1,4 +1,4 @@
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %> <%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<%= Html.ActionLink("Backups","Backups","BackOffice") %> <%= Html.ActionLink("Backups","Backups") %>
</asp:Content> </asp:Content>

@ -7,7 +7,7 @@
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div> <div>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<% using ( Html.BeginForm("RemoveUser","Account") ) { %> <% using ( Html.BeginForm("RemoveUser") ) { %>
Supprimer l'utilisateur Supprimer l'utilisateur
<%= Html.Encode( ViewData["usertoremove"] ) %> ? <%= Html.Encode( ViewData["usertoremove"] ) %> ?
<br/> <br/>

@ -1,7 +1,7 @@
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %> <%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<%= Html.ValidationSummary("Restore a database backup") %> <%= Html.ValidationSummary("Restore a database backup") %>
<% using (Html.BeginForm("Restore","BackOffice")) { %> <% using (Html.BeginForm("Restore")) { %>
<% string [] bckdirs = Model.GetBackupDirs(); %> <% string [] bckdirs = Model.GetBackupDirs(); %>
<select name="backupName"> <select name="backupName">

@ -0,0 +1,12 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</body>
</html>

@ -1,4 +1,4 @@
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<FormCollection collection>" %> <%@ Page Title="Commande" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<FormCollection collection>" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content> </asp:Content>

@ -1,6 +1,6 @@
<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<Service>" MasterPageFile="~/Models/App.master" %> <%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<Service>" MasterPageFile="~/Models/App.master" %>
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server"> <asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
<%= Title = ViewData ["BrandName"] + " " + Model.Name; %> <% Title = ViewData ["BrandName"] + " " + Model.Name; %>
</asp:Content> </asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server"> <asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h2> <%=ViewData ["ProdCatName"]%> - <%= Html.ActionLink( Model.Name, "Product", new { id = ViewData ["BrandName"], pc = ViewData ["ProdCatRef"] , pref = Model.Reference } ) %></h2> <h2> <%=ViewData ["ProdCatName"]%> - <%= Html.ActionLink( Model.Name, "Product", new { id = ViewData ["BrandName"], pc = ViewData ["ProdCatRef"] , pref = Model.Reference } ) %></h2>

@ -20,10 +20,10 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
</sectionGroup> </sectionGroup>
</sectionGroup> </sectionGroup>
<sectionGroup name="system.web"> <sectionGroup name="system.web">
<section name="blog" type="Npgsql.Web.Blog.Configuration.BlogProvidersConfigurationSection, NpgsqlBlogProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="blog" type="Yavsc.Model.Blogs.Configuration.BlogProvidersConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="catalog" type="SalesCatalog.Configuration.CatalogProvidersConfigurationSection, SalesCatalog" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="catalog" type="SalesCatalog.Configuration.CatalogProvidersConfigurationSection, SalesCatalog" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="workflow" type="WorkFlowProvider.Configuration.WorkflowConfiguration, WorkFlowProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" /> <section name="workflow" type="Yavsc.Model.WorkFlow.Configuration.WorkflowConfiguration, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<!-- <runtime> <!-- <runtime>

@ -103,6 +103,7 @@
<Folder Include="Views\FileSystem\" /> <Folder Include="Views\FileSystem\" />
<Folder Include="CatExts\" /> <Folder Include="CatExts\" />
<Folder Include="Views\WorkFlow\" /> <Folder Include="Views\WorkFlow\" />
<Folder Include="Views\Admin\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Controllers\HomeController.cs" /> <Compile Include="Controllers\HomeController.cs" />
@ -147,10 +148,7 @@
<Content Include="Views\Account\ChangePassword.aspx" /> <Content Include="Views\Account\ChangePassword.aspx" />
<Content Include="Views\Account\ChangePasswordSuccess.aspx" /> <Content Include="Views\Account\ChangePasswordSuccess.aspx" />
<Content Include="Views\Account\Index.aspx" /> <Content Include="Views\Account\Index.aspx" />
<Content Include="Views\Account\UserList.aspx" />
<Content Include="Views\Account\Login.aspx" /> <Content Include="Views\Account\Login.aspx" />
<Content Include="Views\Account\RoleList.aspx" />
<Content Include="Views\Account\Admin.aspx" />
<Content Include="images\Banner.png" /> <Content Include="images\Banner.png" />
<Content Include="images\noavatar.png" /> <Content Include="images\noavatar.png" />
<Content Include="images\apache_pbw.png" /> <Content Include="images\apache_pbw.png" />
@ -161,9 +159,6 @@
<Content Include="Views\Blogs\UserPosts.aspx" /> <Content Include="Views\Blogs\UserPosts.aspx" />
<Content Include="Views\Blogs\UserPost.aspx" /> <Content Include="Views\Blogs\UserPost.aspx" />
<Content Include="Views\Blogs\Edit.aspx" /> <Content Include="Views\Blogs\Edit.aspx" />
<Content Include="Views\Account\RemoveUserQuery.aspx" />
<Content Include="Views\Account\RemoveRoleQuery.aspx" />
<Content Include="Views\Account\AddRole.aspx" />
<Content Include="Views\Blogs\Error.aspx" /> <Content Include="Views\Blogs\Error.aspx" />
<Content Include="Views\Account\RegistrationPending.aspx" /> <Content Include="Views\Account\RegistrationPending.aspx" />
<Content Include="Views\Account\Validate.aspx" /> <Content Include="Views\Account\Validate.aspx" />
@ -172,15 +167,9 @@
<Content Include="Views\Blogs\TitleNotFound.aspx" /> <Content Include="Views\Blogs\TitleNotFound.aspx" />
<Content Include="Views\FrontOffice\ProductCategory.aspx" /> <Content Include="Views\FrontOffice\ProductCategory.aspx" />
<Content Include="Views\FrontOffice\Product.aspx" /> <Content Include="Views\FrontOffice\Product.aspx" />
<Content Include="Views\BackOffice\BackupCreated.aspx" />
<Content Include="Views\BackOffice\Index.aspx" />
<Content Include="Views\BackOffice\Restore.aspx" />
<Content Include="Views\Home\AOEMail.aspx" /> <Content Include="Views\Home\AOEMail.aspx" />
<Content Include="errors\GeneralError.aspx" /> <Content Include="errors\GeneralError.aspx" />
<Content Include="errors\PageNotFound.aspx" /> <Content Include="errors\PageNotFound.aspx" />
<Content Include="Views\BackOffice\Restored.aspx" />
<Content Include="Views\BackOffice\Backups.aspx" />
<Content Include="Views\BackOffice\CreateBackup.aspx" />
<Content Include="Views\FrontOffice\Service.aspx" /> <Content Include="Views\FrontOffice\Service.aspx" />
<Content Include="Views\FrontOffice\ReferenceNotFound.aspx" /> <Content Include="Views\FrontOffice\ReferenceNotFound.aspx" />
<Content Include="Views\FileSystem\Delete.aspx" /> <Content Include="Views\FileSystem\Delete.aspx" />
@ -193,6 +182,19 @@
<Content Include="Views\WorkFlow\NewProject.aspx" /> <Content Include="Views\WorkFlow\NewProject.aspx" />
<Content Include="Views\WorkFlow\Index.aspx" /> <Content Include="Views\WorkFlow\Index.aspx" />
<Content Include="Views\Blogs\RemovePost.aspx" /> <Content Include="Views\Blogs\RemovePost.aspx" />
<Content Include="Views\Admin\Admin.aspx" />
<Content Include="Views\Admin\AddRole.aspx" />
<Content Include="Views\Admin\UserList.aspx" />
<Content Include="Views\Admin\RemoveRoleQuery.aspx" />
<Content Include="Views\Admin\RemoveUserQuery.aspx" />
<Content Include="Views\Admin\RoleList.aspx" />
<Content Include="Views\BackOffice\Estimate.aspx" />
<Content Include="Views\Admin\CreateBackup.aspx" />
<Content Include="Views\Admin\BackupCreated.aspx" />
<Content Include="Views\Admin\Backups.aspx" />
<Content Include="Views\Admin\Restore.aspx" />
<Content Include="Views\Admin\Restored.aspx" />
<Content Include="Views\Admin\Index.aspx" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

@ -2,10 +2,9 @@ using System;
using System.Configuration; using System.Configuration;
using System.Reflection; using System.Reflection;
using System.Collections.Specialized; using System.Collections.Specialized;
using Npgsql.Web.Blog.Configuration; using Yavsc.Model.Blogs.Configuration;
using Yavsc.Model.Blogs;
namespace Npgsql.Web.Blog namespace Yavsc.Model.Blogs
{ {
public static class BlogHelper public static class BlogHelper
{ {

@ -2,7 +2,7 @@ using System;
using Yavsc.Model.Blogs; using Yavsc.Model.Blogs;
namespace Npgsql.Web.Blog namespace Yavsc.Model.Blogs
{ {
public static class BlogManager public static class BlogManager
{ {

@ -2,7 +2,7 @@ using System;
using System.Configuration; using System.Configuration;
using System.ComponentModel; using System.ComponentModel;
namespace Npgsql.Web.Blog.Configuration namespace Yavsc.Model.Blogs.Configuration
{ {
public class BlogProviderConfigurationElement : ConfigurationElement public class BlogProviderConfigurationElement : ConfigurationElement

@ -2,7 +2,7 @@ using System;
using System.Configuration; using System.Configuration;
using System.ComponentModel; using System.ComponentModel;
namespace Npgsql.Web.Blog.Configuration namespace Yavsc.Model.Blogs.Configuration
{ {
public class BlogProvidersConfigurationCollection : ConfigurationElementCollection public class BlogProvidersConfigurationCollection : ConfigurationElementCollection
{ {

@ -2,7 +2,7 @@ using System;
using System.Configuration; using System.Configuration;
using System.ComponentModel; using System.ComponentModel;
namespace Npgsql.Web.Blog.Configuration namespace Yavsc.Model.Blogs.Configuration
{ {
public class BlogProvidersConfigurationSection : ConfigurationSection public class BlogProvidersConfigurationSection : ConfigurationSection
{ {

@ -1,7 +1,7 @@
using System; using System;
using System.Configuration; using System.Configuration;
namespace WorkFlowProvider.Configuration namespace Yavsc.Model.WorkFlow.Configuration
{ {
public class WFProvider:ConfigurationElement public class WFProvider:ConfigurationElement
{ {

@ -1,7 +1,7 @@
using System; using System;
using System.Configuration; using System.Configuration;
namespace WorkFlowProvider.Configuration namespace Yavsc.Model.WorkFlow.Configuration
{ {
public class WFProviderCollection : ConfigurationElementCollection public class WFProviderCollection : ConfigurationElementCollection
{ {

@ -1,7 +1,7 @@
using System; using System;
using System.Configuration; using System.Configuration;
namespace WorkFlowProvider.Configuration namespace Yavsc.Model.WorkFlow.Configuration
{ {
public class WorkflowConfiguration : ConfigurationSection public class WorkflowConfiguration : ConfigurationSection
{ {

@ -1,21 +1,30 @@
using System; using System;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using System.Configuration; using System.Configuration;
using WorkFlowProvider.Configuration; using Yavsc.Model.WorkFlow.Configuration;
using System.Collections.Specialized; using System.Collections.Specialized;
namespace WorkFlowProvider namespace Yavsc.Model.WorkFlow
{ {
public static class WFManager /// <summary>
/// Work flow manager.
/// It takes orders store them and raise some events for modules
/// It publishes estimates and invoices
/// </summary>
public static class WorkFlowManager
{ {
public static event EventHandler NewOrder;
public static Estimate GetEstimate (long estid) public static Estimate GetEstimate (long estid)
{ {
return ContentProvider.GetEstimate (estid); return ContentProvider.GetEstimate (estid);
} }
public static Estimate [] GetEstimates (string client) public static Estimate [] GetEstimates (string client)
{ {
return ContentProvider.GetEstimates (client); return ContentProvider.GetEstimates (client);
} }
public static void UpdateWritting (Writting wr) public static void UpdateWritting (Writting wr)
{ {
ContentProvider.UpdateWritting (wr); ContentProvider.UpdateWritting (wr);

@ -8,7 +8,7 @@
<ProjectGuid>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</ProjectGuid> <ProjectGuid>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>yavscModel</RootNamespace> <RootNamespace>yavscModel</RootNamespace>
<AssemblyName>yavscModel</AssemblyName> <AssemblyName>YavscModel</AssemblyName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -67,6 +67,16 @@
<Compile Include="IModule.cs" /> <Compile Include="IModule.cs" />
<Compile Include="WorkFlow\BasketImpact.cs" /> <Compile Include="WorkFlow\BasketImpact.cs" />
<Compile Include="WorkFlow\Commande.cs" /> <Compile Include="WorkFlow\Commande.cs" />
<Compile Include="Blogs\BlogManager.cs" />
<Compile Include="Blogs\BlogProvider.cs" />
<Compile Include="WorkFlow\WorkFlowManager.cs" />
<Compile Include="WorkFlow\Configuration\Provider.cs" />
<Compile Include="WorkFlow\Configuration\ProviderCollection.cs" />
<Compile Include="WorkFlow\Configuration\WorkflowConfiguration.cs" />
<Compile Include="Blogs\BlogHelper.cs" />
<Compile Include="Blogs\Configuration\BlogProviderConfigurationElement.cs" />
<Compile Include="Blogs\Configuration\BlogProvidersConfigurationCollection.cs" />
<Compile Include="Blogs\Configuration\BlogProvidersConfigurationSection.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>

Loading…