* Web.csproj:
* T.cs: * IModule.cs: * App.master: * IProvider.cs: * Error.aspx: * AOEMail.aspx: * Login.aspx: * Index.aspx: * Admin.aspx: * yavscModel.csproj: * WFManager.cs: * Index.aspx: * AddRole.aspx: * Profile.aspx: * Edit.aspx: * Register.aspx: * Index.aspx: * RoleList.aspx: * UserList.aspx: * Validate.aspx: * RemovePost.aspx: * Index.aspx: * BasketImpact.cs: * Brand.aspx: * Delete.aspx: * Create.aspx: * Backups.aspx: * HomeController.cs: * BlogManager.cs: * Restore.aspx: * Details.aspx: * TitleNotFound.aspx: * Product.aspx: * AdminController.cs: * Command.aspx: * Service.aspx: * BlogProvider.cs: * NewProject.aspx: * Catalog.aspx: * Restored.aspx: * BasketController.cs: * AccountController.cs: * WorkFlowController.cs: * BlogsApiController.cs: * ChangePassword.aspx: * RemoveRoleQuery.aspx: * CreateBackup.aspx: * IContentProvider.cs: * BackOfficeController.cs: * FrontOfficeController.cs: * NpgsqlBlogProvider.cs: * NpgsqlContentProvider.cs: * RegistrationPending.aspx: * ProductCategory.aspx: * FrontOfficeApiController.cs: * ChangePasswordSuccess.aspx: * ReferenceNotFound.aspx: * BackupCreated.aspx Fixes many HTTP 500 Refactoring on the go
This commit is contained in:
@ -57,6 +57,15 @@ namespace Npgsql.Web.Blog
|
||||
{
|
||||
return Provider.GetComments (postid,getHidden);
|
||||
}
|
||||
/// <summary>
|
||||
/// Tag the specified post by postid.
|
||||
/// </summary>
|
||||
/// <param name="postid">Postid.</param>
|
||||
/// <returns>The tag identifier</returns>
|
||||
public static long Tag(long postid, string tag) {
|
||||
return Provider.Tag (postid, tag);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@ namespace yavscModel.Blogs
|
||||
public abstract bool AutoValidateComment { get; set; }
|
||||
public abstract void ValidateComment (long cmtid);
|
||||
public abstract void UpdateComment (long cmtid, string content, bool visible);
|
||||
public abstract long Tag (long postid,string tag);
|
||||
public abstract void RemoveTag (long tagid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,26 @@ namespace Npgsql.Web.Blog
|
||||
|
||||
#region implemented abstract members of BlogProvider
|
||||
|
||||
public override long Tag (long postid, string tag)
|
||||
{
|
||||
using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString))
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText = "insert into bltag (blid,tag) values (@postid,@tag) returning _id";
|
||||
cmd.Parameters.Add("@tag",tag);
|
||||
cmd.Parameters.Add("@postid",postid);
|
||||
return (long) cmd.ExecuteScalar ();
|
||||
}
|
||||
}
|
||||
|
||||
public override void RemoveTag (long tagid)
|
||||
{
|
||||
using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString))
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText = "delete from bltag where _id = @tagid";
|
||||
cmd.Parameters.Add("@tagid",tagid);
|
||||
cmd.ExecuteNonQuery ();
|
||||
}
|
||||
}
|
||||
public override long GetPostId (string username, string title)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
@ -199,6 +219,18 @@ namespace Npgsql.Web.Blog
|
||||
be.Posted = rdr.GetDateTime (rdr.GetOrdinal ("posted"));
|
||||
be.Visible = rdr.GetBoolean (rdr.GetOrdinal ("visible"));
|
||||
be.Id = rdr.GetInt64 (rdr.GetOrdinal ("_id"));
|
||||
using (NpgsqlCommand cmdtags = cnx.CreateCommand()) {
|
||||
List<string> tags = new List<string> ();
|
||||
cmd.CommandText = "select tag from bltags where blid = @pid";
|
||||
cmd.Parameters.Add ("@pid", be.Id);
|
||||
using (NpgsqlDataReader rdrt = cmd.ExecuteReader ()) {
|
||||
|
||||
while (rdrt.Read ()) {
|
||||
tags.Add (rdrt.GetString (0));
|
||||
}
|
||||
}
|
||||
be.Tags = tags.ToArray ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,35 @@ namespace WorkFlowProvider
|
||||
{
|
||||
public class NpgsqlContentProvider: ProviderBase, IContentProvider
|
||||
{
|
||||
public Estimate[] GetEstimates (string client)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void Install ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void Uninstall ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public ConfigurationSection DefaultConfig (string appName, string cnxStr)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public bool Active {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public StatusChange[] GetWrittingStatuses (long wrid)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
@ -246,6 +275,9 @@ namespace WorkFlowProvider
|
||||
|
||||
cnxstr = ConfigurationManager.ConnectionStrings [config ["connectionStringName"]].ConnectionString;
|
||||
applicationName = config["applicationName"] ?? "/";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected NpgsqlConnection CreateConnection ()
|
||||
|
@ -12,7 +12,10 @@ namespace WorkFlowProvider
|
||||
{
|
||||
return ContentProvider.GetEstimate (estid);
|
||||
}
|
||||
|
||||
public static Estimate [] GetEstimates (string client)
|
||||
{
|
||||
return ContentProvider.GetEstimates (client);
|
||||
}
|
||||
public static void UpdateWritting (Writting wr)
|
||||
{
|
||||
ContentProvider.UpdateWritting (wr);
|
||||
@ -80,6 +83,7 @@ namespace WorkFlowProvider
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static long Write(long estid, string desc, decimal ucost, int count, long productid)
|
||||
{
|
||||
return ContentProvider.Write(estid, desc, ucost, count, productid);
|
||||
|
@ -100,11 +100,16 @@ namespace Yavsc.Controllers
|
||||
return View (model);
|
||||
case MembershipCreateStatus.Success:
|
||||
FileInfo fi = new FileInfo (
|
||||
Server.MapPath(registrationMessage));
|
||||
Server.MapPath (registrationMessage));
|
||||
if (!fi.Exists) {
|
||||
ViewData["Error"] = "Erreur inattendue (pas de corps de message à envoyer)";
|
||||
ViewData ["Error"] =
|
||||
string.Format (
|
||||
"Erreur inattendue (pas de corps de message " +
|
||||
"à envoyer pour le message de confirmation ({0}))",
|
||||
registrationMessage);
|
||||
return View (model);
|
||||
}
|
||||
|
||||
using (StreamReader sr = fi.OpenText()) {
|
||||
string body = sr.ReadToEnd();
|
||||
body = body.Replace("<%SiteName%>",YavscHelpers.SiteName);
|
||||
@ -189,79 +194,8 @@ namespace Yavsc.Controllers
|
||||
return View (model);
|
||||
}
|
||||
|
||||
[Authorize()]
|
||||
public ActionResult UserList ()
|
||||
{
|
||||
MembershipUserCollection c = Membership.GetAllUsers ();
|
||||
return View (c);
|
||||
}
|
||||
|
||||
private const string adminRoleName = "Admin";
|
||||
|
||||
[Authorize()]
|
||||
public ActionResult Admin (NewAdminModel model)
|
||||
{
|
||||
string currentUser = Membership.GetUser ().UserName;
|
||||
if (ModelState.IsValid) {
|
||||
Roles.AddUserToRole (model.UserName, adminRoleName);
|
||||
ViewData ["Message"] = model.UserName + " was added to the role '" + adminRoleName + "'";
|
||||
} else {
|
||||
if (!Roles.RoleExists (adminRoleName)) {
|
||||
Roles.CreateRole (adminRoleName);
|
||||
string.Format ("The role '{0}' has just been created. ",
|
||||
adminRoleName);
|
||||
}
|
||||
string [] admins = Roles.GetUsersInRole (adminRoleName);
|
||||
if (admins.Length > 0) {
|
||||
if (! admins.Contains (Membership.GetUser ().UserName)) {
|
||||
ModelState.Remove("UserName");
|
||||
ModelState.AddModelError("UserName", "You're not administrator!");
|
||||
return View ("Index");
|
||||
}
|
||||
} else {
|
||||
Roles.AddUserToRole (currentUser, adminRoleName);
|
||||
admins = new string[] { currentUser };
|
||||
ViewData ["Message"] += string.Format (
|
||||
"There was no user in the 'Admin' role. You ({0}) was just added as the firt user in the 'Admin' role. ", currentUser);
|
||||
}
|
||||
|
||||
List<SelectListItem> users = new List<SelectListItem> ();
|
||||
foreach (MembershipUser u in Membership.GetAllUsers ()) {
|
||||
var i = new SelectListItem ();
|
||||
i.Text = string.Format ("{0} <{1}>", u.UserName, u.Email);
|
||||
i.Value = u.UserName;
|
||||
users.Add (i);
|
||||
}
|
||||
ViewData ["useritems"] = users;
|
||||
ViewData ["admins"] = admins;
|
||||
}
|
||||
return View (model);
|
||||
}
|
||||
|
||||
[Authorize()]
|
||||
public ActionResult RoleList ()
|
||||
{
|
||||
return View (Roles.GetAllRoles ());
|
||||
}
|
||||
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveFromRole(string username, string rolename, string returnUrl)
|
||||
{
|
||||
Roles.RemoveUserFromRole(username,rolename);
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveUser (string username, string submitbutton)
|
||||
{
|
||||
if (submitbutton == "Supprimer") {
|
||||
Membership.DeleteUser (username);
|
||||
ViewData["Message"]=
|
||||
string.Format("utilisateur \"{0}\" supprimé",username);
|
||||
}
|
||||
return RedirectToAction("UserList");
|
||||
}
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
//public ActionResult UpdateProfile(HttpPostedFileBase Avatar, string Address, string CityAndState, string ZipCode, string Country, string WebSite)
|
||||
@ -304,30 +238,6 @@ namespace Yavsc.Controllers
|
||||
return RedirectToAction ("Profile");
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveRole (string rolename, string submitbutton)
|
||||
{
|
||||
if (submitbutton == "Supprimer")
|
||||
{
|
||||
Roles.DeleteRole(rolename);
|
||||
}
|
||||
return RedirectToAction("RoleList");
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveRoleQuery(string rolename)
|
||||
{
|
||||
ViewData["roletoremove"] = rolename;
|
||||
return View ();
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveUserQuery(string username)
|
||||
{
|
||||
ViewData["usertoremove"] = username;
|
||||
return UserList();
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Logout (string returnUrl)
|
||||
{
|
||||
@ -335,20 +245,9 @@ namespace Yavsc.Controllers
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult AddRole ()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult DoAddRole (string rolename)
|
||||
{
|
||||
Roles.CreateRole(rolename);
|
||||
ViewData["Message"] = "Rôle créé : "+rolename;
|
||||
return View ();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public ActionResult Validate (string id, string key)
|
||||
{
|
||||
MembershipUser u = Membership.GetUser (id, false);
|
||||
|
127
web/Controllers/AdminController.cs
Normal file
127
web/Controllers/AdminController.cs
Normal file
@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Security;
|
||||
using yavscModel.RolesAndMembers;
|
||||
|
||||
namespace Yavsc.Controllers.Controllers
|
||||
{
|
||||
public class AdminController : Controller
|
||||
{
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveFromRole(string username, string rolename, string returnUrl)
|
||||
{
|
||||
Roles.RemoveUserFromRole(username,rolename);
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveUser (string username, string submitbutton)
|
||||
{
|
||||
if (submitbutton == "Supprimer") {
|
||||
Membership.DeleteUser (username);
|
||||
ViewData["Message"]=
|
||||
string.Format("utilisateur \"{0}\" supprimé",username);
|
||||
}
|
||||
return RedirectToAction("UserList");
|
||||
}
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveRole (string rolename, string submitbutton)
|
||||
{
|
||||
if (submitbutton == "Supprimer")
|
||||
{
|
||||
Roles.DeleteRole(rolename);
|
||||
}
|
||||
return RedirectToAction("RoleList");
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveRoleQuery(string rolename)
|
||||
{
|
||||
ViewData["roletoremove"] = rolename;
|
||||
return View ();
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult RemoveUserQuery(string username)
|
||||
{
|
||||
ViewData["usertoremove"] = username;
|
||||
return UserList();
|
||||
}
|
||||
//TODO no more than pageSize results per page
|
||||
[Authorize()]
|
||||
public ActionResult UserList ()
|
||||
{
|
||||
MembershipUserCollection c = Membership.GetAllUsers ();
|
||||
return View (c);
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult AddRole ()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
[Authorize(Roles="Admin")]
|
||||
public ActionResult DoAddRole (string rolename)
|
||||
{
|
||||
Roles.CreateRole(rolename);
|
||||
ViewData["Message"] = "Rôle créé : "+rolename;
|
||||
return View ();
|
||||
}
|
||||
|
||||
[Authorize()]
|
||||
public ActionResult RoleList ()
|
||||
{
|
||||
return View (Roles.GetAllRoles ());
|
||||
}
|
||||
private const string adminRoleName = "Admin";
|
||||
protected override void Initialize (System.Web.Routing.RequestContext requestContext)
|
||||
{
|
||||
base.Initialize (requestContext);
|
||||
if (!Roles.RoleExists (adminRoleName)) {
|
||||
Roles.CreateRole (adminRoleName);
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize()]
|
||||
public ActionResult Admin (NewAdminModel model)
|
||||
{
|
||||
string currentUser = Membership.GetUser ().UserName;
|
||||
if (ModelState.IsValid) {
|
||||
Roles.AddUserToRole (model.UserName, adminRoleName);
|
||||
ViewData ["Message"] = model.UserName + " was added to the role '" + adminRoleName + "'";
|
||||
} else {
|
||||
// assert (Roles.RoleExists (adminRoleName))
|
||||
string [] admins = Roles.GetUsersInRole (adminRoleName);
|
||||
if (admins.Length > 0) {
|
||||
if (! admins.Contains (Membership.GetUser ().UserName)) {
|
||||
ModelState.Remove("UserName");
|
||||
ModelState.AddModelError("UserName", "You're not administrator!");
|
||||
return View ("Index");
|
||||
}
|
||||
} else {
|
||||
Roles.AddUserToRole (currentUser, adminRoleName);
|
||||
admins = new string[] { currentUser };
|
||||
ViewData ["Message"] += string.Format (
|
||||
"There was no user in the 'Admin' role. You ({0}) was just added as the firt user in the 'Admin' role. ", currentUser);
|
||||
}
|
||||
|
||||
List<SelectListItem> users = new List<SelectListItem> ();
|
||||
foreach (MembershipUser u in Membership.GetAllUsers ()) {
|
||||
var i = new SelectListItem ();
|
||||
i.Text = string.Format ("{0} <{1}>", u.UserName, u.Email);
|
||||
i.Value = u.UserName;
|
||||
users.Add (i);
|
||||
}
|
||||
ViewData ["useritems"] = users;
|
||||
ViewData ["admins"] = admins;
|
||||
}
|
||||
return View (model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,10 @@ namespace Yavsc.Controllers
|
||||
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)
|
||||
|
@ -2,72 +2,54 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using System.Web.Http;
|
||||
using yavscModel.WorkFlow;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
// TODO should mostly be an API Controller
|
||||
public class BasketController : Controller
|
||||
public class BasketController : ApiController
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Validates the order.
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if order was validated, <c>false</c> otherwise.</returns>
|
||||
/// <param name="orderid">Orderid.</param>
|
||||
bool ValidateOrder(long orderid) {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public ActionResult Details(int id)
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
long CreateOrder(string title,string mesg)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public ActionResult Create()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
// var user = Membership.GetUser ();
|
||||
// var username = (user != null)?user.UserName:Request.AnonymousID;
|
||||
// get an existing basket
|
||||
/// <summary>
|
||||
/// Adds to basket, a product from the catalog, in the user's session.
|
||||
/// </summary>
|
||||
/// <returns>The to basket.</returns>
|
||||
[HttpGet]
|
||||
public long AddToOrder (long orderid, string prodref,int count, object prodparams=null)
|
||||
{
|
||||
//TODO find the basket for Membership.GetUser().UserName
|
||||
//return WFManager.Write(estid << from the basket, desc, ucost, count, productid);
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
//return View ();
|
||||
}
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public Estimate[] YourEstimates()
|
||||
{
|
||||
return WorkFlowProvider.WFManager.GetEstimates (
|
||||
Membership.GetUser().UserName);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Create(FormCollection collection)
|
||||
{
|
||||
try {
|
||||
return RedirectToAction ("Index");
|
||||
} catch {
|
||||
return View ();
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Edit(int id)
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Edit(int id, FormCollection collection)
|
||||
{
|
||||
try {
|
||||
return RedirectToAction ("Index");
|
||||
} catch {
|
||||
return View ();
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Delete(int id)
|
||||
{
|
||||
return View ();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Delete(int id, FormCollection collection)
|
||||
{
|
||||
try {
|
||||
return RedirectToAction ("Index");
|
||||
} catch {
|
||||
return View ();
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public object Order (BasketImpact bi)
|
||||
{
|
||||
return new { c="lmk,", message="Panier impacté", impactRef=bi.ProductRef, count=bi.Count};
|
||||
}
|
||||
}
|
||||
}
|
@ -15,7 +15,8 @@ namespace Yavsc.ApiControllers
|
||||
public class BasketImpact
|
||||
{
|
||||
public string ProductRef { get; set; }
|
||||
public int count { get; set; }
|
||||
public int Count { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,16 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
public class BlogsApiController : Controller
|
||||
{
|
||||
public void Tag (long postid,string tag) {
|
||||
private const string adminRoleName = "Admin";
|
||||
protected override void Initialize (System.Web.Routing.RequestContext requestContext)
|
||||
{
|
||||
base.Initialize (requestContext);
|
||||
if (!Roles.RoleExists (adminRoleName)) {
|
||||
Roles.CreateRole (adminRoleName);
|
||||
}
|
||||
}
|
||||
|
||||
public long Tag (long postid,string tag) {
|
||||
BlogEntry e = BlogManager.GetPost (postid);
|
||||
if (!Roles.IsUserInRole ("Admin")) {
|
||||
string rguser = Membership.GetUser ().UserName;
|
||||
@ -23,6 +32,7 @@ namespace Yavsc.Controllers
|
||||
e.UserName));
|
||||
}
|
||||
}
|
||||
return BlogManager.Tag (postid, tag);
|
||||
}
|
||||
|
||||
public static HttpStatusCodeResult RemovePost(string user, string title) {
|
||||
@ -44,6 +54,10 @@ namespace Yavsc.Controllers
|
||||
BlogManager.RemovePost (user, title);
|
||||
return new HttpStatusCodeResult (200);
|
||||
}
|
||||
|
||||
public void RemoveTag(long tagid) {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using WorkFlowProvider;
|
||||
using System.Web.Security;
|
||||
using yavscModel.WorkFlow;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
@ -66,17 +67,21 @@ namespace Yavsc.ApiControllers
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds to basket, a product from the catalog, in the user's session.
|
||||
/// </summary>
|
||||
/// <returns>The to basket.</returns>
|
||||
|
||||
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public long AddToBasket (string prodref,int count, object prodparams=null)
|
||||
/// <summary>
|
||||
/// Gets the estimate.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="estid">Estid.</param>
|
||||
public Estimate GetEstimate (long estid)
|
||||
{
|
||||
//TODO find the basket for Membership.GetUser().UserName
|
||||
//return WFManager.Write(estid << from the basket, desc, ucost, count, productid);
|
||||
throw new NotImplementedException ();
|
||||
Estimate est = WFManager.ContentProvider.GetEstimate (estid);
|
||||
return est;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,14 +10,25 @@ using Yavsc.Controllers;
|
||||
using System.Collections.Generic;
|
||||
using yavscModel.WorkFlow;
|
||||
using WorkFlowProvider;
|
||||
using System.Web.Security;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class FrontOfficeController : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public Estimate GetEstimate(long estid) {
|
||||
return WFManager.GetEstimate (estid);
|
||||
[HttpPost]
|
||||
public ActionResult Estimate(Estimate e)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
if (e.Id > 0) {
|
||||
Estimate f = WFManager.GetEstimate (e.Id);
|
||||
if (e.Owner != f.Owner)
|
||||
if (!Roles.IsUserInRole ("FrontOffice"))
|
||||
throw new UnauthorizedAccessException ("You're not allowed to modify this estimate");
|
||||
}
|
||||
}
|
||||
return View (e);
|
||||
}
|
||||
|
||||
[AcceptVerbs("GET")]
|
||||
|
@ -60,12 +60,12 @@ namespace Yavsc.Controllers
|
||||
|
||||
public ActionResult Index ()
|
||||
{
|
||||
InitCatalog ();
|
||||
InitCulture ();
|
||||
ViewData ["Message"] = string.Format(T.GetString("Welcome")+"({0})",GetType ().Assembly.FullName);
|
||||
return View ();
|
||||
}
|
||||
|
||||
public void InitCatalog() {
|
||||
public void InitCulture() {
|
||||
CultureInfo culture = null;
|
||||
string defaultCulture = "fr";
|
||||
|
||||
|
@ -17,6 +17,5 @@ namespace Yavsc
|
||||
{
|
||||
return Mono.Unix.Catalog.GetString (msgid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,16 @@ namespace Yavsc.ApiControllers
|
||||
[HttpControllerConfiguration(ActionValueBinder=typeof(Basic.MvcActionValueBinder))]
|
||||
public class WorkFlowController : ApiController
|
||||
{
|
||||
string adminRoleName="Admin";
|
||||
|
||||
protected override void Initialize (HttpControllerContext controllerContext)
|
||||
{
|
||||
base.Initialize (controllerContext);
|
||||
if (!Roles.RoleExists (adminRoleName)) {
|
||||
Roles.CreateRole (adminRoleName);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public long CreateEstimate (string title)
|
||||
@ -21,6 +31,7 @@ namespace Yavsc.ApiControllers
|
||||
return WFManager.CreateEstimate (
|
||||
Membership.GetUser().UserName,title);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public void DropWritting(long wrid)
|
||||
@ -49,11 +60,7 @@ namespace Yavsc.ApiControllers
|
||||
return new { test=string.Format("Hello {0}!",username) };
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public object Order (BasketImpact bi)
|
||||
{
|
||||
return new { c="lmk,", message="Panier impacté", impactRef=bi.ProductRef, count=bi.count};
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
@ -63,18 +70,7 @@ namespace Yavsc.ApiControllers
|
||||
return WFManager.Write(estid, desc, ucost, count, productid);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
/// <summary>
|
||||
/// Gets the estimate.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="estid">Estid.</param>
|
||||
public Estimate GetEstimate (long estid)
|
||||
{
|
||||
Estimate est = WFManager.ContentProvider.GetEstimate (estid);
|
||||
return est;
|
||||
}
|
||||
|
||||
/*
|
||||
public object Details(int id)
|
||||
{
|
||||
|
@ -32,17 +32,13 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<asp:ContentPlaceHolder ID="overHeaderOne" runat="server">
|
||||
|
||||
<h1><a href="<%= Html.Encode(Request.Url.AbsoluteUri.ToString()) %>">
|
||||
<!-- Use taking care of keeping the title to be the same in the head and h1 sections -->
|
||||
<asp:ContentPlaceHolder ID="overHeaderOne" runat="server">
|
||||
<h1><a href="<%= Html.Encode(Request.Url.AbsoluteUri.ToString()) %>">
|
||||
<%= Page.Title %>
|
||||
</a></h1>
|
||||
|
||||
|
||||
</asp:ContentPlaceHolder>
|
||||
|
||||
|
||||
<% if (ViewData["Error"]!=null) { %>
|
||||
<div class="error">
|
||||
<%= Html.Encode(ViewData["Error"]) %>
|
||||
@ -53,7 +49,7 @@
|
||||
<%= Html.Encode(ViewData["Message"]) %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<!-- a place to add some meta information, under the title -->
|
||||
<asp:ContentPlaceHolder ID="header" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
</header>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Ajout d'un role</h2>
|
||||
</asp:Content>
|
||||
<%@ Page Title="Ajout d'un role" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<%= Html.ValidationSummary() %>
|
||||
|
@ -1,7 +1,4 @@
|
||||
<%@ Page Title="Administration" Language="C#" Inherits="System.Web.Mvc.ViewPage<NewAdminModel>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Liste des administrateurs </h2>
|
||||
</asp:Content>
|
||||
<%@ Page Title="Liste des administrateurs" Language="C#" Inherits="System.Web.Mvc.ViewPage<NewAdminModel>" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
|
@ -1,9 +1,5 @@
|
||||
<%@ Page Title="Change your Password" Language="C#" Inherits="System.Web.Mvc.ViewPage<ChangePasswordModel>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<%= Html.ValidationSummary("Modification de mot de passe") %>
|
||||
<% using(Html.BeginForm("ChangePassword", "Account")) { %>
|
||||
<label for="UserName">User Name:</label>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<%@ Page Title="Successfully changed your password" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.ActionLink("Register","Register")%></div>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<%@ Page Title="Comptes utilisateur - Index" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Comptes utilisteur</h2>
|
||||
</asp:Content>
|
||||
|
@ -1,9 +1,5 @@
|
||||
<%@ Page Title="Login" Language="C#" Inherits="System.Web.Mvc.ViewPage<LoginModel>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<div>
|
||||
<%= Html.ValidationSummary("Ouverture de session") %>
|
||||
<% using(Html.BeginForm("DoLogin", "Account")) %>
|
||||
<% { %>
|
||||
@ -22,7 +18,6 @@
|
||||
<!-- Html.AntiForgeryToken() -->
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
</div>
|
||||
<div>
|
||||
<%= Html.ActionLink("S'enregistrer","Register",new {returnUrl=ViewData["returnUrl"]}) %></div>
|
||||
|
||||
<%= Html.ActionLink("S'enregistrer","Register",new {returnUrl=ViewData["returnUrl"]}) %>
|
||||
</asp:Content>
|
||||
|
@ -1,13 +1,18 @@
|
||||
<%@ Page Title="Profile" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<yavscModel.RolesAndMembers.Profile>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
<title><%=ViewData["UserName"]%> : Profile - <%=YavscHelpers.SiteName%></title>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
|
||||
<% Title = ViewData["UserName"]+"'s profile" %>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
<h1><%=ViewData["UserName"]%> : Profile - <a href="/"><%=YavscHelpers.SiteName%></a></h1>
|
||||
<p><%= Html.ActionLink("Changer de mot de passe","ChangePassword", "Account")%></p>
|
||||
<h1><%=ViewData["UserName"]%>'s profile - <a href="/"><%=YavscHelpers.SiteName%></a></h1>
|
||||
<p></p>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ValidationSummary() %>
|
||||
<%= Html.ActionLink("Changer de mot de passe","ChangePassword", "Account")%>
|
||||
|
||||
<%= Html.ValidationSummary() %>
|
||||
<% using(Html.BeginForm("UpdateProfile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %>
|
||||
<% { %>
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
<%@ Page Title="Register" Language="C#" Inherits="Yavsc.RegisterPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2> Créez votre compte utilisateur <%= Html.Encode(YavscHelpers.SiteName) %> </h2>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<%= Html.ValidationSummary() %>
|
||||
|
@ -1,17 +1,13 @@
|
||||
<%@ Page Title="Comptes utilisateur - Index" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Comptes utilisteur</h2>
|
||||
</asp:Content>
|
||||
<%@ Page Title="Comptes utilisateur" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<p>
|
||||
Votre compte utilisateur
|
||||
<%= Html.Encode(YavscHelpers.SiteName) %>
|
||||
a été créé, un e-mail de validation de votre compte a été envoyé a l'adresse fournie:<br/>
|
||||
<<%= Html.Encode(ViewData["email"]) %>>.<br/>
|
||||
Vous devriez le recevoir rapidement.<br/>
|
||||
Pour valider votre compte, suivez le lien indiqué dans cet e-mail.
|
||||
</p>
|
||||
<div>
|
||||
<a class="actionlink" href="<%=ViewData["ReturnUrl"]%>">Retour</a>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<%@ Page Title="User removal" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Suppression d'un rôle</h2>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.ValidationSummary() %>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<%@ Page Title="Role list" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Liste des rôles</h2>
|
||||
</asp:Content>
|
||||
<%@ Page Title="Liste des rôles" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
Roles:
|
||||
<ul>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<%@ Page Title="User List" Language="C#" Inherits="System.Web.Mvc.ViewPage<System.Web.Security.MembershipUserCollection>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Liste des utilisateurs</h2>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<ul>
|
||||
|
@ -1,8 +1,2 @@
|
||||
<%@ Page Title="Comptes utilisateur - Validation" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Validation d'un compte utilisateur</h2>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
</asp:Content>
|
||||
<!-- tout est dans le message du modèle App.master ViewData["Message"] -->
|
||||
|
@ -1,13 +1,7 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<Export>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
<h1>Backup created</h1>
|
||||
</asp:Content>
|
||||
<%@ Page Title="Backup created" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<Export>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div><h2>Error message </h2> <%= Html.Encode(Model.Error) %></div>
|
||||
<div><h2>Message </h2> <%= Html.Encode(Model.Message) %></div>
|
||||
<div><h2>File name</h2> <%= Html.Encode(Model.FileName) %></div>
|
||||
<div><h2>Exit Code</h2> <%= Html.Encode(Model.ExitCode) %></div>
|
||||
|
||||
</asp:Content>
|
||||
|
@ -1,10 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
<title>Backups</title>
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
<h1>Backups</h1>
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
<%=Html.ActionLink("Create a database backup", "CreateBackup", "BackOffice")%><br/>
|
||||
|
@ -1,8 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ValidationSummary("CreateBackup") %>
|
||||
<% using (Html.BeginForm("CreateBackup","BackOffice")) { %>
|
||||
|
@ -1,8 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ActionLink("Backups","Backups","BackOffice") %>
|
||||
</asp:Content>
|
||||
|
@ -1,11 +1,5 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
|
||||
<%= Html.ValidationSummary("Restore a database backup") %>
|
||||
<% using (Html.BeginForm("Restore","BackOffice")) { %>
|
||||
|
||||
|
@ -1,8 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<TaskOutput>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1><%=Html.Encode(ViewData["BackupName"])%> Restauration</h1>
|
||||
<div><h2>Error message </h2> <%= Html.Encode(Model.Error) %></div>
|
||||
|
@ -1,11 +1,6 @@
|
||||
<%@ Page Title="Comptes utilisateur - Index" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Comptes utilisteur</h2>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<%@ Page Title="Comptes utilisateur - Erreur" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.Encode(ViewData["Message"]) %></div>
|
||||
Your UID :
|
||||
|
@ -1,13 +1,5 @@
|
||||
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEntry>" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
|
||||
<asp:Content ContentPlaceHolderID="titleContent" ID="titleContentContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<%= Html.ValidationSummary() %>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEntryCollection>" MasterPageFile="~/Models/App.master"%>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="head" runat="server">
|
||||
<title> </title>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
Pas d'article trouvé ici: <<%= Html.Encode(ViewData["BlogUser"]) %>/<%= Html.Encode(ViewData["PostTitle"]) %>>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<FileUpload>" %>
|
||||
<%@ Page Title="File posting" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<FileUpload>" %>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<% using(Html.BeginForm("Create", "FileSystem", FormMethod.Post, new { enctype = "multipart/form-data" })) { %>
|
||||
|
@ -1,7 +1,3 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<%@ Page Title="File System - File removal" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
</asp:Content>
|
||||
|
@ -1,8 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<System.IO.FileInfo>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Model.Name %><br/>
|
||||
Création :
|
||||
|
@ -1,8 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ActionLink("Delete","FileSystem") %>
|
||||
<%= Html.ActionLink("Rename","FileSystem") %>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<Yavsc.FileInfoCollection>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1> Index of <%=ViewData["UserName"] %>'s files (<%= Html.Encode(Model.Count) %>) </h1>
|
||||
<ul>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<Brand>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h1><% if (Model.Logo!=null) { %>
|
||||
<img src="<%=Model.Logo.Src%>" alt="<%=Model.Logo.Alt%>"/>
|
||||
|
@ -1,9 +1,5 @@
|
||||
<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<Catalog>" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<% foreach (Brand b in Model.Brands ) { %><div>
|
||||
<h1> <%= Html.ActionLink( b.Name, "Brand", new { id = b.Name }, new { @class="actionlink" } ) %> </h1>
|
||||
|
@ -1,7 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<FormCollection collection>" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
</asp:Content>
|
||||
|
@ -1,10 +1,12 @@
|
||||
<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<PhysicalProduct>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
<title><%= Html.Encode(Model.Name) %></title>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
|
||||
<% Title = Model.Name; %>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h1><%= Html.Encode(Model.Name) %></h1>
|
||||
<i><%= Html.Encode(Model.Reference) %></i></asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div class="product">
|
||||
<p><%= Html.Encode(Model.Description) %></p>
|
||||
|
@ -1,8 +1,5 @@
|
||||
<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<ProductCategory>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<% foreach (Product p in Model.Products ) { %>
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<%@ Page Title="Référence absente au catalogue" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<!-- TODO more details -->
|
||||
</asp:Content>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage<Service>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
<title><%= Html.Encode(Model.Name) %></title>
|
||||
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
|
||||
<%= Title = ViewData ["BrandName"] + " " + Model.Name; %>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h1><%=ViewData ["BrandName"]%> - <%=ViewData ["ProdCatName"]%> - <%= Html.ActionLink( Model.Name, "Product", new { id = ViewData ["BrandName"], pc = ViewData ["ProdCatRef"] , pref = Model.Reference } ) %></h1>
|
||||
<h2> <%=ViewData ["ProdCatName"]%> - <%= Html.ActionLink( Model.Name, "Product", new { id = ViewData ["BrandName"], pc = ViewData ["ProdCatRef"] , pref = Model.Reference } ) %></h2>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
@ -1,7 +1,2 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="headerContent" ContentPlaceHolderID="header" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
</asp:Content>
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="head" runat="server">
|
||||
<%= "<title>Index - " + Html.Encode(YavscHelpers.SiteName) + "</title>" %>
|
||||
</asp:Content>
|
||||
<%@ Page Title="Workflow" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.ActionLink("blogs","Index","WorkFlow") %>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<%@ Page Title="Nouveau projet" Language="C#" Inherits="System.Web.Mvc.ViewPage<WorkFlow.NewProjectModel>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.ValidationSummary("Nouveau projet") %>
|
||||
|
@ -145,6 +145,7 @@
|
||||
<Compile Include="Controllers\BasketImpact.cs" />
|
||||
<Compile Include="MvcActionValueBinder.cs" />
|
||||
<Compile Include="Controllers\BlogsApiController.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Web.config" />
|
||||
|
17
yavscModel/IModule.cs
Normal file
17
yavscModel/IModule.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace yavscModel
|
||||
{
|
||||
public interface IModule
|
||||
{
|
||||
void Install();
|
||||
void Uninstall();
|
||||
ConfigurationSection DefaultConfig (string appName, string cnxStr);
|
||||
bool Active { get; set; }
|
||||
string ApplicationName { get; set; }
|
||||
void Initialize (string name, NameValueCollection config);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace yavscModel
|
||||
{
|
||||
public interface IProvider
|
||||
{
|
||||
string ApplicationName { get; set; }
|
||||
void Initialize (string name, NameValueCollection config);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ using System.Web.Mvc;
|
||||
namespace yavscModel.WorkFlow
|
||||
{
|
||||
|
||||
public interface IContentProvider : IProvider, IDisposable
|
||||
public interface IContentProvider : IModule, IDisposable
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@ -18,6 +18,7 @@ namespace yavscModel.WorkFlow
|
||||
StatusChange[] GetWrittingStatuses (long wrid);
|
||||
StatusChange[] GetEstimateStatuses (long estid);
|
||||
long CreateEstimate (string client, string title);
|
||||
Estimate [] GetEstimates(string client);
|
||||
Estimate GetEstimate (long estimid);
|
||||
long Write (long estid, string desc, decimal ucost, int count, long productid);
|
||||
void DropWritting (long wrid);
|
||||
|
@ -34,6 +34,7 @@
|
||||
<Reference Include="nunit.framework" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<Reference Include="System.Configuration" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -57,13 +58,13 @@
|
||||
<Compile Include="WorkFlow\IWFModule.cs" />
|
||||
<Compile Include="WorkFlow\IWFOrder.cs" />
|
||||
<Compile Include="WorkFlow\OrderStatusChangedEventArgs.cs" />
|
||||
<Compile Include="IProvider.cs" />
|
||||
<Compile Include="Blogs\BlogEntry.cs" />
|
||||
<Compile Include="Blogs\Blog.cs" />
|
||||
<Compile Include="Blogs\BlogEntryCollection.cs" />
|
||||
<Compile Include="Blogs\Comment.cs" />
|
||||
<Compile Include="Blogs\FindBlogEntryFlags.cs" />
|
||||
<Compile Include="WorkFlow\StatusChange.cs" />
|
||||
<Compile Include="IModule.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user