* Makefile: builds the doc & htmldoc folders
* DataManager.cs: Doc generations * T.cs: * Global.asax.cs: * Export.cs: * Estim.tt: * Estim.cs: * TaskOutput.cs: * FileInfoCollection.cs: * RegisterPage.cs: * BBCodeHelper.cs: * MvcActionValueBinder.cs: * YavscHelpers.cs: * ValidateAjaxAttribute.cs: * Entity.cs: * IOrderInfo.cs: * HomeController.cs: * SimpleFormatter.cs: * BlogsController.cs: * AdminController.cs: * SimpleJsonPostMethod.cs: * WebCatalogExtensions.cs: * GoogleController.cs: * ModuleController.cs: * BasketController.cs: * AccountController.cs: * TemplateException.cs: * BlogsApiController.cs: * EstimToPdfFormatter.cs: * WorkFlowController.cs: * FileSystemController.cs: * BackOfficeController.cs: * FrontOfficeController.cs: * ThanksConfigurationSection.cs: * ThanksConfigurationElement.cs: * FrontOfficeApiController.cs: * ModuleConfigurationElementCollection.cs: * Web.csproj: cleaning an obsolete IOrderIfno
This commit is contained in:
8
Makefile
8
Makefile
@ -7,6 +7,8 @@ LOCALHOSTDIR=localhost:/srv/www/lua
|
||||
TESTHOSTDIR=localhost:/srv/www/yavsc
|
||||
PREPRODHOSTDIR=lua.localdomain:/srv/yavsc
|
||||
PRODHOSTDIR=lua.localdomain:/srv/www/lua
|
||||
DOCASSBS=NpgsqlBlogProvider.dll WorkFlowProvider.dll Yavsc.WebControls.dll ITContentProvider.dll NpgsqlMRPProviders.dll Yavsc.dll SalesCatalog.dll YavscModel.dll
|
||||
|
||||
all: deploy
|
||||
|
||||
ddir:
|
||||
@ -46,3 +48,9 @@ sourcepkg:
|
||||
debug: build
|
||||
(cd web; export MONO_OPTIONS=--debug; xsp4 --port 8080)
|
||||
|
||||
xmldoc: build
|
||||
(cd web/bin; monodocer -pretty -o ../xmldoc $(DOCASSBS))
|
||||
|
||||
htmldoc: xmldoc
|
||||
(cd web; monodocs2html -o htmldoc xmldoc)
|
||||
|
||||
|
@ -7,13 +7,24 @@ using System.Resources;
|
||||
|
||||
namespace Yavsc.Admin
|
||||
{
|
||||
/// <summary>
|
||||
/// Data manager.
|
||||
/// </summary>
|
||||
public class DataManager
|
||||
{
|
||||
DataAccess da;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Admin.DataManager"/> class.
|
||||
/// </summary>
|
||||
/// <param name="datac">Datac.</param>
|
||||
public DataManager (DataAccess datac)
|
||||
{
|
||||
da = datac;
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates the backup.
|
||||
/// </summary>
|
||||
/// <returns>The backup.</returns>
|
||||
public Export CreateBackup ()
|
||||
{
|
||||
Environment.SetEnvironmentVariable("PGPASSWORD", da.Password);
|
||||
@ -51,6 +62,11 @@ namespace Yavsc.Admin
|
||||
p.Close ();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Restore the specified fileName and dataOnly.
|
||||
/// </summary>
|
||||
/// <param name="fileName">File name.</param>
|
||||
/// <param name="dataOnly">If set to <c>true</c> data only.</param>
|
||||
public TaskOutput Restore (string fileName, bool dataOnly)
|
||||
{
|
||||
Environment.SetEnvironmentVariable("PGPASSWORD", da.Password);
|
||||
@ -65,7 +81,10 @@ namespace Yavsc.Admin
|
||||
*/
|
||||
return t;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the db.
|
||||
/// </summary>
|
||||
/// <returns>The db.</returns>
|
||||
public TaskOutput CreateDb ()
|
||||
{
|
||||
TaskOutput res = new TaskOutput ();
|
||||
@ -97,7 +116,12 @@ namespace Yavsc.Admin
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tags the backup.
|
||||
/// </summary>
|
||||
/// <returns>The backup.</returns>
|
||||
/// <param name="filename">Filename.</param>
|
||||
/// <param name="tags">Tags.</param>
|
||||
public Export TagBackup (string filename, string [] tags)
|
||||
{
|
||||
/* FileInfo fi = new FileInfo (filename);
|
||||
@ -106,6 +130,11 @@ namespace Yavsc.Admin
|
||||
} */
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Tags the restore.
|
||||
/// </summary>
|
||||
/// <returns>The restore.</returns>
|
||||
/// <param name="fileName">File name.</param>
|
||||
public TaskOutput TagRestore (string fileName)
|
||||
{
|
||||
Environment.SetEnvironmentVariable ("PGPASSWORD", da.Password);
|
||||
|
@ -3,11 +3,21 @@ using System.ComponentModel;
|
||||
|
||||
namespace Yavsc.Admin
|
||||
{
|
||||
/// <summary>
|
||||
/// Export.
|
||||
/// </summary>
|
||||
public class Export: TaskOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Admin.Export"/> class.
|
||||
/// </summary>
|
||||
public Export ()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the file.
|
||||
/// </summary>
|
||||
/// <value>The name of the file.</value>
|
||||
public string FileName { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,24 @@ using System.ComponentModel;
|
||||
|
||||
namespace Yavsc.Admin
|
||||
{
|
||||
/// <summary>
|
||||
/// Task output.
|
||||
/// </summary>
|
||||
public class TaskOutput {
|
||||
/// <summary>
|
||||
/// Gets or sets the message.
|
||||
/// </summary>
|
||||
/// <value>The message.</value>
|
||||
public string Message { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the error.
|
||||
/// </summary>
|
||||
/// <value>The error.</value>
|
||||
public string Error { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the exit code.
|
||||
/// </summary>
|
||||
/// <value>The exit code.</value>
|
||||
public int ExitCode { get; set; }
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,18 @@ using System.Web.Mvc.Html;
|
||||
|
||||
namespace Yavsc.CatExts
|
||||
{
|
||||
/// <summary>
|
||||
/// Web catalog extensions.
|
||||
/// </summary>
|
||||
public static class WebCatalogExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Commands the form.
|
||||
/// </summary>
|
||||
/// <returns>The form.</returns>
|
||||
/// <param name="helper">Helper.</param>
|
||||
/// <param name="pos">Position.</param>
|
||||
/// <param name="atc">Atc.</param>
|
||||
public static string CommandForm(this HtmlHelper<PhysicalProduct> helper, Product pos,string atc="Add to backet") {
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
sb.Append (helper.ValidationSummary ());
|
||||
@ -43,6 +53,13 @@ namespace Yavsc.CatExts
|
||||
sb.Append (ft.ToString ());
|
||||
return sb.ToString ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Commands the form.
|
||||
/// </summary>
|
||||
/// <returns>The form.</returns>
|
||||
/// <param name="helper">Helper.</param>
|
||||
/// <param name="pos">Position.</param>
|
||||
/// <param name="atc">Atc.</param>
|
||||
public static string CommandForm(this HtmlHelper<Service> helper, Product pos,string atc="Add to backet") {
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
sb.Append (helper.ValidationSummary ());
|
||||
@ -72,9 +89,6 @@ namespace Yavsc.CatExts
|
||||
sb.Append (ft.ToString ());
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,9 @@ using Yavsc.Helpers;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Account controller.
|
||||
/// </summary>
|
||||
public class AccountController : Controller
|
||||
{
|
||||
private static string registrationMessage =
|
||||
@ -25,7 +28,7 @@ namespace Yavsc.Controllers
|
||||
/// <summary>
|
||||
/// Gets or sets the avatar dir.
|
||||
/// This value is past to <c>Server.MapPath</c>,
|
||||
/// it should start with </c>~/</c>, and we assume it
|
||||
/// it should start with <c>~/</c>, and we assume it
|
||||
/// to be relative to the application path.
|
||||
/// </summary>
|
||||
/// <value>The avatar dir.</value>
|
||||
@ -33,18 +36,28 @@ namespace Yavsc.Controllers
|
||||
get { return avatarDir; }
|
||||
set { avatarDir = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
public ActionResult Index ()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Login the specified returnUrl.
|
||||
/// </summary>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
public ActionResult Login (string returnUrl)
|
||||
{
|
||||
ViewData ["returnUrl"] = returnUrl;
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the profile.
|
||||
/// </summary>
|
||||
/// <returns>The profile.</returns>
|
||||
/// <param name="user">User.</param>
|
||||
public static Profile GetProfile (string user)
|
||||
{
|
||||
return new Profile (ProfileBase.Create (user));
|
||||
@ -52,6 +65,12 @@ namespace Yavsc.Controllers
|
||||
|
||||
|
||||
// TODO [ValidateAntiForgeryToken]
|
||||
/// <summary>
|
||||
/// Dos the login.
|
||||
/// </summary>
|
||||
/// <returns>The login.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
public ActionResult DoLogin (LoginModel model, string returnUrl)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
@ -71,7 +90,11 @@ namespace Yavsc.Controllers
|
||||
// If we got this far, something failed, redisplay form
|
||||
return View ("Login", model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register the specified model and returnUrl.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
public ActionResult Register (RegisterViewModel model, string returnUrl)
|
||||
{
|
||||
ViewData ["returnUrl"] = returnUrl;
|
||||
@ -151,19 +174,29 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View (model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the password success.
|
||||
/// </summary>
|
||||
/// <returns>The password success.</returns>
|
||||
public ActionResult ChangePasswordSuccess ()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Changes the password.
|
||||
/// </summary>
|
||||
/// <returns>The password.</returns>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public ActionResult ChangePassword ()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unregister the specified confirmed.
|
||||
/// </summary>
|
||||
/// <param name="confirmed">If set to <c>true</c> confirmed.</param>
|
||||
[Authorize]
|
||||
public ActionResult Unregister (bool confirmed = false)
|
||||
{
|
||||
@ -175,6 +208,12 @@ namespace Yavsc.Controllers
|
||||
return RedirectToAction ("Index", "Home");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Changes the password.
|
||||
/// </summary>
|
||||
/// <returns>The password.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult ChangePassword (ChangePasswordModel model)
|
||||
@ -210,7 +249,10 @@ namespace Yavsc.Controllers
|
||||
return View (model);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Profile the specified model.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public ActionResult Profile (Profile model)
|
||||
@ -222,9 +264,13 @@ namespace Yavsc.Controllers
|
||||
return View (model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Profile the specified model and AvatarFile.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
/// <param name="AvatarFile">Avatar file.</param>
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
//public ActionResult UpdateProfile(HttpPostedFileBase Avatar, string Address, string CityAndState, string ZipCode, string Country, string WebSite)
|
||||
public ActionResult Profile (Profile model, HttpPostedFileBase AvatarFile)
|
||||
{
|
||||
string username = Membership.GetUser ().UserName;
|
||||
@ -275,6 +321,10 @@ namespace Yavsc.Controllers
|
||||
return View (model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logout the specified returnUrl.
|
||||
/// </summary>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
[Authorize]
|
||||
public ActionResult Logout (string returnUrl)
|
||||
{
|
||||
@ -283,7 +333,11 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the specified id and key.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="key">Key.</param>
|
||||
[HttpGet]
|
||||
public ActionResult Validate (string id, string key)
|
||||
{
|
||||
|
@ -20,6 +20,9 @@ namespace Yavsc.Controllers
|
||||
/// </summary>
|
||||
public class AdminController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
public ActionResult Index()
|
||||
{
|
||||
if (!Roles.RoleExists (adminRoleName)) {
|
||||
@ -27,7 +30,12 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inits the db.
|
||||
/// </summary>
|
||||
/// <returns>The db.</returns>
|
||||
/// <param name="datac">Datac.</param>
|
||||
/// <param name="doInit">Do init.</param>
|
||||
public ActionResult InitDb(DataAccess datac, string doInit)
|
||||
{
|
||||
if (doInit=="on") {
|
||||
@ -41,13 +49,21 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Backups the specified model.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult Backups(DataAccess model)
|
||||
{
|
||||
|
||||
return View (model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the backup.
|
||||
/// </summary>
|
||||
/// <returns>The backup.</returns>
|
||||
/// <param name="datac">Datac.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult CreateBackup(DataAccess datac)
|
||||
{
|
||||
@ -67,18 +83,31 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View (datac);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the user backup.
|
||||
/// </summary>
|
||||
/// <returns>The user backup.</returns>
|
||||
/// <param name="datac">Datac.</param>
|
||||
/// <param name="username">Username.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult CreateUserBackup(DataAccess datac,string username)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upgrade the specified datac.
|
||||
/// </summary>
|
||||
/// <param name="datac">Datac.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult Upgrade(DataAccess datac) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restore the specified datac, backupName and dataOnly.
|
||||
/// </summary>
|
||||
/// <param name="datac">Datac.</param>
|
||||
/// <param name="backupName">Backup name.</param>
|
||||
/// <param name="dataOnly">If set to <c>true</c> data only.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult Restore(DataAccess datac,string backupName,bool dataOnly=true)
|
||||
{
|
||||
@ -108,14 +137,25 @@ namespace Yavsc.Controllers
|
||||
bks.Add (ti.Name);
|
||||
ViewData ["Backups"] = bks.ToArray ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes from role.
|
||||
/// </summary>
|
||||
/// <returns>The from role.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="rolename">Rolename.</param>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveFromRole(string username, string rolename, string returnUrl)
|
||||
{
|
||||
Roles.RemoveUserFromRole(username,rolename);
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the user.
|
||||
/// </summary>
|
||||
/// <returns>The user.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="submitbutton">Submitbutton.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveUser (string username, string submitbutton)
|
||||
{
|
||||
@ -126,6 +166,12 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return RedirectToAction("UserList");
|
||||
}
|
||||
/// <summary>
|
||||
/// Removes the role.
|
||||
/// </summary>
|
||||
/// <returns>The role.</returns>
|
||||
/// <param name="rolename">Rolename.</param>
|
||||
/// <param name="submitbutton">Submitbutton.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveRole (string rolename, string submitbutton)
|
||||
{
|
||||
@ -135,14 +181,22 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return RedirectToAction("RoleList");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the role query.
|
||||
/// </summary>
|
||||
/// <returns>The role query.</returns>
|
||||
/// <param name="rolename">Rolename.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveRoleQuery(string rolename)
|
||||
{
|
||||
ViewData["roletoremove"] = rolename;
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the user query.
|
||||
/// </summary>
|
||||
/// <returns>The user query.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveUserQuery(string username)
|
||||
{
|
||||
|
@ -8,8 +8,14 @@ using Yavsc.Admin;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Back office controller.
|
||||
/// </summary>
|
||||
public class BackOfficeController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
[Authorize(Roles="Admin,Providers")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
|
@ -8,10 +8,19 @@ using Yavsc.Model.WorkFlow;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
// TODO should mostly be an API Controller
|
||||
/// <summary>
|
||||
/// Basket controller.
|
||||
/// </summary>
|
||||
public class BasketController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The wfmgr.
|
||||
/// </summary>
|
||||
protected WorkFlowManager wfmgr = null;
|
||||
/// <summary>
|
||||
/// Initialize the specified controllerContext.
|
||||
/// </summary>
|
||||
/// <param name="controllerContext">Controller context.</param>
|
||||
protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
|
||||
{
|
||||
base.Initialize (controllerContext);
|
||||
@ -44,6 +53,10 @@ namespace Yavsc.ApiControllers
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Yours the estimates.
|
||||
/// </summary>
|
||||
/// <returns>The estimates.</returns>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public Estimate[] YourEstimates()
|
||||
@ -52,6 +65,10 @@ namespace Yavsc.ApiControllers
|
||||
Membership.GetUser().UserName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Order the specified bi.
|
||||
/// </summary>
|
||||
/// <param name="bi">Bi.</param>
|
||||
[HttpGet]
|
||||
public object Order (BasketImpact bi)
|
||||
{
|
||||
|
@ -9,10 +9,17 @@ using Yavsc.Model.Blogs;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Blogs API controller.
|
||||
/// </summary>
|
||||
public class BlogsApiController : ApiController
|
||||
{
|
||||
private const string adminRoleName = "Admin";
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the specified controllerContext.
|
||||
/// </summary>
|
||||
/// <param name="controllerContext">Controller context.</param>
|
||||
protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
|
||||
{
|
||||
base.Initialize (controllerContext);
|
||||
@ -21,6 +28,11 @@ namespace Yavsc.ApiControllers
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tag the specified postid and tag.
|
||||
/// </summary>
|
||||
/// <param name="postid">Postid.</param>
|
||||
/// <param name="tag">Tag.</param>
|
||||
public long Tag (long postid,string tag) {
|
||||
BlogEntry e = BlogManager.GetPost (postid);
|
||||
if (!Roles.IsUserInRole ("Admin")) {
|
||||
@ -34,7 +46,11 @@ namespace Yavsc.ApiControllers
|
||||
}
|
||||
return BlogManager.Tag (postid, tag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the post.
|
||||
/// </summary>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
public static void RemovePost(string user, string title) {
|
||||
if (!Roles.IsUserInRole ("Admin")) {
|
||||
string rguser = Membership.GetUser ().UserName;
|
||||
@ -53,7 +69,10 @@ namespace Yavsc.ApiControllers
|
||||
}
|
||||
BlogManager.RemovePost (user, title);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the tag.
|
||||
/// </summary>
|
||||
/// <param name="tagid">Tagid.</param>
|
||||
public void RemoveTag(long tagid) {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
@ -22,6 +22,9 @@ using System.Net;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Blogs controller.
|
||||
/// </summary>
|
||||
public class BlogsController : Controller
|
||||
{
|
||||
string defaultAvatarMimetype;
|
||||
@ -29,11 +32,17 @@ namespace Yavsc.Controllers
|
||||
WebConfigurationManager.AppSettings ["Name"];
|
||||
string avatarDir = "~/avatars";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the avatar dir.
|
||||
/// </summary>
|
||||
/// <value>The avatar dir.</value>
|
||||
public string AvatarDir {
|
||||
get { return avatarDir; }
|
||||
set { avatarDir = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Controllers.BlogsController"/> class.
|
||||
/// </summary>
|
||||
public BlogsController ()
|
||||
{
|
||||
string[] defaultAvatarSpec = ConfigurationManager.AppSettings.Get ("DefaultAvatar").Split (';');
|
||||
@ -42,7 +51,13 @@ namespace Yavsc.Controllers
|
||||
defaultAvatar = defaultAvatarSpec [0];
|
||||
defaultAvatarMimetype = defaultAvatarSpec [1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index the specified user, title, pageIndex and pageSize.
|
||||
/// </summary>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="pageIndex">Page index.</param>
|
||||
/// <param name="pageSize">Page size.</param>
|
||||
public ActionResult Index (string user = null, string title = null, int pageIndex=0, int pageSize=10)
|
||||
{
|
||||
if (string.IsNullOrEmpty (user)) {
|
||||
@ -64,7 +79,12 @@ namespace Yavsc.Controllers
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Blogs the list.
|
||||
/// </summary>
|
||||
/// <returns>The list.</returns>
|
||||
/// <param name="pageIndex">Page index.</param>
|
||||
/// <param name="pageSize">Page size.</param>
|
||||
public ActionResult BlogList (int pageIndex = 0, int pageSize = 10)
|
||||
{
|
||||
ViewData ["SiteName"] = sitename;
|
||||
@ -75,7 +95,13 @@ namespace Yavsc.Controllers
|
||||
ViewData ["PageIndex"] = pageIndex;
|
||||
return View ("Index", bs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Users the posts.
|
||||
/// </summary>
|
||||
/// <returns>The posts.</returns>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="pageIndex">Page index.</param>
|
||||
/// <param name="pageSize">Page size.</param>
|
||||
[HttpGet]
|
||||
public ActionResult UserPosts (string user, int pageIndex = 0, int pageSize = 10)
|
||||
{
|
||||
@ -97,7 +123,11 @@ namespace Yavsc.Controllers
|
||||
return View ("UserPosts", c);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the comment.
|
||||
/// </summary>
|
||||
/// <returns>The comment.</returns>
|
||||
/// <param name="cmtid">Cmtid.</param>
|
||||
[Authorize]
|
||||
public ActionResult RemoveComment(long cmtid)
|
||||
{
|
||||
@ -138,7 +168,12 @@ namespace Yavsc.Controllers
|
||||
ViewData ["Comments"] = BlogManager.GetComments (e.Id);
|
||||
return View ("UserPost", e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Users the post.
|
||||
/// </summary>
|
||||
/// <returns>The post.</returns>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
public ActionResult UserPost (string user, string title)
|
||||
{
|
||||
ViewData ["BlogUser"] = user;
|
||||
@ -152,7 +187,11 @@ namespace Yavsc.Controllers
|
||||
string prevstr = LocalizedText.Preview;
|
||||
return UserPost (BlogManager.GetPost (user, title));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Post the specified user and title.
|
||||
/// </summary>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
[Authorize]
|
||||
public ActionResult Post (string user, string title)
|
||||
{
|
||||
@ -163,7 +202,11 @@ namespace Yavsc.Controllers
|
||||
ViewData ["UserName"] = un;
|
||||
return View (new BlogEditEntryModel { Title = title });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the post.
|
||||
/// </summary>
|
||||
/// <returns>The post.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
public ActionResult ValidatePost (BlogEditEntryModel model)
|
||||
{
|
||||
@ -178,7 +221,11 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View ("Post", model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the edit.
|
||||
/// </summary>
|
||||
/// <returns>The edit.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
public ActionResult ValidateEdit (BlogEditEntryModel model)
|
||||
{
|
||||
@ -192,7 +239,10 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View ("Edit", model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edit the specified model.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
public ActionResult Edit (BlogEditEntryModel model)
|
||||
{
|
||||
@ -219,7 +269,10 @@ namespace Yavsc.Controllers
|
||||
return View (model);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Comment the specified model.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
public ActionResult Comment (BlogEditCommentModel model) {
|
||||
string username = Membership.GetUser ().UserName;
|
||||
@ -234,7 +287,10 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
string defaultAvatar;
|
||||
|
||||
/// <summary>
|
||||
/// Avatar the specified user.
|
||||
/// </summary>
|
||||
/// <param name="user">User.</param>
|
||||
[AcceptVerbs (HttpVerbs.Get)]
|
||||
public ActionResult Avatar (string user)
|
||||
{
|
||||
|
@ -9,16 +9,24 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// File system controller.
|
||||
/// </summary>
|
||||
public class FileSystemController : Controller
|
||||
{
|
||||
private static string usersDir ="~/users";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the users dir.
|
||||
/// </summary>
|
||||
/// <value>The users dir.</value>
|
||||
public static string UsersDir {
|
||||
get {
|
||||
return usersDir;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public ActionResult Index()
|
||||
{
|
||||
@ -33,7 +41,10 @@ namespace Yavsc.Controllers
|
||||
di.Create ();
|
||||
return View (new FileInfoCollection( di.GetFiles()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Details the specified id.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
foreach (char x in Path.GetInvalidPathChars()) {
|
||||
@ -51,11 +62,18 @@ namespace Yavsc.Controllers
|
||||
|
||||
return View (fi);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create this instance.
|
||||
/// </summary>
|
||||
public ActionResult Create()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the specified collection.
|
||||
/// </summary>
|
||||
/// <param name="collection">Collection.</param>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public ActionResult Create(FormCollection collection)
|
||||
@ -92,14 +110,24 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base dir.
|
||||
/// </summary>
|
||||
/// <value>The base dir.</value>
|
||||
public static string BaseDir { get { return Path.Combine (UsersDir, Membership.GetUser ().UserName); } }
|
||||
|
||||
/// <summary>
|
||||
/// Edit the specified id.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
public ActionResult Edit(int id)
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edit the specified id and collection.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="collection">Collection.</param>
|
||||
[HttpPost]
|
||||
public ActionResult Edit(int id, FormCollection collection)
|
||||
{
|
||||
@ -109,12 +137,19 @@ namespace Yavsc.Controllers
|
||||
return View ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete the specified id.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
public ActionResult Delete(int id)
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete the specified id and collection.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="collection">Collection.</param>
|
||||
[HttpPost]
|
||||
public ActionResult Delete(int id, FormCollection collection)
|
||||
{
|
||||
|
@ -26,80 +26,66 @@ using Yavsc.Model;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Front office controller.
|
||||
/// </summary>
|
||||
public class FrontOfficeController : ApiController
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The wfmgr.
|
||||
/// </summary>
|
||||
protected WorkFlowManager wfmgr = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the specified controllerContext.
|
||||
/// </summary>
|
||||
/// <param name="controllerContext">Controller context.</param>
|
||||
protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
|
||||
{
|
||||
base.Initialize (controllerContext);
|
||||
wfmgr = new WorkFlowManager ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Catalog this instance.
|
||||
/// </summary>
|
||||
[AcceptVerbs("GET")]
|
||||
public Catalog Catalog ()
|
||||
{
|
||||
Catalog c = CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath);
|
||||
return c;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the product categorie.
|
||||
/// </summary>
|
||||
/// <returns>The product categorie.</returns>
|
||||
/// <param name="brandName">Brand name.</param>
|
||||
/// <param name="prodCategorie">Prod categorie.</param>
|
||||
[AcceptVerbs("GET")]
|
||||
public ProductCategory GetProductCategorie (string brandName, string prodCategorie)
|
||||
{
|
||||
return CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath).GetBrand (brandName).GetProductCategory (prodCategorie)
|
||||
;
|
||||
}
|
||||
/*
|
||||
|
||||
public HttpResponseMessage Post()
|
||||
{
|
||||
HttpResponseMessage result = null;
|
||||
var httpRequest = HttpContext.Current.Request;
|
||||
if (httpRequest.Files.Count > 0)
|
||||
{
|
||||
string username = HttpContext.Current.User.Identity.Name;
|
||||
int nbf = 0;
|
||||
foreach(string file in httpRequest.Files)
|
||||
{
|
||||
var postedFile = httpRequest.Files[file];
|
||||
string filePath = HttpContext.Current.Server.MapPath("~/users/"+username+"/"+ postedFile.FileName);
|
||||
postedFile.SaveAs(filePath);
|
||||
nbf++;
|
||||
}
|
||||
result = Request.CreateResponse <string>(HttpStatusCode.Created,
|
||||
string.Format("Received {0} files",nbf));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Request.CreateResponse <string>(HttpStatusCode.BadRequest,"No file received");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
[Authorize]
|
||||
public IOrderInfo Order()
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
/// <summary>
|
||||
/// Gets the estimate.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="estid">Estid.</param>
|
||||
/// <param name="Id">Estimate Id.</param>
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public Estimate GetEstimate (long Id)
|
||||
{
|
||||
Estimate est = wfmgr.ContentProvider.GetEstimate (Id);
|
||||
return est;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the estim tex.
|
||||
/// </summary>
|
||||
/// <returns>The estim tex.</returns>
|
||||
/// <param name="estimid">Estimid.</param>
|
||||
[AcceptVerbs("GET")]
|
||||
public HttpResponseMessage GetEstimTex(long estimid)
|
||||
{
|
||||
|
@ -22,19 +22,29 @@ namespace Yavsc.Controllers
|
||||
/// </summary>
|
||||
public class FrontOfficeController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// The wfmgr.
|
||||
/// </summary>
|
||||
protected WorkFlowManager wfmgr = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the specified requestContext.
|
||||
/// </summary>
|
||||
/// <param name="requestContext">Request context.</param>
|
||||
protected override void Initialize (System.Web.Routing.RequestContext requestContext)
|
||||
{
|
||||
base.Initialize (requestContext);
|
||||
wfmgr = new WorkFlowManager ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
public ActionResult Index ()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Estimates this instance.
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public ActionResult Estimates ()
|
||||
{
|
||||
@ -42,7 +52,11 @@ namespace Yavsc.Controllers
|
||||
|
||||
return View(wfmgr.GetEstimates (username));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Estimate the specified model and submit.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
/// <param name="submit">Submit.</param>
|
||||
[Authorize]
|
||||
public ActionResult Estimate(Estimate model,string submit)
|
||||
{
|
||||
@ -86,7 +100,9 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return View(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Catalog this instance.
|
||||
/// </summary>
|
||||
[AcceptVerbs("GET")]
|
||||
public ActionResult Catalog ()
|
||||
{
|
||||
@ -109,18 +125,24 @@ namespace Yavsc.Controllers
|
||||
/// <summary>
|
||||
/// get the product category
|
||||
/// </summary>
|
||||
/// <returns>The category.</returns>
|
||||
/// <param name="bn">Bn.</param>
|
||||
/// <param name="pc">Pc.</param>
|
||||
/// <returns>The category object.</returns>
|
||||
/// <param name="brandid">Brand id.</param>
|
||||
/// <param name="pcid">Product category Id.</param>
|
||||
[AcceptVerbs("GET")]
|
||||
public ActionResult ProductCategory (string id, string pc)
|
||||
public ActionResult ProductCategory (string brandid, string pcid)
|
||||
{
|
||||
ViewData ["BrandName"] = id;
|
||||
ViewData ["BrandId"] = brandid;
|
||||
ViewData ["ProductCategoryId"] = pcid;
|
||||
return View (
|
||||
CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (id).GetProductCategory (pc)
|
||||
CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (brandid).GetProductCategory (pcid)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Product the specified id, pc and pref.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="pc">Pc.</param>
|
||||
/// <param name="pref">Preference.</param>
|
||||
[AcceptVerbs("GET")]
|
||||
public ActionResult Product (string id, string pc, string pref)
|
||||
{
|
||||
@ -151,12 +173,18 @@ namespace Yavsc.Controllers
|
||||
|
||||
return View ((p is Service)?"Service":"Product", p);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Command this instance.
|
||||
/// </summary>
|
||||
public ActionResult Command()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Command the specified collection.
|
||||
/// </summary>
|
||||
/// <param name="collection">Collection.</param>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public ActionResult Command(FormCollection collection)
|
||||
|
@ -20,6 +20,9 @@ using Yavsc.Helpers.Google;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Google controller.
|
||||
/// </summary>
|
||||
public class GoogleController : Controller
|
||||
{
|
||||
|
||||
@ -44,7 +47,10 @@ namespace Yavsc.Controllers
|
||||
Request.Url.Authority + "/Google/CalAuth";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Login the specified returnUrl.
|
||||
/// </summary>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
public void Login (string returnUrl)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace (returnUrl))
|
||||
@ -54,13 +60,15 @@ namespace Yavsc.Controllers
|
||||
oa.Login (Response, SetSessionSate ());
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
|
||||
/// <summary>
|
||||
/// Called after the Google authorizations screen,
|
||||
/// we assume that <c>Session</c> contains a redirectUrl entry
|
||||
/// </summary>
|
||||
/// <returns>The auth.</returns>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
|
||||
public ActionResult CalAuth ()
|
||||
{
|
||||
string msg;
|
||||
@ -95,10 +103,9 @@ namespace Yavsc.Controllers
|
||||
HttpContext.Profile.Save ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Auth this instance.
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
public ActionResult Auth ()
|
||||
{
|
||||
@ -205,6 +212,11 @@ namespace Yavsc.Controllers
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chooses the calendar.
|
||||
/// </summary>
|
||||
/// <returns>The calendar.</returns>
|
||||
/// <param name="returnUrl">Return URL.</param>
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public ActionResult ChooseCalendar (string returnUrl)
|
||||
@ -222,7 +234,12 @@ namespace Yavsc.Controllers
|
||||
ViewData ["json"] = json;
|
||||
return View (cl);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the calendar.
|
||||
/// </summary>
|
||||
/// <returns>The calendar.</returns>
|
||||
/// <param name="calchoice">Calchoice.</param>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public ActionResult SetCalendar (string calchoice)
|
||||
@ -237,14 +254,23 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
return Redirect ("/");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Dates the query.
|
||||
/// </summary>
|
||||
/// <returns>The query.</returns>
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public ActionResult DateQuery ()
|
||||
{
|
||||
return View (new AskForADate ());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Dates the query.
|
||||
/// </summary>
|
||||
/// <returns>The query.</returns>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult DateQuery (AskForADate model)
|
||||
|
@ -14,6 +14,9 @@ using Yavsc.Model;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Home controller.
|
||||
/// </summary>
|
||||
public class HomeController : Controller
|
||||
{
|
||||
// Site name
|
||||
@ -43,7 +46,10 @@ namespace Yavsc.Controllers
|
||||
return admail;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assemblies the info.
|
||||
/// </summary>
|
||||
/// <returns>The info.</returns>
|
||||
public ActionResult AssemblyInfo()
|
||||
{
|
||||
AssemblyName[] model = GetType ().Assembly.GetReferencedAssemblies ();
|
||||
@ -66,7 +72,9 @@ namespace Yavsc.Controllers
|
||||
owneremail = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
public ActionResult Index ()
|
||||
{
|
||||
string startPage = WebConfigurationManager.AppSettings ["StartPage"];
|
||||
@ -75,7 +83,12 @@ namespace Yavsc.Controllers
|
||||
ViewData ["Message"] = LocalizedText.Welcome;
|
||||
return View ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contact the specified email, reason and body.
|
||||
/// </summary>
|
||||
/// <param name="email">Email.</param>
|
||||
/// <param name="reason">Reason.</param>
|
||||
/// <param name="body">Body.</param>
|
||||
public ActionResult Contact (string email, string reason, string body)
|
||||
{
|
||||
if (email==null)
|
||||
|
@ -1,37 +0,0 @@
|
||||
using System;
|
||||
using Yavsc;
|
||||
using SalesCatalog;
|
||||
using SalesCatalog.Model;
|
||||
using System.Web.Routing;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
using System.Web.Http;
|
||||
using System.Net.Http;
|
||||
using System.Web;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using WorkFlowProvider;
|
||||
using System.Web.Security;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Model.RolesAndMembers;
|
||||
using Yavsc.Controllers;
|
||||
using Yavsc.Formatters;
|
||||
using System.Text;
|
||||
using System.Web.Profile;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
|
||||
public interface IOrderInfo
|
||||
{
|
||||
DateTime Creation { get; set; }
|
||||
string Status { get; set; }
|
||||
long OrderId { get; set; }
|
||||
Object [] Details { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,8 +8,15 @@ using System.Configuration;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Module controller.
|
||||
/// </summary>
|
||||
public class ModuleController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize the specified requestContext.
|
||||
/// </summary>
|
||||
/// <param name="requestContext">Request context.</param>
|
||||
protected override void Initialize (System.Web.Routing.RequestContext requestContext)
|
||||
{
|
||||
base.Initialize (requestContext);
|
||||
@ -18,7 +25,9 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
// List<IModule> modules = new List<IModule> ();
|
||||
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View ();
|
||||
|
@ -25,7 +25,6 @@ using System.Collections.Specialized;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
|
||||
class TemplateException : Exception
|
||||
{
|
||||
public TemplateException(string message):base(message)
|
||||
|
@ -12,10 +12,20 @@ using System.Web.Http;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Work flow controller.
|
||||
/// </summary>
|
||||
public class WorkFlowController : ApiController
|
||||
{
|
||||
string adminRoleName="Admin";
|
||||
/// <summary>
|
||||
/// The wfmgr.
|
||||
/// </summary>
|
||||
protected WorkFlowManager wfmgr = null;
|
||||
/// <summary>
|
||||
/// Initialize the specified controllerContext.
|
||||
/// </summary>
|
||||
/// <param name="controllerContext">Controller context.</param>
|
||||
protected override void Initialize (HttpControllerContext controllerContext)
|
||||
{
|
||||
// TODO move it in a module initialization
|
||||
@ -26,6 +36,13 @@ namespace Yavsc.ApiControllers
|
||||
wfmgr = new WorkFlowManager ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the estimate.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="client">Client.</param>
|
||||
/// <param name="description">Description.</param>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public Estimate CreateEstimate (string title,string client,string description)
|
||||
@ -34,6 +51,10 @@ namespace Yavsc.ApiControllers
|
||||
Membership.GetUser().UserName,client,title,description);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Drops the writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public void DropWritting(long wrid)
|
||||
@ -41,8 +62,10 @@ namespace Yavsc.ApiControllers
|
||||
wfmgr.DropWritting (wrid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Drops the estimate.
|
||||
/// </summary>
|
||||
/// <param name="estid">Estid.</param>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public void DropEstimate(long estid)
|
||||
@ -50,6 +73,9 @@ namespace Yavsc.ApiControllers
|
||||
wfmgr.DropEstimate (estid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index this instance.
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public object Index()
|
||||
@ -71,6 +97,11 @@ namespace Yavsc.ApiControllers
|
||||
errs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the writting.
|
||||
/// </summary>
|
||||
/// <returns>The writting.</returns>
|
||||
/// <param name="wr">Wr.</param>
|
||||
[Authorize]
|
||||
[AcceptVerbs("POST")]
|
||||
[ValidateAjax]
|
||||
@ -80,14 +111,14 @@ namespace Yavsc.ApiControllers
|
||||
return Request.CreateResponse (System.Net.HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
[AcceptVerbs("POST")]
|
||||
[Authorize]
|
||||
[ValidateAjax]
|
||||
/// <summary>
|
||||
/// Adds the specified imputation to the given estimation by estimation id.
|
||||
/// </summary>
|
||||
/// <param name="estid">Estimation identifier</param>
|
||||
/// <param name="wr">Imputation to add</param>
|
||||
[AcceptVerbs("POST")]
|
||||
[Authorize]
|
||||
[ValidateAjax]
|
||||
public HttpResponseMessage Write ([FromUri] long estid, [FromBody] Writting wr) {
|
||||
if (estid <= 0) {
|
||||
ModelState.AddModelError ("EstimationId", "Spécifier un identifiant d'estimation valide");
|
||||
|
@ -4,8 +4,15 @@ using System.IO;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// File info collection.
|
||||
/// </summary>
|
||||
public class FileInfoCollection : List<FileInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.FileInfoCollection"/> class.
|
||||
/// </summary>
|
||||
/// <param name="collection">Collection.</param>
|
||||
public FileInfoCollection (System.IO.FileInfo[] collection)
|
||||
{
|
||||
this.AddRange (collection);
|
||||
|
@ -31,18 +31,32 @@ using System.Diagnostics;
|
||||
|
||||
namespace Yavsc.Formatters
|
||||
{
|
||||
/// <summary>
|
||||
/// Estim to pdf formatter.
|
||||
/// </summary>
|
||||
public class EstimToPdfFormatter: BufferedMediaTypeFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Formatters.EstimToPdfFormatter"/> class.
|
||||
/// </summary>
|
||||
public EstimToPdfFormatter ()
|
||||
{
|
||||
SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/pdf"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this instance can read type the specified type.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance can read type the specified type; otherwise, <c>false</c>.</returns>
|
||||
/// <param name="type">Type.</param>
|
||||
public override bool CanReadType(Type type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this instance can write type the specified type.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance can write type the specified type; otherwise, <c>false</c>.</returns>
|
||||
/// <param name="type">Type.</param>
|
||||
public override bool CanWriteType(System.Type type)
|
||||
{
|
||||
if (type == typeof(Estimate))
|
||||
@ -55,7 +69,13 @@ namespace Yavsc.Formatters
|
||||
return enumerableType.IsAssignableFrom(type);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes to stream.
|
||||
/// </summary>
|
||||
/// <param name="type">Type.</param>
|
||||
/// <param name="value">Value.</param>
|
||||
/// <param name="stream">Stream.</param>
|
||||
/// <param name="contentHeaders">Content headers.</param>
|
||||
public override void WriteToStream (Type type, object value, Stream stream, HttpContentHeaders contentHeaders)
|
||||
{
|
||||
// TODO create a type containing generation parameters, including a template path, and generate from them
|
||||
|
@ -29,13 +29,24 @@ using System.Net;
|
||||
|
||||
namespace Yavsc.Formatters
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple formatter.
|
||||
/// </summary>
|
||||
public class SimpleFormatter : BufferedMediaTypeFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Formatters.SimpleFormatter"/> class.
|
||||
/// </summary>
|
||||
/// <param name="mimetype">Mimetype.</param>
|
||||
public SimpleFormatter (string mimetype)
|
||||
{
|
||||
SupportedMediaTypes.Add(new MediaTypeHeaderValue(mimetype));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this instance can write type the specified type.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance can write type the specified type; otherwise, <c>false</c>.</returns>
|
||||
/// <param name="type">Type.</param>
|
||||
public override bool CanWriteType(System.Type type)
|
||||
{
|
||||
if (type == typeof(string))
|
||||
@ -48,12 +59,22 @@ namespace Yavsc.Formatters
|
||||
return enumerableType.IsAssignableFrom(type);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this instance can read type the specified type.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance can read type the specified type; otherwise, <c>false</c>.</returns>
|
||||
/// <param name="type">Type.</param>
|
||||
public override bool CanReadType(Type type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes to stream.
|
||||
/// </summary>
|
||||
/// <param name="type">Type.</param>
|
||||
/// <param name="value">Value.</param>
|
||||
/// <param name="stream">Stream.</param>
|
||||
/// <param name="contentHeaders">Content headers.</param>
|
||||
public override void WriteToStream (Type type, object value, Stream stream, HttpContentHeaders contentHeaders)
|
||||
{
|
||||
// TODO create a type containing T4 parameters, and generate from them
|
||||
|
@ -11,8 +11,15 @@ using Yavsc.Formatters;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Mvc application.
|
||||
/// </summary>
|
||||
public class MvcApplication : System.Web.HttpApplication
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers the routes.
|
||||
/// </summary>
|
||||
/// <param name="routes">Routes.</param>
|
||||
public static void RegisterRoutes (RouteCollection routes)
|
||||
{
|
||||
|
||||
@ -20,7 +27,8 @@ namespace Yavsc
|
||||
routes.IgnoreRoute ("Scripts/{*pathInfo}");
|
||||
routes.IgnoreRoute ("Theme/{*pathInfo}");
|
||||
routes.IgnoreRoute ("images/{*pathInfo}");
|
||||
|
||||
routes.IgnoreRoute ("xmldoc/{*pathInfo}"); // xml doc
|
||||
routes.IgnoreRoute ("htmldoc/{*pathInfo}"); // html doc
|
||||
routes.MapRoute (
|
||||
"Blog",
|
||||
"Blog/{user}/{title}",
|
||||
@ -38,7 +46,9 @@ namespace Yavsc
|
||||
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applications the start.
|
||||
/// </summary>
|
||||
protected void Application_Start ()
|
||||
{
|
||||
AreaRegistration.RegisterAllAreas ();
|
||||
|
@ -7,13 +7,19 @@ using System.Text;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// BB code helper.
|
||||
/// </summary>
|
||||
public static class BBCodeHelper
|
||||
{
|
||||
static Dictionary<string,BBTag> parent = new Dictionary<string,BBTag> ();
|
||||
private static string tclass="shoh";
|
||||
private static string cclass="hiduh";
|
||||
private static string mp4=null, ogg=null, webm=null;
|
||||
/// <summary>
|
||||
/// Gets or sets the BB code view class.
|
||||
/// </summary>
|
||||
/// <value>The BB code view class.</value>
|
||||
public static string BBCodeViewClass {
|
||||
get {
|
||||
return cclass;
|
||||
@ -22,7 +28,10 @@ namespace Yavsc.Helpers
|
||||
cclass = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the BB code case class.
|
||||
/// </summary>
|
||||
/// <value>The BB code case class.</value>
|
||||
public static string BBCodeCaseClass {
|
||||
get {
|
||||
return tclass;
|
||||
@ -31,7 +40,10 @@ namespace Yavsc.Helpers
|
||||
tclass = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the BB tags usage.
|
||||
/// </summary>
|
||||
/// <value>The BB tags usage.</value>
|
||||
public static string[] BBTagsUsage {
|
||||
get {
|
||||
|
||||
@ -85,7 +97,9 @@ namespace Yavsc.Helpers
|
||||
private static int sect2;
|
||||
private static int sect3;
|
||||
private static Dictionary<string,string> d = new Dictionary<string,string> ();
|
||||
|
||||
/// <summary>
|
||||
/// Init this instance.
|
||||
/// </summary>
|
||||
public static void Init ()
|
||||
{
|
||||
sect1 = 0;
|
||||
@ -263,7 +277,10 @@ namespace Yavsc.Helpers
|
||||
sb.Append (cnt);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parser.
|
||||
/// </summary>
|
||||
/// <value>The parser.</value>
|
||||
public static BBCodeParser Parser {
|
||||
get {
|
||||
if (parser == null) {
|
||||
|
@ -30,17 +30,25 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Helpers.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity.
|
||||
/// </summary>
|
||||
public class Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// The I.
|
||||
/// </summary>
|
||||
public string ID;
|
||||
/// <summary>
|
||||
/// The name.
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// The type:
|
||||
// AUTOMOBILE: A car or passenger vehicle.
|
||||
// TRUCK: A truck or cargo vehicle.
|
||||
// WATERCRAFT: A boat or other waterborne vehicle.
|
||||
// PERSON: A person.
|
||||
/// The type: AUTOMOBILE: A car or passenger vehicle.
|
||||
/// * TRUCK: A truck or cargo vehicle.
|
||||
/// * WATERCRAFT: A boat or other waterborne vehicle.
|
||||
/// * PERSON: A person.
|
||||
/// </summary>
|
||||
public string Type;
|
||||
}
|
||||
|
@ -26,6 +26,9 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple json post method.
|
||||
/// </summary>
|
||||
public class SimpleJsonPostMethod<TQuery,TAnswer>: IDisposable
|
||||
{
|
||||
internal HttpWebRequest request = null;
|
||||
@ -36,15 +39,25 @@ namespace Yavsc.Helpers
|
||||
set { Request.TransferEncoding=value;}
|
||||
}
|
||||
string Method { get { return Request.Method; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
public string Path {
|
||||
get{ return Request.RequestUri.ToString(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the credential.
|
||||
/// </summary>
|
||||
/// <param name="cred">Cred.</param>
|
||||
public void SetCredential(string cred) {
|
||||
Request.Headers.Add(HttpRequestHeader.Authorization,cred);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Yavsc.Helpers.SimpleJsonPostMethod class.
|
||||
/// </summary>
|
||||
/// <param name="pathToMethod">Path to method.</param>
|
||||
public SimpleJsonPostMethod (string pathToMethod)
|
||||
{
|
||||
// ASSERT Request == null
|
||||
@ -55,7 +68,10 @@ namespace Yavsc.Helpers
|
||||
Request.ContentType = "application/json";
|
||||
Request.TransferEncoding = "UTF-8";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoke the specified query.
|
||||
/// </summary>
|
||||
/// <param name="query">Query.</param>
|
||||
public TAnswer Invoke(TQuery query)
|
||||
{
|
||||
Byte[] bytes = System.Text.Encoding.UTF8.GetBytes (JsonConvert.SerializeObject(query));
|
||||
@ -81,6 +97,14 @@ namespace Yavsc.Helpers
|
||||
}
|
||||
|
||||
#region IDisposable implementation
|
||||
/// <summary>
|
||||
/// Releases all resource used by the <see cref="Yavsc.Helpers.SimpleJsonPostMethod`2"/> object.
|
||||
/// </summary>
|
||||
/// <remarks>Call <see cref="Dispose"/> when you are finished using the <see cref="Yavsc.Helpers.SimpleJsonPostMethod`2"/>. The
|
||||
/// <see cref="Dispose"/> method leaves the <see cref="Yavsc.Helpers.SimpleJsonPostMethod`2"/> in an unusable state.
|
||||
/// After calling <see cref="Dispose"/>, you must release all references to the
|
||||
/// <see cref="Yavsc.Helpers.SimpleJsonPostMethod`2"/> so the garbage collector can reclaim the memory that the
|
||||
/// <see cref="Yavsc.Helpers.SimpleJsonPostMethod`2"/> was occupying.</remarks>
|
||||
public void Dispose ()
|
||||
{
|
||||
if (Request != null) Request.Abort ();
|
||||
|
@ -12,8 +12,16 @@ using Yavsc.Model;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// T.
|
||||
/// </summary>
|
||||
public class T
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the string.
|
||||
/// </summary>
|
||||
/// <returns>The string.</returns>
|
||||
/// <param name="msg">Message.</param>
|
||||
public static string GetString(string msg)
|
||||
{
|
||||
string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_"));
|
||||
|
@ -4,9 +4,16 @@ using System.Configuration;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Yavsc helpers.
|
||||
/// </summary>
|
||||
public static class YavscHelpers
|
||||
{
|
||||
private static string siteName = null;
|
||||
/// <summary>
|
||||
/// Gets the name of the site.
|
||||
/// </summary>
|
||||
/// <value>The name of the site.</value>
|
||||
public static string SiteName {
|
||||
get {
|
||||
if (siteName == null)
|
||||
|
@ -16,11 +16,19 @@ using System.Web.Http.ValueProviders.Providers;
|
||||
namespace Basic
|
||||
{
|
||||
// Binder with MVC semantics. Treat the body as KeyValue pairs and model bind it.
|
||||
/// <summary>
|
||||
/// Mvc action value binder.
|
||||
/// </summary>
|
||||
public class MvcActionValueBinder : DefaultActionValueBinder
|
||||
{
|
||||
// Per-request storage, uses the Request.Properties bag. We need a unique key into the bag.
|
||||
private const string Key = "5DC187FB-BFA0-462A-AB93-9E8036871EC8";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the binding.
|
||||
/// </summary>
|
||||
/// <returns>The binding.</returns>
|
||||
/// <param name="actionDescriptor">Action descriptor.</param>
|
||||
public override HttpActionBinding GetBinding (HttpActionDescriptor actionDescriptor)
|
||||
{
|
||||
|
||||
|
@ -23,19 +23,32 @@ using System.Configuration;
|
||||
|
||||
namespace Yavsc.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// Module configuration element collection.
|
||||
/// </summary>
|
||||
public class ModuleConfigurationElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Settings.ModuleConfigurationElementCollection"/> class.
|
||||
/// </summary>
|
||||
public ModuleConfigurationElementCollection ()
|
||||
{
|
||||
}
|
||||
|
||||
#region implemented abstract members of ConfigurationElementCollection
|
||||
|
||||
/// <summary>
|
||||
/// Creates the new element.
|
||||
/// </summary>
|
||||
/// <returns>The new element.</returns>
|
||||
protected override ConfigurationElement CreateNewElement ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the element key.
|
||||
/// </summary>
|
||||
/// <returns>The element key.</returns>
|
||||
/// <param name="element">Element.</param>
|
||||
protected override object GetElementKey (ConfigurationElement element)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
|
@ -3,8 +3,15 @@ using System.Configuration;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Thanks configuration element.
|
||||
/// </summary>
|
||||
public class ThanksConfigurationElement : ConfigurationElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[ConfigurationProperty("name", IsKey=true, IsRequired=true)]
|
||||
public string Name {
|
||||
get {
|
||||
@ -12,7 +19,10 @@ namespace Yavsc
|
||||
}
|
||||
set { base ["name"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the URL.
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
[ConfigurationProperty("url")]
|
||||
public string Url {
|
||||
get {
|
||||
@ -20,7 +30,10 @@ namespace Yavsc
|
||||
}
|
||||
set { base ["url"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image.
|
||||
/// </summary>
|
||||
/// <value>The image.</value>
|
||||
[ConfigurationProperty("image")]
|
||||
public string Image {
|
||||
get {
|
||||
|
@ -3,8 +3,15 @@ using System.Configuration;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Thanks configuration section.
|
||||
/// </summary>
|
||||
public class ThanksConfigurationSection : ConfigurationSection
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets to.
|
||||
/// </summary>
|
||||
/// <value>To.</value>
|
||||
[ConfigurationProperty("to")]
|
||||
public ThanksConfigurationCollection To {
|
||||
get {
|
||||
@ -14,7 +21,10 @@ namespace Yavsc
|
||||
this ["to"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the html class.
|
||||
/// </summary>
|
||||
/// <value>The html class.</value>
|
||||
[ConfigurationProperty("html_class")]
|
||||
public string HtmlClass {
|
||||
get {
|
||||
@ -24,7 +34,10 @@ namespace Yavsc
|
||||
this ["html_class"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title format.
|
||||
/// </summary>
|
||||
/// <value>The title format.</value>
|
||||
[ConfigurationProperty("title_format")]
|
||||
public string TitleFormat {
|
||||
get {
|
||||
|
@ -27,8 +27,16 @@ using System.Web.Http.ModelBinding;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Validate ajax attribute.
|
||||
/// </summary>
|
||||
public class ValidateAjaxAttribute : ActionFilterAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the error model object.
|
||||
/// </summary>
|
||||
/// <returns>The error model object.</returns>
|
||||
/// <param name="modelState">Model state.</param>
|
||||
public static object GetErrorModelObject(ModelStateDictionary modelState) {
|
||||
var errorModel =
|
||||
from x in modelState.Keys
|
||||
@ -43,6 +51,10 @@ namespace Yavsc
|
||||
return errorModel;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Raises the action executing event.
|
||||
/// </summary>
|
||||
/// <param name="actionContext">Action context.</param>
|
||||
public override void OnActionExecuting (System.Web.Http.Controllers.HttpActionContext actionContext)
|
||||
{
|
||||
var modelState = actionContext.ModelState;
|
||||
|
@ -5,14 +5,26 @@ using Yavsc.Model.RolesAndMembers;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Register page.
|
||||
/// </summary>
|
||||
public class RegisterPage : System.Web.Mvc.ViewPage<RegisterViewModel>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.RegisterPage"/> class.
|
||||
/// </summary>
|
||||
public RegisterPage ()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The createuserwizard1.
|
||||
/// </summary>
|
||||
public CreateUserWizard Createuserwizard1;
|
||||
|
||||
/// <summary>
|
||||
/// Raises the register send mail event.
|
||||
/// </summary>
|
||||
/// <param name="sender">Sender.</param>
|
||||
/// <param name="e">E.</param>
|
||||
public void OnRegisterSendMail(object sender, MailMessageEventArgs e)
|
||||
{
|
||||
// Set MailMessage fields.
|
||||
|
@ -40,6 +40,7 @@
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<AssemblyName>Yavsc</AssemblyName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DocumentationFile>bin\Yavsc.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MVC2|AnyCPU' ">
|
||||
<Optimize>false</Optimize>
|
||||
@ -154,7 +155,6 @@
|
||||
<Compile Include="Formatters\EstimToPdfFormatter.cs" />
|
||||
<Compile Include="Formatters\SimpleFormatter.cs" />
|
||||
<Compile Include="ValidateAjaxAttribute.cs" />
|
||||
<Compile Include="Controllers\IOrderInfo.cs" />
|
||||
<Compile Include="Controllers\IValueProvider.cs" />
|
||||
<Compile Include="Controllers\GoogleController.cs" />
|
||||
<Compile Include="Controllers\ModuleController.cs" />
|
||||
|
@ -49,395 +49,407 @@ namespace Yavsc.templates {
|
||||
#line hidden
|
||||
|
||||
#line 14 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\n\n\\documentclass[french,11pt]{article}\n\\usepackage{babel}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[a4paper]{geometry}\n\\usepackage{units}\n\\usepackage{bera}\n\\usepackage{graphicx}\n\\usepackage{fancyhdr}\n\\usepackage{fp}\n\n\\def\\TVA{20} % Taux de la TVA\n\n\\def\\TotalHT{0}\n\\def\\TotalTVA{0}\n\n\n\\newcommand{\\AjouterService}[3]{% Arguments : Désignation, quantité, prix\n \\FPround{\\prix}{#3}{2}\n \\FPeval{\\montant}{#2 * #3}\n \\FPround{\\montant}{\\montant}{2}\n \\FPadd{\\TotalHT}{\\TotalHT}{\\montant}\n \n \\eaddto\\ListeProduits{#1 & \\prix & #2 & \\montant \\cr}\n}\n\n\n\\newcommand{\\AfficheResultat}{%\n \\ListeProduits\n \n \\FPeval{\\TotalTVA}{\\TotalHT * \\TVA / 100}\n \\FPadd{\\TotalTTC}{\\TotalHT}{\\TotalTVA}\n \\FPround{\\TotalHT}{\\TotalHT}{2}\n \\FPround{\\TotalTVA}{\\TotalTVA}{2}\n \\FPround{\\TotalTTC}{\\TotalTTC}{2}\n \\global\\let\\TotalHT\\TotalHT\n \\global\\let\\TotalTVA\\TotalTVA\n \\global\\let\\TotalTTC\\TotalTTC\n \n\n \\cr \n \\hline\n \\textbf{Total} & & & \\TotalHT\n}\n\n\\newcommand*\\eaddto[2]{% version développée de \\addto\n \\edef\\tmp{#2}%\n \\expandafter\\addto\n \\expandafter#1%\n \\expandafter{\\tmp}%\n}\n\n\\newcommand{\\ListeProduits}{}\n\n\n\n\n%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%\n\n\\def\\FactureNum {");
|
||||
this.Write("\n\\documentclass[french,11pt]{article}\n\\usepackage{babel}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[a4paper]{geometry}\n\\usepackage{units}\n\\usepackage{bera}\n\\usepackage{graphicx}\n\\usepackage{fancyhdr}\n\\usepackage{fp}\n\n\\def\\TVA{20} % Taux de la TVA\n\n\\def\\TotalHT{0}\n\\def\\TotalTVA{0}\n\n\n\\newcommand{\\AjouterService}[3]{% Arguments : Désignation, quantité, prix\n \\FPround{\\prix}{#3}{2}\n \\FPeval{\\montant}{#2 * #3}\n \\FPround{\\montant}{\\montant}{2}\n \\FPadd{\\TotalHT}{\\TotalHT}{\\montant}\n \n \\eaddto\\ListeProduits{#1 & \\prix & #2 & \\montant \\cr}\n}\n\n\n\\newcommand{\\AfficheResultat}{%\n \\ListeProduits\n \n \\FPeval{\\TotalTVA}{\\TotalHT * \\TVA / 100}\n \\FPadd{\\TotalTTC}{\\TotalHT}{\\TotalTVA}\n \\FPround{\\TotalHT}{\\TotalHT}{2}\n \\FPround{\\TotalTVA}{\\TotalTVA}{2}\n \\FPround{\\TotalTTC}{\\TotalTTC}{2}\n \\global\\let\\TotalHT\\TotalHT\n \\global\\let\\TotalTVA\\TotalTVA\n \\global\\let\\TotalTTC\\TotalTTC\n \n\n \\cr \n \\hline\n \\textbf{Total} & & & \\TotalHT\n}\n\n\\newcommand*\\eaddto[2]{% version développée de \\addto\n \\edef\\tmp{#2}%\n \\expandafter\\addto\n \\expandafter#1%\n \\expandafter{\\tmp}%\n}\n\n\\newcommand{\\ListeProduits}{}\n\n\n\n\n%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%\n\n\\def\\FactureNum {");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 74 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( estim.Id.ToString() ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 74 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} % Numéro de facture\n\\def\\FactureAcquittee {non} % Facture acquittée : oui/non\n\\def\\FactureLieu {");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 76 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.CityAndState ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 76 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} % Lieu de l'édition de la facture\n\\def\\FactureObjet {Facture : ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 78 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( estim.Title ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 78 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} % Objet du document\n% Description de la facture\n\\def\\FactureDescr {%\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 81 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 80 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( estim.Description ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 81 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 80 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\n}\n\n% Infos Client\n\\def\\ClientNom{");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 85 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 84 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.Name ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 85 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 84 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} % Nom du client\n\\def\\ClientAdresse{% % Adresse du client\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 86 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.Address ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 86 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.ZipCode ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.CityAndState ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
if (!string.IsNullOrWhiteSpace(to.Phone)) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" Téléphone fixe: ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.Phone ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 91 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
if (!string.IsNullOrWhiteSpace(to.Mobile)) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" Mobile: ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.Mobile ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" E-mail: ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( to.Email ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\n}\n\n% Liste des produits facturés : Désignation, prix\n\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 99 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
foreach (Writting wr in estim.Lines) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\AjouterService {");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(wr.Description));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
if (!string.IsNullOrWhiteSpace(wr.ProductReference)) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" (");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(wr.ProductReference));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(")");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} {");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(wr.Count));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} {");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(wr.UnitaryCost));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("} \n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 104 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 105 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 104 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n\\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{1ex plus 0.5ex minus 0.2ex}\n\n\\thispagestyle{fancy}\n\\pagestyle{fancy}\n\\setlength{\\parindent}{0pt}\n\n\\renewcommand{\\headrulewidth}{0pt}\n\\cfoot{\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(from.Name));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" - ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(from.Address ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" - ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.CityAndState ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" \\newline\n \\small{\n E-mail: ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 119 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.Email ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 119 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
if (!string.IsNullOrWhiteSpace(from.Mobile)) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" - Téléphone mobile: ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.Mobile ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
if (!string.IsNullOrWhiteSpace(from.Phone)) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" - Téléphone fixe: ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.Phone ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 125 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" }\n}\n\n\\begin{document}\n\n% Logo de la société\n%\\includegraphics{logo.jpg}\n\n% Nom et adresse de la société\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 133 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.Name ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 133 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.Address ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n");
|
||||
|
||||
@ -445,108 +457,96 @@ namespace Yavsc.templates {
|
||||
#line hidden
|
||||
|
||||
#line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.Address ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(from.ZipCode ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(from.CityAndState));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write("\\\\\n\nFacture n°\\FactureNum\n\n\n{\\addtolength{\\leftskip}{10.5cm} %in ERT\n \\textbf{\\ClientNom} \\\\\n \\ClientAdresse \\\\\n\n} %in ERT\n\n\n\\hspace*{10.5cm}\n\\FactureLieu, le \\today\n\n~\\\\~\\\\\n\n\\textbf{Objet : \\FactureObjet \\\\}\n\n\\textnormal{\\FactureDescr}\n\n~\\\\\n\n\\begin{center}\n \\begin{tabular}{lrrr}\n \\textbf{Désignation ~~~~~~} & \\textbf{Prix unitaire} & \\textbf{Quantité} & \\textbf{Montant (EUR)} \\\\\n \\hline\n \\AfficheResultat{}\n \\end{tabular}\n\\end{center}\n\n\\begin{flushright}\n\\textit{Auto entreprise en franchise de TVA}\\\\\n\n\\end{flushright}\n~\\\\\n\n\\ifthenelse{\\equal{\\FactureAcquittee}{oui}}{\n Facture acquittée.\n}{\n\n À régler par chèque ou par virement bancaire :\n\n \\begin{center}\n \\begin{tabular}{|c c c c|}\n \\hline \\textbf{Code banque} & \\textbf{Code guichet} & \\textbf{N° de Compte} & \\textbf{Clé RIB} \\\\\n ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.BankCode ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" & ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.WicketCode ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" & ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(from.AccountNumber ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" & ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(from.BankedKey));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" \\\\\n \\hline \\textbf{IBAN N°} & \\multicolumn{3}{|l|}{ ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.IBAN ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" } \\\\\n \\hline \\textbf{Code BIC} & \\multicolumn{3}{|l|}{ ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 184 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture( from.BIC ));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 184 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
#line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt"
|
||||
this.Write(" } \\\\\n \\hline\n \\end{tabular}\n \\end{center}\n}\n\\end{document}\n");
|
||||
|
||||
#line default
|
||||
@ -554,7 +554,7 @@ namespace Yavsc.templates {
|
||||
return this.GenerationEnvironment.ToString();
|
||||
}
|
||||
|
||||
protected virtual void Initialize() {
|
||||
public virtual void Initialize() {
|
||||
if ((this.Errors.HasErrors == false)) {
|
||||
bool _estimAcquired = false;
|
||||
if (((this.Session != null) && this.Session.ContainsKey("estim"))) {
|
||||
@ -747,7 +747,10 @@ namespace Yavsc.templates {
|
||||
public class ToStringInstanceHelper {
|
||||
|
||||
private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the format provider.
|
||||
/// </summary>
|
||||
/// <value>The format provider.</value>
|
||||
public global::System.IFormatProvider FormatProvider {
|
||||
get {
|
||||
return this.formatProvider;
|
||||
@ -759,7 +762,11 @@ namespace Yavsc.templates {
|
||||
this.formatProvider = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tos the string with culture.
|
||||
/// </summary>
|
||||
/// <returns>The string with culture.</returns>
|
||||
/// <param name="objectToConvert">Object to convert.</param>
|
||||
public string ToStringWithCulture(object objectToConvert) {
|
||||
if ((objectToConvert == null)) {
|
||||
throw new global::System.ArgumentNullException("objectToConvert");
|
||||
|
@ -12,7 +12,6 @@
|
||||
<#@ parameter type="Profile" name="from" #>
|
||||
<#@ parameter type="Profile" name="to" #>
|
||||
|
||||
|
||||
\documentclass[french,11pt]{article}
|
||||
\usepackage{babel}
|
||||
\usepackage[T1]{fontenc}
|
||||
|
Reference in New Issue
Block a user