Initial import

This commit is contained in:
Paul Schneider 2014-07-16 20:35:03 +02:00
commit 04804b89a9
279 changed files with 12945 additions and 0 deletions

81
web/Admin/DataManager.cs Normal file
View file

@ -0,0 +1,81 @@
using System;
using System.Diagnostics;
using System.IO;
using yavscModel.Admin;
using Npgsql.Web.Blog;
namespace Yavsc.Admin
{
public class DataManager
{
DataAccess da;
public DataManager (DataAccess datac)
{
da = datac;
}
public Export CreateBackup ()
{
Environment.SetEnvironmentVariable("PGPASSWORD", da.Password);
Export e = new Export ();
string fileName = da.BackupPrefix + "-" + DateTime.Now.ToString ("yyyyMMdd");
FileInfo ofi = new FileInfo (fileName);
e.FileName = ofi.FullName;
Exec ("pg_dump", string.Format (
"-wb -Z3 -f {0} -Fd -h {1} -U {2} -p {3} {4}",
fileName, da.Host, da.Dbuser, da.Port, da.Dbname ),e);
return e;
}
private void Exec(string name, string args, TaskOutput output)
{
ProcessStartInfo Pinfo =
new ProcessStartInfo (name,args);
Pinfo.RedirectStandardError = true;
Pinfo.RedirectStandardOutput = true;
Pinfo.CreateNoWindow = true;
Pinfo.UseShellExecute = false;
using (Process p = new Process ()) {
p.EnableRaisingEvents = true;
p.StartInfo = Pinfo;
p.Start ();
p.WaitForExit ();
output.Error = p.StandardError.ReadToEnd ();
output.Message = p.StandardOutput.ReadToEnd ();
output.ExitCode = p.ExitCode;
p.Close ();
}
}
public TaskOutput Restore (string fileName, bool dataOnly)
{
Environment.SetEnvironmentVariable("PGPASSWORD", da.Password);
var t = new TaskOutput ();
Exec ("pg_restore", (dataOnly?"-a ":"")+string.Format (
"-1 -w -Fd -O -h {0} -U {1} -p {2} -d {3} {4}",
da.Host, da.Dbuser, da.Port, da.Dbname, fileName ),t);
return t;
}
public TaskOutput CreateDb ()
{
return Restore ("freshinstall", false);
}
public Export TagBackup (string filename, string [] tags)
{
/* FileInfo fi = new FileInfo (filename);
using (FileStream s = fi.OpenWrite ()) {
} */
throw new NotImplementedException ();
}
public TaskOutput TagRestore (string fileName)
{
Environment.SetEnvironmentVariable ("PGPASSWORD", da.Password);
var t = new TaskOutput ();
Exec ("pg_restore", string.Format (
"-a -w -Fd -O -h {0} -U {1} -p {2} -d {3} {4}",
da.Host, da.Dbuser, da.Port, da.Dbname, fileName ),t);
return t;
}
}
}

14
web/Admin/Export.cs Normal file
View file

@ -0,0 +1,14 @@
using System;
using System.ComponentModel;
namespace Yavsc.Admin
{
public class Export: TaskOutput
{
public Export ()
{
}
public string FileName { get; set; }
}
}

12
web/Admin/TaskOutput.cs Normal file
View file

@ -0,0 +1,12 @@
using System;
using System.ComponentModel;
namespace Yavsc.Admin
{
public class TaskOutput {
public string Message { get; set; }
public string Error { get; set; }
public int ExitCode { get; set; }
}
}

27
web/AssemblyInfo.cs Normal file
View file

@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Yavsc")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("paul schneider")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.2.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

17
web/Basket/Basket.cs Normal file
View file

@ -0,0 +1,17 @@
using System;
using SalesCatalog.Model;
using System.Collections.Generic;
namespace Yavsc.Basket
{
public class Basket
{
public Basket ()
{
}
public void Add(Product p)
{
}
}
}

View file

@ -0,0 +1,80 @@
using System;
using System.Web;
using SalesCatalog;
using SalesCatalog.Model;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Mvc.Html;
namespace Yavsc.CatExts
{
public static class WebCatalogExtensions
{
public static string CommandForm(this HtmlHelper<PhysicalProduct> helper, Product pos,string atc="Add to backet") {
StringBuilder sb = new StringBuilder ();
sb.Append (helper.ValidationSummary ());
TagBuilder ft = new TagBuilder ("form");
ft.Attributes.Add("action","/FrontOffice/Command");
ft.Attributes.Add("method","post");
ft.Attributes.Add("enctype","multipart/form-data");
TagBuilder fieldset = new TagBuilder ("fieldset");
TagBuilder legend = new TagBuilder ("legend");
legend.SetInnerText (pos.Name);
TagBuilder para = new TagBuilder ("p");
StringBuilder sbfc = new StringBuilder ();
if (pos.CommandForm != null)
foreach (FormElement e in pos.CommandForm.Items) {
sbfc.Append (e.ToHtml ());
sbfc.Append ("<br/>\n");
}
sbfc.Append (
string.Format(
"<input type=\"submit\" value=\"{0}\"/><br/>\n",
atc
));
sbfc.Append (helper.Hidden ("ref", pos.Reference));
para.InnerHtml = sbfc.ToString ();
fieldset.InnerHtml = legend.ToString ()+"\n"+para.ToString ();
ft.InnerHtml = fieldset.ToString ();
sb.Append (ft.ToString ());
return sb.ToString ();
}
public static string CommandForm(this HtmlHelper<Service> helper, Product pos,string atc="Add to backet") {
StringBuilder sb = new StringBuilder ();
sb.Append (helper.ValidationSummary ());
TagBuilder ft = new TagBuilder ("form");
ft.Attributes.Add("action","/FrontOffice/Command");
ft.Attributes.Add("method","post");
ft.Attributes.Add("enctype","multipart/form-data");
TagBuilder fieldset = new TagBuilder ("fieldset");
TagBuilder legend = new TagBuilder ("legend");
legend.SetInnerText (pos.Name);
TagBuilder para = new TagBuilder ("p");
StringBuilder sbfc = new StringBuilder ();
if (pos.CommandForm != null)
foreach (FormElement e in pos.CommandForm.Items) {
sbfc.Append (e.ToHtml ());
sbfc.Append ("<br/>\n");
}
sbfc.Append (
string.Format(
"<input type=\"submit\" value=\"{0}\"/><br/>\n",atc));
sbfc.Append (helper.Hidden ("ref", pos.Reference));
para.InnerHtml = sbfc.ToString ();
fieldset.InnerHtml = legend.ToString ()+"\n"+para.ToString ();
ft.InnerHtml = fieldset.ToString ();
sb.Append (ft.ToString ());
return sb.ToString ();
}
}
}

56
web/Catalog.xml Normal file
View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<XmlCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Brands>
<Brand>
<Name>shdsi</Name>
<Slogan>Votre logiciel, efficace, sûr, et sur mesure</Slogan>
<Logo>
<Src>/images/logoDev.png</Src>
<Alt></Alt>
</Logo>
<Categories>
<ProductCategory>
<Name>Systèmes d'information et sites Web</Name>
<Reference>ntic</Reference>
<Products>
<Product xsi:type="Service">
<Name>Développement</Name>
<Description>Votre Extranet, Intranet,
site Web, sur mesure, élégant et efficace, au look racé, accessible,
et développé en cycles courts</Description>
<Reference>nticdev</Reference>
</Product>
<Product xsi:type="Service">
<Name>Maintenance</Name>
<Description>Correction des anomalies, réalisation des évolutions, prévision des besoins</Description>
<Reference>nticmaint</Reference>
</Product>
</Products>
</ProductCategory>
</Categories>
<DefaultForm>
<Action>/Commande</Action>
<Items>
<FormElement xsi:type="Text">
<Val>Entrez un commentaire :</Val>
</FormElement>
<FormElement xsi:type="TextInput">
<Id>comment</Id>
<Value xsi:type="xsd:string">Commentaire</Value>
</FormElement>
<FormElement xsi:type="Text">
<Val>Choisissez le type d'intervention souhaité: </Val>
</FormElement>
<FormElement xsi:type="SelectInput">
<Id>ad</Id>
<Items>
<string>à distance</string>
<string>sur site</string>
</Items>
<SelectedIndex>0</SelectedIndex>
</FormElement>
</Items>
</DefaultForm>
</Brand>
</Brands>
</XmlCatalog>

View file

@ -0,0 +1,369 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Profile;
using System.Web.Security;
using Yavsc;
using yavscModel.RolesAndMembers;
using Yavsc.Helpers;
namespace Yavsc.Controllers
{
public class AccountController : Controller
{
private static string registrationMessage =
WebConfigurationManager.AppSettings ["RegistrationMessage"];
string avatarDir = "~/avatars";
public string AvatarDir {
get { return avatarDir; }
set { avatarDir = value; }
}
public ActionResult Index ()
{
return View ();
}
public ActionResult Login (string returnUrl)
{
ViewData ["returnUrl"] = returnUrl;
return View ();
}
[Authorize]
public ActionResult Profile(Profile model)
{
ViewData ["UserName"] = Membership.GetUser ().UserName;
model.FromProfileBase(HttpContext.Profile);
return View (model);
}
// TODO [ValidateAntiForgeryToken]
public ActionResult DoLogin (LoginModel model, string returnUrl)
{
if (ModelState.IsValid) {
if (Membership.ValidateUser (model.UserName, model.Password)) {
FormsAuthentication.SetAuthCookie (model.UserName, model.RememberMe);
if (returnUrl != null)
return Redirect (returnUrl);
else return View ("Index");
} else {
ModelState.AddModelError ("UserName", "The user name or password provided is incorrect.");
}
}
ViewData ["returnUrl"] = returnUrl;
// If we got this far, something failed, redisplay form
return View ("Login",model);
}
public ActionResult Register (RegisterViewModel model, string returnUrl)
{
ViewData["returnUrl"] = returnUrl;
if (Request.RequestType == "GET") {
foreach (string k in ModelState.Keys)
ModelState [k].Errors.Clear ();
return View (model);
}
if (ModelState.IsValid) {
if (model.ConfirmPassword != model.Password)
{
ModelState.AddModelError("ConfirmPassword","Veuillez confirmer votre mot de passe");
return View (model);
}
MembershipCreateStatus mcs;
var user = Membership.CreateUser (
model.UserName,
model.Password,
model.Email,
null,
null,
false,
out mcs);
switch (mcs) {
case MembershipCreateStatus.DuplicateEmail:
ModelState.AddModelError("Email", "Cette adresse e-mail correspond " +
"à un compte utilisateur existant");
return View (model);
case MembershipCreateStatus.DuplicateUserName:
ModelState.AddModelError("UserName", "Ce nom d'utilisateur est " +
"déjà enregistré");
return View (model);
case MembershipCreateStatus.Success:
FileInfo fi = new FileInfo (
Server.MapPath(registrationMessage));
if (!fi.Exists) {
ViewData["Error"] = "Erreur inattendue (pas de corps de message à envoyer)";
return View (model);
}
using (StreamReader sr = fi.OpenText()) {
string body = sr.ReadToEnd();
body = body.Replace("<%SiteName%>",YavscHelpers.SiteName);
body = body.Replace("<%UserName%>",user.UserName);
body = body.Replace("<%UserActivatonUrl%>",
string.Format("<{0}://{1}/Account/Validate/{2}?key={3}",
Request.Url.Scheme,
Request.Url.Authority,
user.UserName,
user.ProviderUserKey.ToString()));
using (MailMessage msg = new MailMessage(
HomeController.Admail,user.Email,
string.Format("Validation de votre compte {0}",YavscHelpers.SiteName),
body))
{
using (SmtpClient sc = new SmtpClient())
{
sc.Send (msg);
}
}
ViewData ["username"] = user.UserName;
ViewData ["email"] = user.Email;
return View ("RegistrationPending");
}
default:
ViewData["Error"] = "Une erreur inattendue s'est produite" +
"a l'enregistrement de votre compte utilisateur" +
string.Format("({0}).",mcs.ToString()) +
"Veuillez pardonner la gêne" +
"occasionnée";
return View (model);
}
}
return View (model);
}
public ActionResult ChangePasswordSuccess ()
{
return View ();
}
[HttpGet]
[Authorize]
public ActionResult ChangePassword()
{
return View();
}
[Authorize]
[HttpPost]
public ActionResult ChangePassword (ChangePasswordModel model)
{
if (ModelState.IsValid) {
// ChangePassword will throw an exception rather
// than return false in certain failure scenarios.
bool changePasswordSucceeded;
try {
var users = Membership.FindUsersByName (model.Username);
if (users.Count > 0) {
MembershipUser user = Membership.GetUser (model.Username,true);
changePasswordSucceeded = user.ChangePassword (model.OldPassword, model.NewPassword);
} else {
changePasswordSucceeded = false;
}
} catch (Exception) {
changePasswordSucceeded = false;
}
if (changePasswordSucceeded) {
return RedirectToAction ("ChangePasswordSuccess");
} else {
ModelState.AddModelError ("Password", "The current password is incorrect or the new password is invalid.");
}
}
// If we got this far, something failed, redisplay form
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)
public ActionResult UpdateProfile(Profile model, HttpPostedFileBase AvatarFile)
{
string username = Membership.GetUser ().UserName;
if (AvatarFile != null) {
if (AvatarFile.ContentType == "image/png") {
// byte[] img = new byte[AvatarFile.ContentLength];
// AvatarFile.InputStream.Read (img, 0, AvatarFile.ContentLength);
// model.Avatar = img;
string avdir=Server.MapPath (AvatarDir);
string avpath=Path.Combine(avdir,username+".png");
AvatarFile.SaveAs (avpath);
} else
ModelState.AddModelError ("Avatar",
string.Format ("Image type {0} is not supported (suported formats : {1})",
AvatarFile.ContentType, "image/png")
);
}
if (ModelState.IsValid) {
HttpContext.Profile.SetPropertyValue (
"Address", model.Address);
HttpContext.Profile.SetPropertyValue (
"BlogTitle", model.BlogTitle);
HttpContext.Profile.SetPropertyValue (
"BlogVisible", model.BlogVisible);
HttpContext.Profile.SetPropertyValue (
"CityAndState", model.CityAndState);
HttpContext.Profile.SetPropertyValue (
"Country", model.Country);
HttpContext.Profile.SetPropertyValue (
"WebSite", model.WebSite);
}
// HttpContext.Profile.SetPropertyValue("Avatar",Avatar);
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)
{
FormsAuthentication.SignOut();
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 ();
}
public ActionResult Validate (string id, string key)
{
MembershipUser u = Membership.GetUser (id, false);
if (u == null) {
ViewData ["Error"] =
string.Format ("Cet utilisateur n'existe pas ({0})", id);
}
else
if (u.ProviderUserKey.ToString () == key) {
u.IsApproved = true;
Membership.UpdateUser(u);
ViewData["Message"] =
string.Format ("La création de votre compte ({0}) est validée.", id);
}
else ViewData["Error"] = "La clé utilisée pour valider ce compte est incorrecte";
return View ();
}
}
}

View file

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

View file

@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
namespace Yavsc.Controllers
{
public class BasketController : Controller
{
public ActionResult Index()
{
return View ();
}
public ActionResult Details(int id)
{
return View ();
}
public ActionResult Create()
{
var user = Membership.GetUser ();
var username = (user != null)?user.UserName:Request.AnonymousID;
// get an existing basket
return View ();
}
[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 ();
}
}
}
}

View file

@ -0,0 +1,269 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net.Mime;
using System.Runtime.Serialization.Formatters.Binary;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Profile;
using System.Web.Security;
using CodeKicker.BBCode;
using Npgsql.Web.Blog;
using Npgsql.Web.Blog.DataModel;
using Yavsc;
using yavscModel;
namespace Yavsc.Controllers
{
public class BlogsController : Controller
{
string defaultAvatarMimetype;
private string sitename =
WebConfigurationManager.AppSettings ["Name"];
string avatarDir = "~/avatars";
public string AvatarDir {
get { return avatarDir; }
set { avatarDir = value; }
}
public BlogsController ()
{
string[] defaultAvatarSpec = ConfigurationManager.AppSettings.Get ("DefaultAvatar").Split (';');
if (defaultAvatarSpec.Length != 2)
throw new ConfigurationErrorsException ("the DefaultAvatar spec should be found as <fileName>;<mime-type> ");
defaultAvatar = defaultAvatarSpec [0];
defaultAvatarMimetype = defaultAvatarSpec [1];
}
public ActionResult Index (string user = null, string title = null, int pageIndex=0, int pageSize=10)
{
if (string.IsNullOrEmpty (user)) {
ViewData ["Message"] = "Blogs";
return BlogList (pageIndex, pageSize);
} else {
MembershipUser u = Membership.GetUser (user, false);
if (u == null) {
ModelState.AddModelError ("UserName",
string.Format ("Utilisateur inconu : {0}", user));
return BlogList ();
} else {
if (string.IsNullOrEmpty (title))
return UserPosts (user, pageIndex, pageSize);
return UserPost (user, title);
}
}
}
public ActionResult BlogList (int pageIndex = 0, int pageSize = 10)
{
ViewData ["SiteName"] = sitename;
int totalRecords;
BlogEntryCollection bs = BlogManager.LastPosts (pageIndex, pageSize, out totalRecords);
ViewData ["RecordCount"] = totalRecords;
ViewData ["PageSize"] = pageSize;
ViewData ["PageIndex"] = pageIndex;
return View ("Index", bs);
}
[HttpGet]
public ActionResult UserPosts (string user, int pageIndex = 0, int pageSize = 10)
{
int tr;
MembershipUser u = Membership.GetUser ();
FindBlogEntryFlags sf = FindBlogEntryFlags.MatchUserName;
ViewData ["SiteName"] = sitename;
ViewData ["BlogUser"] = user;
if (u != null)
if (u.UserName == user)
sf |= FindBlogEntryFlags.MatchInvisible;
BlogEntryCollection c = BlogManager.FindPost (user, sf, pageIndex, pageSize, out tr);
ViewData ["BlogTitle"] = BlogTitle (user);
ViewData ["PageIndex"] = pageIndex;
ViewData ["PageSize"] = pageSize;
ViewData ["RecordCount"] = tr;
return View ("UserPosts", c);
}
[Authorize]
public ActionResult RemoveComment(long cmtid)
{
long postid = BlogManager.RemoveComment (cmtid);
return UserPost (postid);
}
private ActionResult UserPost (long id)
{
ViewData ["PostId"] = id;
BlogEntry e = BlogManager.GetPost (id);
return UserPost (e);
}
private ActionResult UserPost (BlogEntry e)
{
if (e == null)
return View ("TitleNotFound");
MembershipUser u = Membership.GetUser ();
if (u != null)
ViewData ["UserName"] = u.UserName;
if (!e.Visible) {
if (u==null)
return View ("TitleNotFound");
else if (u.UserName!=e.UserName)
return View ("TitleNotFound");
}
ViewData ["BlogTitle"] = BlogTitle (e.UserName);
ViewData ["Comments"] = BlogManager.GetComments (e.Id);
return View ("UserPost", e);
}
public ActionResult UserPost (string user, string title)
{
ViewData ["BlogUser"] = user;
ViewData ["PostTitle"] = title;
int postid = 0;
if (string.IsNullOrEmpty (title)) {
if (int.TryParse (user, out postid)) {
return UserPost (BlogManager.GetPost (postid));
}
}
return UserPost (BlogManager.GetPost (user, title));
}
[Authorize]
public ActionResult Post (string user, string title)
{
ViewData ["SiteName"] = sitename;
string un = Membership.GetUser ().UserName;
if (String.IsNullOrEmpty (user))
user = un;
if (un != user)
ViewData ["Message"] = string.Format ("Vous n'êtes pas {0}!", user);
ViewData ["UserName"] = un;
return View (new BlogEditEntryModel { Title = title });
}
[Authorize]
public ActionResult ValidatePost (BlogEditEntryModel model)
{
string username = Membership.GetUser ().UserName;
ViewData ["SiteName"] = sitename;
ViewData ["BlogUser"] = username;
if (ModelState.IsValid) {
if (!model.Preview) {
BlogManager.Post (username, model.Title, model.Content, model.Visible);
return UserPost (username, model.Title);
}
}
return View ("Post", model);
}
[Authorize]
public ActionResult ValidateEdit (BlogEditEntryModel model)
{
ViewData ["SiteName"] = sitename;
ViewData ["BlogUser"] = Membership.GetUser ().UserName;
if (ModelState.IsValid) {
if (!model.Preview) {
BlogManager.UpdatePost (model.Id, model.Content, model.Visible);
return UserPost (model);
}
}
return View ("Edit", model);
}
[Authorize]
public ActionResult Edit (BlogEditEntryModel model)
{
if (model != null) {
string user = Membership.GetUser ().UserName;
ViewData ["BlogTitle"] = this.BlogTitle (user);
ViewData ["UserName"] = user;
if (model.UserName == null) {
model.UserName = user;
BlogEntry e = BlogManager.GetPost (model.UserName, model.Title);
if (e == null) {
return View ("TitleNotFound");
} else {
model = new BlogEditEntryModel (e);
ModelState.Clear ();
this.TryValidateModel (model);
}
} else if (model.UserName != user) {
return View ("TitleNotFound");
}
}
return View (model);
}
private string BlogTitle (string user)
{
return string.Format ("{0}'s blog", user);
}
public ActionResult Comment (BlogEditCommentModel model) {
string username = Membership.GetUser ().UserName;
ViewData ["SiteName"] = sitename;
if (ModelState.IsValid) {
if (!model.Preview) {
BlogManager.Comment(username, model.PostId, model.CommentText, model.Visible);
return UserPost (model.PostId);
}
}
return View (model);
}
string defaultAvatar;
[AcceptVerbs (HttpVerbs.Get)]
public ActionResult Avatar (string user)
{
string avpath = Path.Combine (
Server.MapPath (AvatarDir), user + ".png");
FileInfo fia = new FileInfo (avpath);
if (!fia.Exists)
fia = new FileInfo (Server.MapPath (defaultAvatar));
return File (fia.OpenRead (), defaultAvatarMimetype);
}
[Authorize]
public ActionResult Remove (string user, string title, string returnUrl)
{
if (!Roles.IsUserInRole ("Admin")) {
string rguser = Membership.GetUser ().UserName;
if (rguser != user) {
ModelState.AddModelError (
"Title", string.Format (
"Vous n'avez pas de droits sur le Blog de {0}",
user));
return Return (returnUrl);
}
}
BlogEntry e = BlogManager.GetPost (user, title);
if (e == null) {
ModelState.AddModelError (
"Title",
string.Format (
"Aucun post portant le titre \"{0}\" pour l'utilisateur {1}",
title, user));
return Return (returnUrl);
}
BlogManager.RemovePost (user, title);
return Return (returnUrl);
}
private ActionResult Return (string returnUrl)
{
if (!string.IsNullOrEmpty (returnUrl))
return Redirect (returnUrl);
else
return RedirectToAction ("Index");
}
}
}

View file

@ -0,0 +1,21 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Web.Mvc;
using System.Web;
using System.Text.RegularExpressions;
using System.IO;
using Yavsc.Controllers;
namespace Yavsc.Controllers
{
public class Commande
{
public Commande(FormCollection collection)
{
}
}
}

View file

@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using System.Web.Security;
using FileSystem;
using System.Text.RegularExpressions;
namespace Yavsc.Controllers
{
public class FileSystemController : Controller
{
private static string usersDir ="users";
public static string UsersDir {
get {
return usersDir;
}
}
[Authorize]
public ActionResult Index()
{
string user = Membership.GetUser ().UserName;
ViewData ["UserName"] = user;
DirectoryInfo di = new DirectoryInfo (
Path.Combine(
UsersDir,
user));
if (!di.Exists)
di.Create ();
return View (new FileInfoCollection( di.GetFiles()));
}
public ActionResult Details(string id)
{
foreach (char x in Path.GetInvalidPathChars()) {
if (id.Contains (x)) {
ViewData ["Message"] =
string.Format (
"Something went wrong following the following path : {0} (\"{1}\")",
id,x);
return RedirectToAction ("Index");
}
}
string fpath = Path.Combine (BaseDir, id);
ViewData["Content"] = Url.Content (fpath);
FileInfo fi = new FileInfo (fpath);
return View (fi);
}
public ActionResult Create()
{
return View ();
}
[HttpPost]
[Authorize]
public ActionResult Create(FormCollection collection)
{
try {
string fnre = "[A-Za-z0-9~\\-.]+";
HttpFileCollectionBase hfc = Request.Files;
for (int i=0; i<hfc.Count; i++)
{
if (!Regex.Match(hfc[i].FileName,fnre).Success)
{
ViewData ["Message"] += string.Format("<p>File name '{0}' refused</p>",hfc[i].FileName);
ModelState.AddModelError(
"AFile",
string.Format(
"The file name {0} dosn't match an acceptable file name {1}",
hfc[i].FileName,fnre))
;
return View();
}
}
for (int i=0; i<hfc.Count; i++)
{
// TODO Limit with hfc[h].ContentLength
hfc[i].SaveAs(Path.Combine(BaseDir,hfc[i].FileName));
ViewData ["Message"] += string.Format("<p>File name '{0}' saved</p>",hfc[i].FileName);
}
return RedirectToAction ("Index","FileSystem");
} catch (Exception e) {
ViewData ["Message"] = "Exception:"+e.Message;
return View ();
}
}
public static string BaseDir { get { return Path.Combine (UsersDir, Membership.GetUser ().UserName); } }
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 ();
}
}
}
}

View file

@ -0,0 +1,85 @@
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;
namespace Yavsc.ApiControllers
{
public class FrontOfficeController : ApiController
{
[AcceptVerbs("GET")]
public Catalog Catalog ()
{
return CatalogManager.GetCatalog ();
}
[AcceptVerbs("GET")]
public ProductCategory GetProductCategorie (string brandName, string prodCategorie)
{
return CatalogManager.GetCatalog ().GetBrand (brandName).GetProductCategory (prodCategorie)
;
}
[AcceptVerbs("POST")]
public string Command()
{
return null;
}
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;
}
[HttpPost]
public string ProfileImagePost(HttpPostedFile profileImage)
{
string[] extensions = { ".jpg", ".jpeg", ".gif", ".bmp", ".png" };
if (!extensions.Any(x => x.Equals(Path.GetExtension(profileImage.FileName.ToLower()), StringComparison.OrdinalIgnoreCase)))
{
throw new HttpResponseException(
new HttpResponseMessage(HttpStatusCode.BadRequest));
}
// string root = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/uploads");
// Other code goes here
// profileImage.SaveAs ();
return "/path/to/image.png";
}
}
}

View file

@ -0,0 +1,128 @@
using System;
using Yavsc;
using SalesCatalog;
using SalesCatalog.Model;
using System.Web.Mvc;
using System.Web;
using System.Text.RegularExpressions;
using System.IO;
using Yavsc.Controllers;
using System.Collections.Generic;
namespace Yavsc.Controllers
{
public class FrontOfficeController : Controller
{
[AcceptVerbs("GET")]
public ActionResult Catalog ()
{
return View (
CatalogManager.GetCatalog ()
);
}
/// <summary>
/// Catalog this instance.
/// </summary>
[AcceptVerbs("GET")]
public ActionResult Brand (string id)
{
Catalog c = CatalogManager.GetCatalog ();
ViewData ["BrandName"] = id;
return View ( c.GetBrand (id) );
}
/// <summary>
/// get the product category
/// </summary>
/// <returns>The category.</returns>
/// <param name="bn">Bn.</param>
/// <param name="pc">Pc.</param>
[AcceptVerbs("GET")]
public ActionResult ProductCategory (string id, string pc)
{
ViewData ["BrandName"] = id;
return View (
CatalogManager.GetCatalog ().GetBrand (id).GetProductCategory (pc)
);
}
[AcceptVerbs("GET")]
public ActionResult Product (string id, string pc, string pref)
{
Product p = null;
ViewData ["BrandName"] = id;
ViewData ["ProdCatRef"] = pc;
ViewData ["ProdRef"] = pref;
Catalog cat = CatalogManager.GetCatalog ();
if (cat == null) {
ViewData ["Message"] = "Catalog introuvable";
ViewData ["RefType"] = "Catalog";
return View ("ReferenceNotFound");
}
Brand b = cat.GetBrand (id);
if (b == null) {
ViewData ["RefType"] = "Brand";
return View ("ReferenceNotFound");
}
ProductCategory pcat = b.GetProductCategory (pc);
if (pcat == null) {
ViewData ["RefType"] = "ProductCategory";
return View ("ReferenceNotFound");
}
ViewData ["ProdCatName"] = pcat.Name;
p = pcat.GetProduct (pref);
if (p.CommandForm==null)
p.CommandForm = b.DefaultForm;
return View ((p is Service)?"Service":"Product", p);
}
public ActionResult Command()
{
return View ();
}
[HttpPost]
[Authorize]
public ActionResult Command(FormCollection collection)
{
try {
// get files from the request
string fnre = "[A-Za-z0-9~\\-.]+";
HttpFileCollectionBase hfc = Request.Files;
foreach (String h in hfc.AllKeys)
{
if (!Regex.Match(hfc[h].FileName,fnre).Success)
{
ViewData ["Message"] = "File name refused";
ModelState.AddModelError(
h,
string.Format(
"The file name {0} dosn't match an acceptable file name {1}",
hfc[h].FileName,fnre))
;
return View(collection);
}
}
foreach (String h in hfc.AllKeys)
{
// TODO Limit with hfc[h].ContentLength
hfc[h].SaveAs(Path.Combine(FileSystemController.BaseDir,hfc[h].FileName));
}
if (Session["Basket"]==null)
Session["Basket"]=new List<Commande>();
List<Commande> basket = Session["Basket"] as List<Commande>;
// Add specified product command to the basket,
basket.Add(new Commande(collection));
return View (collection);
} catch (Exception e) {
ViewData ["Message"] = "Exception:"+e.Message;
return View (collection);
}
}
}
}

View file

@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Yavsc;
namespace Yavsc.Controllers
{
public class HomeController : Controller
{
// Site name
private static string name = null;
/// <summary>
/// Gets or sets the site name.
/// </summary>
/// <value>The name.</value>
[Obsolete("Use YavscHelpers.SiteName insteed.")]
public static string Name {
get {
if (name == null)
name = WebConfigurationManager.AppSettings ["Name"];
return name;
}
}
// Administrator email
private static string admail =
WebConfigurationManager.AppSettings ["AdminEmail"];
/// <summary>
/// Gets the Administrator email.
/// </summary>
/// <value>The admail.</value>
public static string Admail {
get {
return admail;
}
}
private static string owneremail = null;
/// <summary>
/// Gets or sets the owner email.
/// </summary>
/// <value>The owner email.</value>
public static string OwnerEmail {
get {
if (owneremail == null)
owneremail = WebConfigurationManager.AppSettings.Get ("OwnerEMail");
return owneremail;
}
set {
owneremail = value;
}
}
public ActionResult Index ()
{
InitCatalog ();
ViewData ["Message"] = string.Format(T.GetString("Welcome")+"({0})",GetType ().Assembly.FullName);
return View ();
}
public void InitCatalog() {
CultureInfo culture = null;
string defaultCulture = "fr";
if (Request.UserLanguages.Length > 0) {
try {
culture = new CultureInfo (Request.UserLanguages [0]);
}
catch (Exception e) {
ViewData ["Message"] = e.ToString ();
culture = CultureInfo.CreateSpecificCulture(defaultCulture);
}
}
else culture = CultureInfo.CreateSpecificCulture(defaultCulture);
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
string lcd = Server.MapPath ("./locale");
Mono.Unix.Catalog.Init("i8n1", lcd );
}
public ActionResult AOEMail (string reason, string body)
{
// requires valid owner and admin email?
using (System.Net.Mail.MailMessage msg = new MailMessage(owneremail,admail,"Poke : "+reason,body))
{
using (System.Net.Mail.SmtpClient sc = new SmtpClient())
{
sc.Send (msg);
return View ();
}
}
}
}
}

22
web/Controllers/T.cs Normal file
View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Net.Mail;
using Yavsc;
using System.Globalization;
namespace Yavsc
{
public class T
{
public static string GetString(string msgid)
{
return Mono.Unix.Catalog.GetString (msgid);
}
}
}

View file

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using WorkFlowProvider;
using yavscModel.WorkFlow;
namespace Yavsc.ApiControllers
{
public class WorkFlowController : ApiController
{
[HttpGet]
public object Index()
{
return new { test="Hello World" };
}
public object Details(int id)
{
throw new NotImplementedException ();
}
public object Create()
{
throw new NotImplementedException ();
}
public object Edit(int id)
{
throw new NotImplementedException ();
}
public object Delete(int id)
{
throw new NotImplementedException ();
}
IContentProvider contentProvider = null;
IContentProvider ContentProvider {
get {
if (contentProvider == null )
contentProvider = WFManager.GetContentProviderFWC ();
return contentProvider;
}
}
}
}

15
web/FileInfoCollection.cs Normal file
View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace Yavsc
{
public class FileInfoCollection : List<FileInfo>
{
public FileInfoCollection (System.IO.FileInfo[] collection)
{
this.AddRange (collection);
}
}
}

1
web/Global.asax Normal file
View file

@ -0,0 +1 @@
<%@ Application Inherits="Yavsc.MvcApplication" %>

69
web/Global.asax.cs Normal file
View file

@ -0,0 +1,69 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Http;
namespace Yavsc
{
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes (RouteCollection routes)
{
routes.IgnoreRoute ("{resource}.axd/{*pathInfo}");
routes.MapRoute (
"Blog",
"Blog/{user}/{title}",
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional }
);
routes.MapRoute (
"Blogs",
"Blogs/{action}/{user}/{title}",
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional}
);
routes.MapRoute (
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
}
protected void Application_Start ()
{
AreaRegistration.RegisterAllAreas ();
GlobalConfiguration.Configuration.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{*path}",
defaults: new { controller = "WorkFlow", action="Index", path = "" }
);
RegisterRoutes (RouteTable.Routes);
Error += HandleError;
}
void HandleError (object sender, EventArgs e)
{
if (Server.GetLastError ().GetBaseException () is System.Web.HttpRequestValidationException) {
Response.Clear ();
Response.Write ("Invalid characters.<br>");
Response.Write ("You may want to use your " +
"browser to go back to your form. " +
"You also can <a href=\"" +
Request.UrlReferrer +
"\">hit the url referrer</a>.");
Response.StatusCode = 200;
Response.End ();
}
}
}
}

349
web/Helpers/BBCodeHelper.cs Normal file
View file

@ -0,0 +1,349 @@
using System;
using CodeKicker.BBCode;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Collections.Specialized;
using System.Text;
namespace Yavsc.Helpers
{
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;
public static string BBCodeViewClass {
get {
return cclass;
}
set {
cclass = value;
}
}
public static string BBCodeCaseClass {
get {
return tclass;
}
set {
tclass = value;
}
}
public static string[] BBTagsUsage {
get {
List<string> u = new List<string> ();
foreach (BBTag t in Parser.Tags)
if (!parent.ContainsValue(t))
{
TagBuilder tib = new TagBuilder ("div");
tib.AddCssClass (BBCodeCaseClass);
string temp = tagUsage (t);
tib.InnerHtml = temp;
u.Add (string.Format ("{0} <div class=\"{2}\">{1}</div>", tib.ToString (), Parser.ToHtml (temp),BBCodeViewClass));
}
return u.ToArray ();
}
}
static string tagUsage(BBTag t,string content=null)
{
StringBuilder sb = new StringBuilder ();
sb.AppendFormat ("[{0}", t.Name);
List<string> done = new List<string> ();
foreach (var a in t.Attributes) {
if (string.IsNullOrEmpty (a.Name)) {
sb.AppendFormat ("=default_attribute_value");
done.Add (a.ID);
}
}
foreach (var a in t.Attributes) {
if (!done.Contains(a.ID)) {
sb.AppendFormat (" {0}=attribute_value", a.ID);
done.Add (a.ID);
}
}
if (content==null)
sb.AppendFormat ("]content[/{0}]", t.Name);
else
sb.AppendFormat ("]{1}[/{0}]", t.Name, content);
if (!parent.ContainsKey(t.Name)) return sb.ToString ();
return tagUsage (parent [t.Name],sb.ToString());
}
private static BBCodeParser parser = null;
private static int sect1;
private static int sect2;
private static int sect3;
private static Dictionary<string,string> d = new Dictionary<string,string> ();
public static void Init ()
{
sect1 = 0;
sect2 = 0;
sect3 = 0;
d.Clear ();
}
static string TocContentTransformer (string instr)
{
StringBuilder ttb = new StringBuilder ();
int m1=0, m2=0, m3=0;
foreach (string key in d.Keys) {
int s1 = 0, s2 = 0, s3 = 0;
string[] snums = key.Split ('.');
s1 = int.Parse (snums [0]);
if (snums.Length>1)
s2 = int.Parse (snums [1]);
if (snums.Length>2) {
s3 = int.Parse (snums [2]);
}
if (m1 < s1)
m1 = s1;
if (m2 < s2)
m2 = s2;
if (m3 < s3)
m3 = s3;
}
string[,,] toc = new string[m1+1, m2+1, m3+1];
foreach (string key in d.Keys) {
int s1 = 0, s2 = 0, s3 = 0;
string[] snums = key.Split ('.');
s1 = int.Parse (snums [0]);
if (snums.Length>1)
s2 = int.Parse (snums [1]);
if (snums.Length>2) {
s3 = int.Parse (snums [2]);
}
toc [s1, s2, s3] = d [key];
}
for (int i = 1; i<=m1; i++) {
string t1 = toc [i, 0, 0];
// assert t1 != null
ttb.AppendFormat ("<a href=\"#s{0}\">{0}) {1}</a><br/>\n", i, t1);
for (int j = 1; j <= m2; j++) {
string t2 = toc[i,j,0];
if (t2 == null)
break;
ttb.AppendFormat ("<a href=\"#s{0}.{1}\">{0}.{1}) {2}</a><br/>\n", i,j, t2);
for (int k = 1; k <= m3; k++) {
string t3 = toc[i,j,k];
if (t3 == null)
break;
ttb.AppendFormat ("<a href=\"#s{0}.{1}.{2}\">{0}.{1}.{2}) {3}</a><br/>\n", i,j,k,t3);
}
}
}
return ttb.ToString ();
}
static string DocPageContentTransformer (string instr)
{
return TocContentTransformer(instr)+instr;
}
static string TagContentTransformer (string instr)
{
return instr;
}
static string TitleContentTransformer (IAttributeRenderingContext arg)
{
string tk;
if (arg.AttributeValue==null)
return null;
string t = arg.AttributeValue;
t=t.Replace ('_', ' ');
if (sect3 == 0)
if (sect2 == 0) {
tk = string.Format ("{0}", sect1);
}
else
tk = string.Format ("{0}.{1}", sect1 + 1, sect2);
else
tk = string.Format ("{0}.{1}.{2}", sect1 + 1, sect2 + 1, sect3);
if (!d.ContainsKey (tk))
d.Add (tk, t);
return t;
}
static string Section1Transformer (string instr)
{
sect1++;
sect2 = 0;
sect3 = 0;
return instr;
}
static string Section2Transformer (string instr)
{
sect2++;
sect3 = 0;
return instr;
}
static string Section3Transformer (string instr)
{
sect3++;
return instr;
}
static string L3ContentTransformer (IAttributeRenderingContext arg)
{
return (sect1 + 1).ToString () + "." + (sect2 + 1) + "." + sect3;
}
static string L2ContentTransformer (IAttributeRenderingContext arg)
{
return (sect1 + 1).ToString () + "." + sect2;
}
static string L1ContentTransformer (IAttributeRenderingContext arg)
{
return sect1.ToString ();
}
static string OggSrcTr (IAttributeRenderingContext arg)
{
ogg = arg.AttributeValue;
return ogg;
}
static string Mp4SrcTr (IAttributeRenderingContext arg)
{
mp4=arg.AttributeValue;
return mp4;
}
static string WebmSrcTr (IAttributeRenderingContext arg)
{
webm = arg.AttributeValue;
return webm;
}
static string VideoContentTransformer (string cnt)
{
StringBuilder sb = new StringBuilder();
if (mp4 != null) {
TagBuilder tb = new TagBuilder ("source");
tb.Attributes.Add ("src", mp4);
tb.Attributes.Add ("type", "video/mp4");
sb.Append (tb.ToString(TagRenderMode.StartTag));
}
if (ogg != null) {
TagBuilder tb = new TagBuilder ("source");
tb.Attributes.Add ("src", ogg);
tb.Attributes.Add ("type", "video/ogg");
sb.Append (tb.ToString(TagRenderMode.StartTag));
}
if (webm != null) {
TagBuilder tb = new TagBuilder ("source");
tb.Attributes.Add ("src", webm);
tb.Attributes.Add ("type", "video/webm");
sb.Append (tb.ToString(TagRenderMode.StartTag));
}
mp4 = null;
ogg=null;
webm=null;
sb.Append (cnt);
return sb.ToString();
}
public static BBCodeParser Parser {
get {
if (parser == null) {
Init ();
BBTag bblist =new BBTag ("list", "<ul>", "</ul>");
BBTag bbs2=new BBTag ("sect2",
"<div class=\"section\">" +
"<h2><a name=\"s${para}\" href=\"#${para}\">${para} - ${title}</a></h2>" +
"<div>${content}",
"</div></div>",
false, true,
Section2Transformer,
new BBAttribute ("title", "",TitleContentTransformer),
new BBAttribute ("title", "title", TitleContentTransformer),
new BBAttribute ("para", "para", L2ContentTransformer));
BBTag bbs1=new BBTag ("sect1",
"<div class=\"section\">" +
"<h1><a name=\"s${para}\" href=\"#s${para}\">${para} - ${title}</a></h1>" +
"<div>${content}",
"</div></div>",
false, true,
Section1Transformer,
new BBAttribute ("title", "",TitleContentTransformer),
new BBAttribute ("title", "title", TitleContentTransformer),
new BBAttribute ("para", "para", L1ContentTransformer));
BBTag bbdp=new BBTag ("docpage",
"<div class=docpage>${content}</div>", "",
false,
false,
DocPageContentTransformer);
parser = new BBCodeParser (new[] {
new BBTag ("b", "<b>", "</b>"),
new BBTag ("i", "<span style=\"font-style:italic;\">", "</span>"),
new BBTag ("u", "<span style=\"text-decoration:underline;\">", "</span>"),
new BBTag ("code", "<span class=\"code\">", "</span>"),
new BBTag ("img", "<img src=\"${content}\" style=\"${style}\"/>", "", false, true, new BBAttribute ("style", "style")),
new BBTag ("quote", "<blockquote>", "</blockquote>"),
new BBTag ("div", "<div style=\"${style}\">", "</div>", new BBAttribute("style","style")),
new BBTag ("p", "<p>", "</p>"),
new BBTag ("h", "<h2>", "</h2>"),
bblist,
new BBTag ("*", "<li>", "</li>", true, false),
new BBTag ("url", "<a href=\"${href}\">", "</a>", new BBAttribute ("href", ""), new BBAttribute ("href", "href")),
new BBTag ("br", "<br/>", "", true, false),
new BBTag ("video", "<video style=\"${style}\" controls>" +
"<source src=\"${mp4}\" type=\"video/mp4\"/>" +
"<source src=\"${ogg}\" type=\"video/ogg\"/>" +
"<source src=\"${webm}\" type=\"video/webm\"/>","</video>",
new BBAttribute("mp4","mp4"),
new BBAttribute("ogg","ogg"),
new BBAttribute("webm","webm"),
new BBAttribute("style","style")),
new BBTag ("tag", "<span class=\"tag\">", "</span>", true, true,
TagContentTransformer),
bbs1,
bbs2,
new BBTag ("sect3",
"<div class=\"section\">" +
"<h3><a name=\"s${para}\" href=\"#${para}\">${para} - ${title}</a></h3>" +
"<div>${content}",
"</div></div>",
false, true,
Section3Transformer,
new BBAttribute ("title", "",TitleContentTransformer),
new BBAttribute ("title", "title", TitleContentTransformer),
new BBAttribute ("para", "para", L3ContentTransformer)
),
bbdp,
new BBTag ("f", "<iframe src=\"${src}\">", "</iframe>",
new BBAttribute ("src", ""), new BBAttribute ("src", "src")),
}
);
parent.Add ("*", bblist);
parent.Add ("sect3", bbs2);
parent.Add ("sect2", bbs1);
parent.Add ("sect1", bbdp);
}
return parser;
}
}
}
}

View file

@ -0,0 +1,19 @@
using System;
using System.Web;
using System.Configuration;
namespace Yavsc.Helpers
{
public static class YavscHelpers
{
private static string siteName = null;
public static string SiteName {
get {
if (siteName == null)
siteName = ConfigurationManager.AppSettings ["Name"];
return siteName;
}
}
}
}

61
web/Models/App.master Normal file
View file

@ -0,0 +1,61 @@
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="/style.css"/>
<link rel="icon" type="image/png" href="/favicon.png" />
<link href='http://fonts.googleapis.com/css?family=Dancing+Script:400,700' rel='stylesheet' type='text/css'/>
<title>
<asp:ContentPlaceHolder ID="titleContent" runat="server" />
<asp:Literal runat="server" Text=" - " /><%= YavscHelpers.SiteName %>
</title>
<asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder>
</head>
<body>
<header>
<div id="login">
<% if (Membership.GetUser()==null) { %>
<%= Html.ActionLink("Login", "Login", "Account", new { returnUrl=Request.Url.PathAndQuery }, null ) %>
<% } else { %>
<%= HttpContext.Current.User.Identity.Name %>
<%= Html.ActionLink( "Logout", "Logout", "Account", new { returnUrl=Request.Url.PathAndQuery }, null) %>
<%= Html.ActionLink( "Poster", "Post", "Blogs" ) %>
<%= Html.ActionLink( "Profile", "Profile", "Account" ) %>
<% } %>
<%= Html.ActionLink( "Accueil", "Index", "Home" ) %>
</div>
<asp:ContentPlaceHolder ID="header" runat="server">
<h1><a href="/"> <%=Html.Encode(YavscHelpers.SiteName)%> </a></h1>
<% if (ViewData["Error"]!=null) { %>
<div class="Error">
<%= Html.Encode(ViewData["Error"]) %>
</div>
<% } %>
<% if (ViewData["Message"]!=null) { %>
<div class="Message">
<%= Html.Encode(ViewData["Message"]) %>
</div>
<% } %>
</asp:ContentPlaceHolder>
</header>
<main>
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
</main>
<footer>
<hr/>
<%= string.Join("\n",Yavsc.ThanksHelper.Links()) %>
</footer>
</body>
</html>

45
web/README Normal file
View file

@ -0,0 +1,45 @@
Yavsc is a point of sales, implemented in a dot Net Web application
Copyright (C) 2014 Paul Schneider
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You may contact me at <paulschneider@free.fr>
-------
Yavsc ("Mon Auto Entreprise")
Les services :
- Dépannage informatique
- Développement logiciel
- Developpement Web
- Audit de sécurité
- Dématérialisation des documents
- ...
Les livrables :
- Un site web ASP.Net propulsé par Mono et Apache, et une application mobile pour
* demander un devis
* avoir un status des projets des clients
* demander une intervention / saisir un ticket
* avoir un status des ticket du client
Les projets :
- des acteurs / des ressources humaines
- des etapes inter dépendantes, leurs attributs, leurs états
- des dates butoires

9
web/RegistrationMail.txt Normal file
View file

@ -0,0 +1,9 @@
Votre compte <%SiteName%> a été créé, votre nom d'utilisateur
est <%UserName%>.
Pour l'activer, veuillez suivre le lien suivant :
<%UserActivatonUrl%>
Merci d'avoir créé un compte utilisateur.

87
web/Test/TestByteA.cs Normal file
View file

@ -0,0 +1,87 @@
using NUnit.Framework;
using System;
using System.Configuration;
using Npgsql;
namespace Yavsc
{
[TestFixture ()]
public class TestByteA: IDisposable
{
//string cnxName = "yavsc";
string ConnectionString { get {
return "Server=127.0.0.1;Port=5432;Database=mae;User Id=mae;Password=admin;Encoding=Unicode;" ;
// return ConfigurationManager.ConnectionStrings [cnxName].ConnectionString;
} }
[TestFixtureSetUp]
public void Init()
{
// create the table
Console.WriteLine ("cnx:"+ConnectionString);
using (NpgsqlConnection cnx = new NpgsqlConnection (ConnectionString))
{
cnx.Open ();
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText = "drop table testbytea";
try { cmd.ExecuteNonQuery (); }
catch (NpgsqlException) {
}
cmd.CommandText = "create table testbytea( t bytea )";
cmd.ExecuteNonQuery ();
}
}
}
[Test(Description="Test storing a byte array in a Postgresql table field")]
public void TestStoreByteA ()
{
byte []a = new byte[3];
a[0]=1;
a[1]=2;
a[2]=3;
using (NpgsqlConnection cnx = new NpgsqlConnection (ConnectionString)) {
cnx.Open ();
using (NpgsqlCommand cmd = cnx.CreateCommand ())
{
cmd.CommandText = "insert into testbytea (t) values (@tv)";
cmd.Parameters.Add ("@tv", a);
cmd.ExecuteNonQuery ();
}
using (NpgsqlCommand cmd = cnx.CreateCommand ())
{
cmd.CommandText = "select t from testbytea";
cmd.Parameters.Add ("@tv", a);
NpgsqlDataReader rdr = cmd.ExecuteReader ();
if (!rdr.Read ())
throw new Exception ("Read failed");
int i = rdr.GetOrdinal ("t");
byte []rded = (byte[]) rdr.GetValue (i);
if (rded.Length!=a.Length)
throw new Exception("Lengthes don't match");
}
}
}
#region IDisposable implementation
[TestFixtureTearDown]
public void Dispose ()
{
// drop the table
using (NpgsqlConnection cnx = new NpgsqlConnection (ConnectionString)) {
cnx.Open ();
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText = "drop table testbytea";
cmd.ExecuteNonQuery ();
}
}
}
#endregion
}
}

19
web/Tests.cs Normal file
View file

@ -0,0 +1,19 @@
#if TEST
using System;
using NUnit.Framework;
namespace Yavsc
{
[TestFixture()]
public class Tests
{
[Test()]
public void TestCase ()
{
}
}
}
#endif

0
web/TextWriterOutput.log Normal file
View file

View file

@ -0,0 +1,22 @@
using System;
using System.Configuration;
namespace Yavsc
{
public class ThanksConfigurationCollection : ConfigurationElementCollection
{
protected override object GetElementKey (ConfigurationElement element)
{
return ((ThanksConfigurationElement) element).Name;
}
protected override ConfigurationElement CreateNewElement ()
{
return new ThanksConfigurationElement();
}
public ThanksConfigurationElement GetElement (string name)
{
return this.BaseGet(name) as ThanksConfigurationElement;
}
}
}

View file

@ -0,0 +1,48 @@
using System;
using System.Configuration;
namespace Yavsc
{
public class ThanksConfigurationElement : ConfigurationElement
{
[ConfigurationProperty("name", IsKey=true, IsRequired=true)]
public string Name {
get {
return (string) base ["name"];
}
set { base ["name"] = value; }
}
[ConfigurationProperty("url")]
public string Url {
get {
return (string) base ["url"];
}
set { base ["url"] = value; }
}
[ConfigurationProperty("image")]
public string Image {
get {
return (string) base ["image"];
}
set { base ["image"] = value; }
}
/// <summary>
/// Gets or sets the display.
/// </summary>
/// <value>
/// The displaied text when no image is provided and we
/// don't want use the name attribute.
/// </value>
[ConfigurationProperty("display")]
public string Display {
get {
return (string) base ["display"];
}
set { base ["display"] = value; }
}
}
}

View file

@ -0,0 +1,39 @@
using System;
using System.Configuration;
namespace Yavsc
{
public class ThanksConfigurationSection : ConfigurationSection
{
[ConfigurationProperty("to")]
public ThanksConfigurationCollection To {
get {
return (ThanksConfigurationCollection) this["to"];
}
set {
this ["to"] = value;
}
}
[ConfigurationProperty("html_class")]
public string HtmlClass {
get {
return (string)this ["html_class"];
}
set {
this ["html_class"] = value;
}
}
[ConfigurationProperty("title_format")]
public string TitleFormat {
get {
return (string)this ["title_format"];
}
set {
this ["title_format"] = value;
}
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using System.Configuration;
using System.Collections.Generic;
namespace Yavsc
{
public static class ThanksHelper {
public static string[] Links ()
{
List<string> result = new List<string>() ;
ThanksConfigurationSection s = (ThanksConfigurationSection) ConfigurationManager.GetSection ("system.web/thanks");
if (s == null) return result.ToArray();
if (s.To == null) return result.ToArray();
foreach (ThanksConfigurationElement e in s.To) {
string link = "";
if (!string.IsNullOrEmpty(e.Url))
link = string.Format("<a class=\"athanks\" href=\"{0}\">",e.Url);
link += "<div class=\"thanks\">";
string dsp = (string.IsNullOrEmpty(e.Display))?e.Name:e.Display;
if (!string.IsNullOrEmpty(e.Image)) {
string ttl = (string.IsNullOrEmpty(s.TitleFormat))?"Go and see the website ({0})":s.TitleFormat;
ttl = string.Format(ttl,dsp);
link += string.Format(
"<img src=\"{1}\" alt=\"{0}\" title=\"{2}\"/>",
dsp,e.Image,ttl);
}
else link += dsp;
link += "</div>";
if (e.Url!=null)
link += "</a> ";
result.Add (link);
}
return result.ToArray();
}
}
}

View file

@ -0,0 +1,19 @@
<%@ 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>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%= Html.ValidationSummary() %>
<% using(Html.BeginForm("DoAddRole", "Account")) %>
<% { %>
Nom du rôle :
<%= Html.TextBox( "RoleName" ) %>
<%= Html.ValidationMessage("RoleName", "*") %><br/>
<input class="actionlink" type="submit"/>
<% } %>
</asp:Content>

View file

@ -0,0 +1,34 @@
<%@ 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>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div>
<table>
<% foreach (string u in (string[])ViewData["admins"]) { %>
<tr><td>
<%= u %> </td><td><%= Html.ActionLink("Remove","RemoveFromRole",new { username = u, rolename="Admin", returnUrl = Request.Url.PathAndQuery })%>
</td></tr>
<% } %>
</table>
</div>
<div>
<h2>Ajout d'un administrateur
</h2>
<p><%= Html.ValidationSummary() %> </p>
<% using ( Html.BeginForm("Admin", "Account") ) { %>
<%= Html.LabelFor(model => model.UserName) %> :
<%= Html.DropDownListFor(model => model.UserName, (List<SelectListItem>)ViewData["useritems"] ) %>
<%= Html.ValidationMessage("UserName", "*") %>
<input type="submit"/>
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,26 @@
<%@ 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>
<%= Html.TextBox( "UserName" ) %>
<%= Html.ValidationMessage("UserName", "*") %><br/>
<label for="OldPassword">Old password:</label>
<%= Html.Password( "OldPassword" ) %>
<%= Html.ValidationMessage("OldPassword", "*") %><br/>
<label for="NewPassword">New password:</label>
<%= Html.Password( "NewPassword" ) %>
<%= Html.ValidationMessage("NewPassword", "*") %><br/>
<label for="ConfirmPassword">Confirm password:</label>
<%= Html.Password( "ConfirmPassword" ) %>
<%= Html.ValidationMessage("ConfirmPassword", "*") %>
<input type="submit"/>
<% } %>
</asp:Content>

View file

@ -0,0 +1,8 @@
<%@ 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>
<div><%= Html.ActionLink("ChangePassword","ChangePassword")%></div>
</asp:Content>

View file

@ -0,0 +1,8 @@
<%@ 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">
</asp:Content>

View file

@ -0,0 +1,28 @@
<%@ 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")) %>
<% { %>
<%= Html.LabelFor(model => model.UserName) %>
<%= Html.TextBox( "UserName" ) %>
<%= Html.ValidationMessage("UserName", "*") %><br/>
<%= Html.LabelFor(model => model.Password) %>
<%= Html.Password( "Password" ) %>
<%= Html.ValidationMessage("Password", "*") %><br/>
<label for="RememberMe">Se souvenir du mot de passe:</label>
<%= Html.CheckBox("RememberMe") %>
<%= Html.ValidationMessage("RememberMe", "") %><br/>
<%= Html.Hidden("returnUrl",ViewData["returnUrl"]) %>
<!-- Html.AntiForgeryToken() -->
<input type="submit"/>
<% } %>
</div>
<div>
<%= Html.ActionLink("S'enregistrer","Register",new {returnUrl=ViewData["returnUrl"]}) %></div>
</asp:Content>

View file

@ -0,0 +1,47 @@
<%@ 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>
<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>
</asp:Content>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<%= Html.ValidationSummary() %>
<% using(Html.BeginForm("UpdateProfile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %>
<% { %>
<table class="layout">
<tr><td align="right">
<%= Html.LabelFor(model => model.Address) %></td><td>
<%= Html.TextBox("Address") %>
<%= Html.ValidationMessage("Address", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.CityAndState) %></td><td>
<%= Html.TextBox("CityAndState") %>
<%= Html.ValidationMessage("CityAndState", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.Country) %></td><td>
<%= Html.TextBox("Country") %>
<%= Html.ValidationMessage("Country", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.WebSite) %></td><td>
<%= Html.TextBox("WebSite") %>
<%= Html.ValidationMessage("WebSite", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.BlogVisible) %></td><td>
<%= Html.CheckBox("BlogVisible") %>
<%= Html.ValidationMessage("BlogVisible", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.BlogTitle) %></td><td>
<%= Html.TextBox("BlogTitle") %>
<%= Html.ValidationMessage("BlogTitle", "*") %></td></tr>
<tr><td align="right">
Avatar </td><td> <img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["UserName"]%>" alt=""/>
<input type="file" id="AvatarFile" name="AvatarFile"/>
<%= Html.ValidationMessage("AvatarFile", "*") %></td></tr>
</table>
<input type="submit"/>
<% } %>
</asp:Content>

View file

@ -0,0 +1,45 @@
<%@ Page Title="Register" Language="C#" Inherits="Yavsc.RegisterPage" MasterPageFile="~/Models/App.master" %>
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
</asp:Content>
<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() %>
<% using(Html.BeginForm("Register", "Account")) %>
<% { %>
<table class="layout">
<tr><td align="right">
<%= Html.LabelFor(model => model.UserName) %>
</td><td>
<%= Html.TextBox( "UserName" ) %>
<%= Html.ValidationMessage("UserName", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.Password) %>
</td><td>
<%= Html.Password( "Password" ) %>
<%= Html.ValidationMessage("Password", "*") %>
</td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.ConfirmPassword) %>
</td><td>
<%= Html.Password( "ConfirmPassword" ) %>
<%= Html.ValidationMessage("ConfirmPassword", "*") %>
</td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.Email) %>
</td><td>
<%= Html.TextBox( "Email" ) %>
<%= Html.ValidationMessage("Email", "*") %>
</td></tr>
</table>
<br/>
<%= Html.Hidden("returnUrl",ViewData["returnUrl"]) %>
<input type="submit"/>
<% } %>
</asp:Content>

View file

@ -0,0 +1,17 @@
<%@ 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">
<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/>
&lt;<%= Html.Encode(ViewData["email"]) %>&gt;.<br/>
Vous devriez le recevoir rapidement.<br/>
Pour valider votre compte, suivez le lien indiqué dans cet e-mail.
</p>
<a class="actionlink" href="<%=ViewData["ReturnUrl"]%>">Retour</a>
</asp:Content>

View file

@ -0,0 +1,22 @@
<%@ 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() %>
<% using ( Html.BeginForm("RemoveRole") ) { %>
Supprimer le rôle
<%= Html.Encode( ViewData["roletoremove"] ) %> ?
<br/>
<input type="hidden" name="rolename" value="<%=ViewData["roletoremove"]%>"/>
<input class="actionlink" type="submit" name="submitbutton" value="Supprimer"/>
<input class="actionlink" type="submit" name="submitbutton" value="Annuler" />
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,22 @@
<%@ 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 utilisateur</h2>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div>
<%= Html.ValidationSummary() %>
<% using ( Html.BeginForm("RemoveUser","Account") ) { %>
Supprimer l'utilisateur
<%= Html.Encode( ViewData["usertoremove"] ) %> ?
<br/>
<input type="hidden" name="username" value="<%=ViewData["usertoremove"]%>"/>
<input class="actionlink" type="submit" name="submitbutton" value="Supprimer"/>
<input class="actionlink" type="submit" name="submitbutton" value="Annuler" />
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,23 @@
<%@ 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>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
Roles:
<ul>
<%foreach (string rolename in (string[]) Model){ %>
<li><%=rolename%> <% if (Roles.IsUserInRole("Admin")) { %>
<%= Html.ActionLink("Supprimer","RemoveRole", new { rolename = rolename }, new { @class="actionlink" } ) %>
<% } %></li>
<% } %>
</ul>
<% if (Roles.IsUserInRole("Admin")) { %>
<%= Html.ActionLink("Ajouter un rôle","AddRole", null, new { @class="actionlink" } ) %>
<% } %>
</asp:Content>

View file

@ -0,0 +1,22 @@
<%@ 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>
<%foreach (MembershipUser user in Model){ %>
<li><%=user.UserName%> <%=user.Email%> <%=(!user.IsApproved)?"(Not Approuved)":""%> <%=user.IsOnline?"Online":"Offline"%>
<% if (Roles.IsUserInRole("Admin")) { %>
<%= Html.ActionLink("Supprimer","RemoveUserQuery", new { username = user.UserName }, new { @class="actionlink" } ) %>
<% } %>
</li>
<% }%>
</ul>
</asp:Content>

View file

@ -0,0 +1,8 @@
<%@ 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>

View file

@ -0,0 +1,13 @@
<%@ 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>
<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>

View file

@ -0,0 +1,12 @@
<%@ 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/>
<%=Html.ActionLink("Restaurations", "Restore", "BackOffice")%><br/>
</asp:Content>

View file

@ -0,0 +1,27 @@
<%@ 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")) { %>
<%= Html.LabelFor(model => model.Host) %>:
<%= Html.TextBox( "Host" ) %>
<%= Html.ValidationMessage("Host", "*") %><br/>
<%= Html.LabelFor(model => model.Port) %>:
<%= Html.TextBox( "Port" ) %>
<%= Html.ValidationMessage("Port", "*") %><br/>
<%= Html.LabelFor(model => model.Dbname) %>:
<%= Html.TextBox( "Dbname" ) %>
<%= Html.ValidationMessage("Dbname", "*") %><br/>
<%= Html.LabelFor(model => model.Dbuser) %>:
<%= Html.TextBox( "Dbuser" ) %>
<%= Html.ValidationMessage("Dbuser", "*") %><br/>
<%= Html.LabelFor(model => model.Password) %>:
<%= Html.Password( "Password" ) %>
<%= Html.ValidationMessage("Password", "*") %><br/>
<input type="submit"/>
<% } %>
</asp:Content>

View file

@ -0,0 +1,8 @@
<%@ 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>

View file

@ -0,0 +1,43 @@
<%@ 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")) { %>
<% string [] bckdirs = Model.GetBackupDirs(); %>
<select name="backupName">
<% foreach (string s in bckdirs)
{
%>
<option value="<%=s%>"><%=s%></option>
<%
}
%>
</select>
<label for="dataOnly">Data only :</label>
<%= Html.CheckBox("dataOnly")%>
<%= Html.LabelFor(model => model.Host) %>:
<%= Html.TextBox( "Host" ) %>
<%= Html.ValidationMessage("Host", "*") %><br/>
<%= Html.LabelFor(model => model.Port) %>:
<%= Html.TextBox( "Port" ) %>
<%= Html.ValidationMessage("Port", "*") %><br/>
<%= Html.LabelFor(model => model.Dbname) %>:
<%= Html.TextBox( "Dbname" ) %>
<%= Html.ValidationMessage("Dbname", "*") %><br/>
<%= Html.LabelFor(model => model.Dbuser) %>:
<%= Html.TextBox( "Dbuser" ) %>
<%= Html.ValidationMessage("Dbuser", "*") %><br/>
<%= Html.LabelFor(model => model.Password) %>:
<%= Html.Password( "Password" ) %>
<%= Html.ValidationMessage("Password", "*") %><br/>
<input type="submit"/>
<% } %>
</asp:Content>

View file

@ -0,0 +1,12 @@
<%@ 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>
<div><h2>Message </h2> <%= Html.Encode(Model.Message) %></div>
<div><h2>Exit Code</h2> <%= Html.Encode(Model.ExitCode) %></div>
</asp:Content>

67
web/Views/Blogs/Edit.aspx Normal file
View file

@ -0,0 +1,67 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEditEntryModel>" MasterPageFile="~/Models/App.master"%>
<asp:Content ContentPlaceHolderID="head" ID="head" runat="server">
<title><%= Html.Encode(ViewData["BlogTitle"]) %> edition
- <%=Html.Encode(YavscHelpers.SiteName) %>
</title>
</asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h1 class="blogtitle">
<a href="/Blog/<%=ViewData["UserName"]%>">
<img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["UserName"]%>" alt="from <%=ViewData["UserName"]%>"/>
<%= Html.Encode(ViewData["BlogTitle"]) %> </a> -
<%= Html.Encode(Model.Title) %> -
&Eacute;dition </h1>
<div class="message">
<%= Html.Encode(ViewData["Message"]) %>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% if (Model != null ) if (Model.Content != null ) {
BBCodeHelper.Init (); %>
<%= Html.ActionLink(Model.Title,"UserPost",new{user=Model.UserName,title=Model.Title}) %>
<div class="blogpost">
<%= BBCodeHelper.Parser.ToHtml(Model.Content) %>
</div>
<% } %>
Usage BBcodes :
<div style="font-family:monospace;">
<%
foreach (string usage in BBCodeHelper.BBTagsUsage) { %>
<div style="display:inline"><%= usage %></div>
<% } %>
</div>
<%= Html.ValidationSummary("Edition du billet") %>
<% using(Html.BeginForm("ValidateEdit", "Blogs")) { %>
<%= Html.LabelFor(model => model.Title) %>:<br/>
<%= Html.TextBox( "Title" ) %>
<%= Html.ValidationMessage("Title", "*") %>
<br/>
<%= Html.LabelFor(model => model.Content) %>:<br/>
<%= Html.TextArea( "Content" , new { @class="editblog", @rows="15" }) %>
<%= Html.ValidationMessage("Content", "*") %>
<br/>
<%= Html.CheckBox( "Visible" ) %>
<%= Html.LabelFor(model => model.Visible) %>
<%= Html.ValidationMessage("Visible", "*") %>
<br/>
<%= Html.CheckBox( "Preview" ) %>
<%= Html.LabelFor(model => model.Preview) %>
<%= Html.ValidationMessage("Preview", "*") %>
<%= Html.Hidden("Id") %>
<%= Html.Hidden("UserName") %>
<br/>
<input type="submit"/>
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,14 @@
<%@ 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">
<div>
<%= Html.Encode(ViewData["Message"]) %></div>
Your UID :
<%= Html.Encode(ViewData ["UID"]) %> </br>
<a class="actionlink" href="<%=ViewData["returnUrl"]%>">Retour</a>
</asp:Content>

View file

@ -0,0 +1,34 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Npgsql.Web.Blog.DataModel.BlogEntryCollection>" MasterPageFile="~/Models/App.master"%>
<%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %>
<asp:Content ContentPlaceHolderID="head" ID="head" runat="server">
<%= "<title>Les dernières parutions - " + Html.Encode(YavscHelpers.SiteName) + "</title>" %>
</asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h2>Les dernières parutions</h2>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% foreach (Npgsql.Web.Blog.DataModel.BlogEntry e in this.Model) { %>
<div class="blogpost">
<h3 class="blogtitle">
<%= Html.ActionLink(e.Title,"UserPost", new { user=e.UserName, title = e.Title }) %>
</h3>
<div class="metablog">(<%=Html.Encode(e.UserName)%> <%=e.Modified.ToString("yyyy/MM/dd") %>)</div>
<% if (Membership.GetUser()!=null)
if (Membership.GetUser().UserName==e.UserName)
{ %>
<%= Html.ActionLink("Editer","Edit", new { user = e.UserName, title = e.Title }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","Remove", new { user = e.UserName, title = e.Title }, new { @class="actionlink" } ) %>
<% } %>
</div>
<% } %>
<form runat="server" id="form1" method="GET">
<% rp1.ResultCount = (int) ViewData["RecordCount"];
rp1.CurrentPage = (int) ViewData["PageIndex"]; %>
<yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server" ></yavsc:ResultPages>
</form>
</asp:Content>

67
web/Views/Blogs/Post.aspx Normal file
View file

@ -0,0 +1,67 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEditEntryModel>" MasterPageFile="~/Models/App.master"%>
<asp:Content ContentPlaceHolderID="head" ID="head" runat="server">
<title><%= Html.Encode(ViewData["BlogTitle"]) %> - Nouveau billet
- <%=Html.Encode(YavscHelpers.SiteName) %>
</title>
</asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h1 class="blogtitle">
<a href="/Blog/<%=ViewData["UserName"]%>">
<img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["UserName"]%>" alt="from <%=ViewData["UserName"]%>"/>
<%= Html.Encode(ViewData["BlogTitle"]) %> </a> -
Nouveau billet -
<a href="/"><%= Html.Encode(YavscHelpers.SiteName) %></a> </h1>
<div class="message">
<%= Html.Encode(ViewData["Message"]) %>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div class="message">
<%= Html.Encode(ViewData["Message"]) %>
</div>
<% if (Model != null ) if (Model.Content != null ) { %>
<div class="blogpost">
<%= BBCodeHelper.Parser.ToHtml(Model.Content) %>
</div>
<% } %>
<div class="editpost">
<%= Html.ValidationSummary() %>
<% using(Html.BeginForm("ValidatePost", "Blogs")) %>
<% { %>
<%= Html.LabelFor(model => model.Title) %>:<br/>
<%= Html.TextBox( "Title" ) %>
<%= Html.ValidationMessage("Title", "*") %>
<br/>
<div>
Usage BBcodes :
<ul>
<%
foreach (string usage in BBCodeHelper.BBTagsUsage) { %>
<li><%= usage %></li>
<% } %>
</ul>
</div>
<%= Html.LabelFor(model => model.Content) %>:<br/>
<%= Html.TextArea( "Content", new { @class="editblog", @rows="15" }) %>
<%= Html.ValidationMessage("Content", "*") %>
<br/>
<%= Html.CheckBox( "Visible" ) %>
<%= Html.LabelFor(model => model.Visible) %>
<%= Html.ValidationMessage("Visible", "*") %>
<br/>
<%= Html.CheckBox( "Preview" ) %> <%= Html.LabelFor(model => model.Preview) %>
<%= Html.ValidationMessage("Preview", "*") %>
<br/>
<%= Html.Hidden("Id") %>
<input type="submit"/>
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,17 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Npgsql.Web.Blog.DataModel.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é @ "<%= Html.Encode(ViewData["PostTitle"]) %>"
<% if (ViewData["UserName"]!=null) { %>
<br/>
<%= Html.ActionLink("Poster?","Post/", new { user=ViewData["UserName"], title = ViewData["PostTitle"]}, new { @class="actionlink" }) %>
<% } %>
</asp:Content>

View file

@ -0,0 +1,47 @@
<%@ Page Title="Billet" Language="C#" Inherits="System.Web.Mvc.ViewPage<Npgsql.Web.Blog.DataModel.BlogEntry>" MasterPageFile="~/Models/App.master"%>
<asp:Content ContentPlaceHolderID="titleContent" ID="titleContent" runat="server"><%=Html.Encode(Model.Title)%> - <%=Html.Encode(ViewData["BlogTitle"])%></asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h1 class="blogtitle"><%= Html.ActionLink(Model.Title,"UserPost",new{user=Model.UserName,title=Model.Title}) %> -
<a href="/Blog/<%=Model.UserName%>"><img class="avatar" src="/Blogs/Avatar?user=<%=Model.UserName%>" alt=""/> <%=ViewData["BlogTitle"]%></a> </h1>
<div class="metablog">(Id:<a href="/Blogs/UserPost/<%=Model.Id%>"><i><%=Model.Id%></i></a>, <%= Model.Posted.ToString("yyyy/MM/dd") %>
- <%= Model.Modified.ToString("yyyy/MM/dd") %> <%= Model.Visible? "":", Invisible!" %>)
<% if (Membership.GetUser()!=null)
if (Membership.GetUser().UserName==Model.UserName)
{ %>
<%= Html.ActionLink("Editer","Edit", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","Remove", new { user=Model.UserName, title = Model.Title }, new { @class="actionlink" } ) %>
<% } %>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div>
<div class="blogpost">
<% BBCodeHelper.Init(); %>
<%= BBCodeHelper.Parser.ToHtml(Model.Content) %>
</div>
<%
string username = "";
if (Membership.GetUser()!=null)
username = Membership.GetUser().UserName; %>
<% foreach (var c in (Comment[])ViewData["Comments"]) { %>
<div class="comment" style="min-height:32px;"> <img style="clear:left;float:left;max-width:32px;max-height:32px;" src="/Blogs/Avatar/<%=c.From%>" alt="<%=c.From%>"/>
<%= BBCodeHelper.Parser.ToHtml(c.CommentText) %>
<% if ( username == Model.UserName || c.From == username ) { %>
<%= Html.ActionLink("Supprimer","RemoveComment", new { cmtid = c.Id } )%>
<% } %>
</div>
<% } %>
<div class="postcomment">
<% using (Html.BeginForm("Comment","Blogs")) { %>
<%=Html.Hidden("UserName")%>
<%=Html.Hidden("Title")%>
<%=Html.TextArea("CommentText","")%>
<%=Html.Hidden("PostId",Model.Id)%>
<input type="submit" value="Poster un commentaire"/>
<% } %>
</div>
</div>
</asp:Content>

View file

@ -0,0 +1,42 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Npgsql.Web.Blog.DataModel.BlogEntryCollection>" MasterPageFile="~/Models/App.master"%>
<%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %>
<asp:Content ContentPlaceHolderID="titleContent" ID="titleContent" runat="server"><%=Html.Encode(ViewData["BlogTitle"])%></asp:Content>
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
<h1><a href="/Blog/<%=ViewData["BlogUser"]%>">
<img class="avatar" src="/Blogs/Avatar?user=<%=ViewData["BlogUser"]%>" alt=""/>
<%=ViewData["BlogTitle"]%></a></h1>
<div class="message"><%= Html.Encode(ViewData["Message"])%></div>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%
foreach (BlogEntry e in this.Model) { %>
<div <% if (!e.Visible) { %> style="background-color:#022;" <% } %>>
<h2 class="blogtitle" ><%= Html.ActionLink(e.Title,"UserPost", new { user=e.UserName, title = e.Title }) %></h2>
<div class="metablog">(<%= e.Posted.ToString("yyyy/MM/dd") %>
- <%= e.Modified.ToString("yyyy/MM/dd") %> <%= e.Visible? "":", Invisible!" %>)
</div>
<% if (Membership.GetUser()!=null)
if (Membership.GetUser().UserName==e.UserName)
{ %>
<%= Html.ActionLink("Editer","Edit", new { user = e.UserName, title = e.Title }, new { @class="actionlink" }) %>
<%= Html.ActionLink("Supprimer","Remove", new { user = e.UserName, title = e.Title }, new { @class="actionlink" } ) %>
<% } %>
</div>
<% } %>
<form runat="server" id="form1" method="GET">
<%
rp1.ResultCount = (int) ViewData["RecordCount"];
rp1.CurrentPage = (int) ViewData["PageIndex"];
user.Value = (string) ViewData["BlogUser"];
%>
<yavsc:ResultPages id="rp1" Action = "?pageIndex={0}" runat="server"></yavsc:ResultPages>
<asp:HiddenField id="user" runat="server"></asp:HiddenField>
</form>
</asp:Content>

View file

@ -0,0 +1,20 @@
<%@ Page 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" })) { %>
<div>
<input type="file" ID="AFile" multiple="multiple" runat="server"/>
<%= Html.ValidationMessage("AFile") %>
<br />
<input type="submit" name="Envoyer" />
<br />
<asp:Label ID="Label1"
runat="server"/>
</div>
<% } %>
</asp:Content>

View file

@ -0,0 +1,7 @@
<%@ 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>

View file

@ -0,0 +1,15 @@
<%@ 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 :
<%= Model.CreationTime %><br/>
Dérnière modification :
<%= Model.LastWriteTime %><br/>
Dernier accès :
<%= Model.LastAccessTime %><br/>
Lien permanent : <a href="/<%= ViewData["Content"] %>">/<%= ViewData["Content"] %></a>
</asp:Content>

View file

@ -0,0 +1,9 @@
<%@ 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") %>
</asp:Content>

View file

@ -0,0 +1,16 @@
<%@ 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>
<% foreach (System.IO.FileInfo fi in Model) { %>
<li> <%= Html.ActionLink(fi.Name,"Details",new {id = fi.Name}) %> </li>
<% } %>
</ul>
<%= Html.ActionLink("Ajouter des fichiers","Create") %>
</asp:Content>

View file

@ -0,0 +1,32 @@
<%@ 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%>"/>
<% } %>
<%=Html.Encode(Model.Name)%></h1>
<p><i><%=Html.Encode(Model.Slogan)%></i></p>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% foreach (ProductCategory pc in Model.Categories ) { %>
<div>
<h2><%= Html.ActionLink( pc.Name, "ProductCategory", new { id = Model.Name, pc = pc.Reference }, new { @class="actionlink" } ) %></h2>
</div>
<% foreach (Product p in pc.Products ) { %>
<div>
<h3><%= Html.ActionLink( p.Name, "Product", new { id = Model.Name, pc = pc.Reference , pref = p.Reference }, new { @class="actionlink" } ) %></h3>
<p>
<%= p.Description %>
<% if (p.Images !=null)
foreach (ProductImage i in p.Images ) { %>
<img src="<%=i.Src%>" alt="<%=i.Alt%>"/>
<% } %>
</p>
</div>
<% } %>
<% } %>
</asp:Content>

View file

@ -0,0 +1,32 @@
<%@ 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>
<p><i><%= Html.Encode( b.Slogan ) %></i></p>
<% foreach (ProductCategory pc in b.Categories ) { %>
<div>
<h2><%= Html.ActionLink( pc.Name, "ProductCategory", new { id = b.Name, pc = pc.Reference }, new { @class="actionlink" } ) %></h2>
</div>
<% foreach (Product p in pc.Products ) { %>
<div>
<h3><%= Html.ActionLink( p.Name, "Product", new { id = b.Name, pc = pc.Reference , pref = p.Reference }, new { @class="actionlink" } ) %></h3>
<p>
<%= p.Description %>
<% if (p.Images !=null)
foreach (ProductImage i in p.Images ) { %>
<img src="<%=i.Src%>" alt="<%=i.Alt%>"/>
<% } %>
</p>
</div>
<% } %>
<% } %>
</div><% } %>
</asp:Content>

View file

@ -0,0 +1,7 @@
<%@ 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>

View file

@ -0,0 +1,30 @@
<%@ 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>
<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>
<% if (Model.Images!=null) foreach (ProductImage i in Model.Images) { %>
<img src="<%=i.Src%>" alt="<%=i.Alt%>"/>
<% } %>
<% if (Model.UnitaryPrice !=null) { %>
Prix unitaire : <%= Html.Encode(Model.UnitaryPrice.Quantity.ToString())%>
<%= Html.Encode(Model.UnitaryPrice.Unit.Name)%>
<% } else { %> Gratuit! <% } %>
</div>
<div class="booking">
<% if (Model.CommandForm!=null) { %>
Défaut de formulaire de commande!!!
<% } else { Response.Write( Html.CommandForm(Model,"Ajouter au panier")); } %>
<% if (Model.CommandValidityDates!=null) { %>
Offre valable du <%= Model.CommandValidityDates.StartDate.ToString("dd/MM/yyyy") %> au
<%= Model.CommandValidityDates.EndDate.ToString("dd/MM/yyyy") %>.
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,23 @@
<%@ 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 ) { %>
<h3><%= Html.ActionLink( p.Name, "Product", new { id = ViewData["BrandName"], pc = Model.Reference , pref = p.Reference }, new { @class="actionlink" } ) %></h3>
<p>
<%= p.Description %>
<% if (p.Images !=null)
foreach (ProductImage i in p.Images ) { %>
<img src="<%=i.Src%>" alt="<%=i.Alt%>"/>
<% } %>
</p>
<% } %>
</asp:Content>

View file

@ -0,0 +1,7 @@
<%@ 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>

View file

@ -0,0 +1,31 @@
<%@ 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>
<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>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div class="service">
<p><%= Html.Encode(Model.Description) %></p>
<% if (Model.Images!=null) foreach (ProductImage i in Model.Images) { %>
<img src="<%=i.Src%>" alt="<%=i.Alt%>"/>
<% } %>
<% if (Model.HourPrice !=null) { %>
Prix horaire de la prestation :
<%= Html.Encode(Model.HourPrice.Quantity.ToString())%>
<%= Html.Encode(Model.HourPrice.Unit.Name)%>
<% } %>
</div>
<div class="booking">
<%= Html.CommandForm(Model,"Ajouter au panier") %>
<% if (Model.CommandValidityDates!=null) { %>
Offre valable du <%= Model.CommandValidityDates.StartDate.ToString("dd/MM/yyyy") %> au
<%= Model.CommandValidityDates.EndDate.ToString("dd/MM/yyyy") %>.
<% } %>
</div>
</asp:Content>

View file

@ -0,0 +1,7 @@
<%@ 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>

View file

@ -0,0 +1,8 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%>
<asp:Content ContentPlaceHolderID="titleContent" ID="titleContent" runat="server">Indexe</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div>
<%= Html.ActionLink("blogs","Index","Blogs") %>
</div>
</asp:Content>

View file

@ -0,0 +1,3 @@
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="" %>

12
web/Views/Home/NView.aspx Normal file
View file

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

View file

@ -0,0 +1,17 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<p>
<% var ts = ((string[,])ViewData["Thanks"]);
if (ts != null) { %>
<hr/><i> Powered by</i><br/>
<% for (int i = 0; i <= ts.GetUpperBound(0); i++)
{
%>
<%= "<a href=\""+Html.Encode(ts[i,1])+"\" class=\"socle\">"
+ ts[i,0]+"</a>"
%>
<%
}}
%>
</p>

28
web/Views/RegisterPage.cs Normal file
View file

@ -0,0 +1,28 @@
using System;
using System.Web.UI.WebControls;
using yavscModel.RolesAndMembers;
namespace Yavsc
{
public class RegisterPage : System.Web.Mvc.ViewPage<RegisterViewModel>
{
public RegisterPage ()
{
}
public CreateUserWizard Createuserwizard1;
public void OnRegisterSendMail(object sender, MailMessageEventArgs e)
{
// Set MailMessage fields.
e.Message.IsBodyHtml = false;
e.Message.Subject = "New user on Web site.";
// Replace placeholder text in message body with information
// provided by the user.
e.Message.Body = e.Message.Body.Replace("<%PasswordQuestion%>", Createuserwizard1.Question);
e.Message.Body = e.Message.Body.Replace("<%PasswordAnswer%>", Createuserwizard1.Answer);
}
}
}

41
web/Views/Web.config Normal file
View file

@ -0,0 +1,41 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages validateRequest="true"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<controls>
<add assembly="System.Web.Mvc" namespace="System.Web.Mvc" tagPrefix="mvc" />
<add tagPrefix="yavsc" namespace="Yavsc.WebControls" assembly="Yavsc.WebControls" />
</controls>
<namespaces>
<add namespace="SalesCatalog.Model" />
<add namespace="yavscModel" />
<add namespace="Yavsc.Helpers" />
<add namespace="Yavsc.Admin" />
<add namespace="Yavsc.CatExts" />
<add namespace="yavscModel.RolesAndMembers" />
<add namespace="yavscModel.Admin" />
<add namespace="Npgsql.Web.Blog.DataModel" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockViewHandler" />
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>

View file

@ -0,0 +1,11 @@
<%@ 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>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div>
<%= Html.ActionLink("blogs","Index","WorkFlow") %>
</div>
</asp:Content>

View file

@ -0,0 +1,22 @@
<%@ 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") %>
<% using ( Html.BeginForm("NewProject", "WorkFlow") ) { %>
<%= Html.LabelFor(model => model.Name) %> :
<%= Html.TextBox( "Name" ) %>
<%= Html.ValidationMessage("Name", "*") %><br/>
<%= Html.LabelFor(model => model.Manager) %> :
<%= Html.TextBox( "Manager" ) %>
<%= Html.ValidationMessage("Manager", "*") %><br/>
<%= Html.LabelFor(model => model.Description) %> :
<%= Html.TextBox( "Description" ) %>
<%= Html.ValidationMessage("Description", "*") %><br/>
<input type="submit"/>
<% } %>
</div>
</asp:Content>

215
web/Web.config Normal file
View file

@ -0,0 +1,215 @@
<?xml version="1.0"?>
<!--
Web.config file for Yavsc (Mon auto-entreprise).
The settings that can be used in this file are documented at
http://www.mono-project.com/Config_system.web and
http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
<sectionGroup name="system.web">
<section name="blog" type="Npgsql.Web.Blog.Configuration.BlogProvidersConfigurationSection, NpgsqlBlogProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="catalog" type="SalesCatalog.Configuration.CatalogProvidersConfigurationSection, SalesCatalog" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
</sectionGroup>
</configSections>
<!-- <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="3.5.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime> -->
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation defaultLanguage="C#" debug="true">
<assemblies>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="Mono.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<add assembly="Npgsql, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="nunit.framework, Version=2.6.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=c7439020c8fedf87" />
<add assembly="System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</assemblies>
</compilation>
<!-- samarcheupa
<customErrors mode="RemoteOnly" defaultRedirect="~/errors/GeneralError.aspx">
<error statusCode="404" redirect="~/errors/PageNotFound.aspx" />
</customErrors> -->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="Yavsc.Helpers" />
</namespaces>
</pages>
<authorization>
<allow users="*" />
</authorization>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<httpRuntime maxRequestLength="52428800" />
<trace enabled="false" localOnly="true" pageOutput="false" requestLimit="10" traceMode="SortByTime" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto" />
<membership defaultProvider="NpgsqlMembershipProvider" userIsOnlineTimeWindow="1">
<providers>
<clear />
<add name="NpgsqlMembershipProvider" type="Npgsql.Web.NpgsqlMembershipProvider, NpgsqlMRPProviders" connectionStringName="yavsc" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" autogenerateschema="false" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="NpgsqlRoleProvider">
<providers>
<clear />
<add name="NpgsqlRoleProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders" autogenerateschema="false" />
</providers>
</roleManager>
<profile defaultProvider="NpgsqlProfileProvider">
<providers>
<clear />
<add name="NpgsqlProfileProvider" type="Npgsql.Web.NpgsqlProfileProvider, NpgsqlMRPProviders" connectionStringName="yavsc" applicationName="/" description="ProfileProvider for yavsc" />
</providers>
<properties>
<add name="BlogVisible" type="System.Boolean" />
<add name="Address" />
<add name="BlogTitle" />
<add name="CityAndState" />
<add name="ZipCode" />
<add name="WebSite" />
<add name="Country" />
</properties>
</profile>
<blog defaultProvider="NpgsqlBlogProvider">
<providers>
<add name="NpgsqlBlogProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.Blog.NpgsqlBlogProvider, NpgsqlBlogProvider" />
</providers>
</blog>
<thanks html_class="thanks" title_format="Voir le site ({0})">
<to>
<add name="Mono" url="http://www.mono-project.com/Main_Page" image="/images/Mono-powered.png" />
<add name="Apache&nbsp;Fondation" url="http://httpd.apache.org/" image="/images/apache_pbw.png" />
<add name="Debian" url="http://www.debian.org" image="/images/debian-logo.png" />
<add name="Codekicker.BBCode" url="http://bbcode.codeplex.com/" />
<add name="Postgresql" url="http://www.postgresql.org" image="/images/pgsql.png" />
</to>
</thanks>
<machineKey validationKey="13CA2E37A5A99AD8CE4A6B895BAF0ED3A022AA584B8D922256BA072189CEB085EEB4E573CA833D9B34FBF68687F6A6B3E008FB4EB67585A4D90551B9D36D42A1" decryptionKey="DA89CC83F6FB2EB12D5929DABC89299AC3928E0751705D33D02DB4162ED56536" validation="SHA1" decryption="AES" />
<!--- <sessionState cookieless="true"
regenerateExpiredSessionId="true" timeout="120"/> -->
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v4.0" />
<providerOption name="WarnAsError" value="false" />
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v4.0" />
<providerOption name="OptionInfer" value="true" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<!-- <system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="20000" />
</webServices>
</scripting>
</system.web.extensions> -->
<system.data>
<DbProviderFactories>
<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql" />
</DbProviderFactories>
</system.data>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<remove name="Default" />
<add name="Default" type="System.Diagnostics.TextWriterTraceListener" initializeData="TextWriterOutput.log" />
</listeners>
</trace>
</system.diagnostics>
<catalog defaultProvider="XmlCatalogProvider">
<providers>
<add name="XmlCatalogProvider" connection="/srv/www/yavsc/Catalog.xml" applicationName="/" type="SalesCatalog.XmlImplementation.XmlCatalogProvider, SalesCatalog" />
</providers>
</catalog>
<system.net>
<mailSettings>
<smtp deliveryMethod="network" from="paulschneider@free.fr">
<network host="smtp.free.fr" port="25" defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="30" name=".ASPXFORM$" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="Index.aspx" enableCrossAppRedirects="false" />
</authentication>
<connectionStrings>
<add name="yavsc" connectionString="Server=127.0.0.1;Port=5432;Database=yavsc;User Id=yavsc;Password=admin;Encoding=Unicode;" providerName="Npgsql" />
</connectionStrings>
<appSettings>
<add key="WorkflowContentProviderClass" value="yavsc.NpgsqlContentProvider" />
<add key="SmtpServer" value="smtp.free.fr" />
<add key="AdminEMail" value="paulschneider@free.fr" />
<add key="OwnerEMail" value="paul@127.0.0.1" />
<add key="Name" value="O" />
<add key="DefaultAvatar" value="/images/noavatar.png;image/png" />
<add key="RegistrationMessage" value="/RegistrationMail.txt" />
<add key="YavscWebApiUrl" value="http://localhost:8081" />
</appSettings>
</configuration>

260
web/Web.csproj Normal file
View file

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{77044C92-D2F1-45BD-80DD-AA25B311B027}</ProjectGuid>
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{603C0E0B-DB56-11DC-BE95-000D561079B0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Yavsc</RootNamespace>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG;TEST</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AspNet>
<AspNet DisableCodeBehindGeneration="True" />
</AspNet>
<AssemblyName>Yavsc</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AssemblyName>Yavsc</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MVC2|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG,TEST,WEBAPI</DefineConstants>
<WarningLevel>4</WarningLevel>
<AssemblyName>maeweb</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.IdentityModel" />
<Reference Include="Mono.Security" />
<Reference Include="Npgsql" />
<Reference Include="System.Data" />
<Reference Include="System.Security" />
<Reference Include="nunit.framework, Version=2.6.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
<Private>False</Private>
</Reference>
<Reference Include="CodeKicker.BBCode">
<HintPath>lib\CodeKicker.BBCode.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>False</Private>
</Reference>
<Reference Include="Mono.Posix" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.ServiceModel.Routing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=c7439020c8fedf87">
<Private>False</Private>
<Package>monodevelop</Package>
</Reference>
<Reference Include="System.Web.Http.WebHost">
<HintPath>..\..\..\..\..\usr\lib\mono\4.5\System.Web.Http.WebHost.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>False</Private>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
<Folder Include="Scripts\" />
<Folder Include="Views\Account\" />
<Folder Include="Resources\" />
<Folder Include="images\" />
<Folder Include="Thanks\" />
<Folder Include="Views\Blogs\" />
<Folder Include="Helpers\" />
<Folder Include="Views\FrontOffice\" />
<Folder Include="avatars\" />
<Folder Include="Admin\" />
<Folder Include="Views\BackOffice\" />
<Folder Include="backup\" />
<Folder Include="errors\" />
<Folder Include="Views\FileSystem\" />
<Folder Include="CatExts\" />
<Folder Include="Views\WorkFlow\" />
<Folder Include="Basket\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Thanks\ThanksConfigurationSection.cs" />
<Compile Include="Thanks\ThanksConfigurationCollection.cs" />
<Compile Include="Thanks\ThanksConfigurationElement.cs" />
<Compile Include="Thanks\ThanksHelper.cs" />
<Compile Include="Controllers\BlogsController.cs" />
<Compile Include="Views\RegisterPage.cs" />
<Compile Include="Tests.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Helpers\BBCodeHelper.cs" />
<Compile Include="Test\TestByteA.cs" />
<Compile Include="Controllers\FrontOfficeController.cs" />
<Compile Include="Controllers\BackOfficeController.cs" />
<Compile Include="Admin\Export.cs" />
<Compile Include="Admin\DataManager.cs" />
<Compile Include="Admin\TaskOutput.cs" />
<Compile Include="Controllers\T.cs" />
<Compile Include="Controllers\FileSystemController.cs" />
<Compile Include="CatExts\WebCatalogExtensions.cs" />
<Compile Include="Controllers\WorkFlowController.cs" />
<Compile Include="Controllers\FrontOfficeApiController.cs" />
<Compile Include="Controllers\Commande.cs" />
<Compile Include="Helpers\YavscHelpers.cs" />
<Compile Include="Controllers\BasketController.cs" />
<Compile Include="Basket\Basket.cs" />
<Compile Include="FileInfoCollection.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
<Content Include="Views\Home\Index.aspx" />
<Content Include="Web.config" />
<Content Include="Global.asax" />
<Content Include="style.css" />
<Content Include="Models\App.master" />
<Content Include="Views\Account\Register.aspx" />
<Content Include="Views\Account\ChangePassword.aspx" />
<Content Include="Views\Account\ChangePasswordSuccess.aspx" />
<Content Include="Views\Account\Index.aspx" />
<Content Include="Views\Account\UserList.aspx" />
<Content Include="Views\Account\Login.aspx" />
<Content Include="Views\Account\RoleList.aspx" />
<Content Include="Views\Account\Admin.aspx" />
<Content Include="images\Banner.png" />
<Content Include="images\noavatar.png" />
<Content Include="images\apache_pbw.png" />
<Content Include="images\debian-logo.png" />
<Content Include="images\Mono-powered.png" />
<Content Include="Views\Blogs\Index.aspx" />
<Content Include="Views\Blogs\Post.aspx" />
<Content Include="Views\Blogs\UserPosts.aspx" />
<Content Include="Views\Blogs\UserPost.aspx" />
<Content Include="Views\Blogs\Edit.aspx" />
<Content Include="Views\Account\RemoveUserQuery.aspx" />
<Content Include="Views\Account\RemoveRoleQuery.aspx" />
<Content Include="Views\Account\AddRole.aspx" />
<Content Include="Views\Blogs\Error.aspx" />
<Content Include="Views\Account\RegistrationPending.aspx" />
<Content Include="Views\Account\Validate.aspx" />
<Content Include="Views\FrontOffice\Catalog.aspx" />
<Content Include="Views\Account\Profile.aspx" />
<Content Include="Views\Blogs\TitleNotFound.aspx" />
<Content Include="Views\FrontOffice\ProductCategory.aspx" />
<Content Include="Views\FrontOffice\Product.aspx" />
<Content Include="Views\BackOffice\BackupCreated.aspx" />
<Content Include="Views\BackOffice\Index.aspx" />
<Content Include="Views\BackOffice\Restore.aspx" />
<Content Include="Views\Home\AOEMail.aspx" />
<Content Include="errors\GeneralError.aspx" />
<Content Include="errors\PageNotFound.aspx" />
<Content Include="Views\BackOffice\Restored.aspx" />
<Content Include="Views\BackOffice\Backups.aspx" />
<Content Include="Views\BackOffice\CreateBackup.aspx" />
<Content Include="Views\FrontOffice\Service.aspx" />
<Content Include="Views\FrontOffice\ReferenceNotFound.aspx" />
<Content Include="Views\FileSystem\Delete.aspx" />
<Content Include="Views\FileSystem\Index.aspx" />
<Content Include="Views\FileSystem\Create.aspx" />
<Content Include="Views\FileSystem\Details.aspx" />
<Content Include="Views\FileSystem\Edit.aspx" />
<Content Include="Views\FrontOffice\Brand.aspx" />
<Content Include="Views\FrontOffice\Command.aspx" />
<Content Include="Views\WorkFlow\NewProject.aspx" />
<Content Include="Views\WorkFlow\Index.aspx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="WebDeploy.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties VerifyCodeBehindFields="True" VerifyCodeBehindEvents="True">
<Policies>
<DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedFlat" ResourceNamePolicy="FileFormatDefault" />
</Policies>
<XspParameters Port="8080" Address="127.0.0.1" SslMode="None" SslProtocol="Default" KeyType="None" CertFile="" KeyFile="" PasswordOptions="None" Password="" Verbose="True" />
<WebDeployTargets>
<Target Name="">
<FileCopier Handler="MonoDevelop.Deployment.LocalFileCopyHandler" TargetDirectory="/srv/www/yavsc" ctype="LocalFileCopyConfiguration" />
</Target>
</WebDeployTargets>
</Properties>
</MonoDevelop>
</ProjectExtensions>
<ItemGroup>
<None Include="README" />
<None Include="uninstdb.sql" />
<None Include="uninstdbws.sql" />
<None Include="instdbws.sql" />
<None Include="RegistrationMail.txt" />
<None Include="Catalog.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NpgsqlMRPProviders\NpgsqlMRPProviders.csproj">
<Project>{BBA7175D-7F92-4278-96FC-84C495A2B5A6}</Project>
<Name>NpgsqlMRPProviders</Name>
</ProjectReference>
<ProjectReference Include="..\NpgsqlBlogProvider\NpgsqlBlogProvider.csproj">
<Project>{C6E9E91B-97D3-48D9-8AA7-05356929E162}</Project>
<Name>NpgsqlBlogProvider</Name>
</ProjectReference>
<ProjectReference Include="..\SalesCatalog\SalesCatalog.csproj">
<Project>{90BF2234-7252-4CD5-B2A4-17501B19279B}</Project>
<Name>SalesCatalog</Name>
</ProjectReference>
<ProjectReference Include="..\WorkFlowProvider\WorkFlowProvider.csproj">
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
<Name>WorkFlowProvider</Name>
</ProjectReference>
<ProjectReference Include="..\yavscModel\yavscModel.csproj">
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
<Name>yavscModel</Name>
</ProjectReference>
<ProjectReference Include="..\WebControls\WebControls.csproj">
<Project>{59E1DF7B-FFA0-4DEB-B5F3-76EBD98D5356}</Project>
<Name>WebControls</Name>
</ProjectReference>
</ItemGroup>
</Project>

10
web/WebDeploy.targets Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="TransformXml" AssemblyFile="WebTasks.dll" />
<Target Name="Deploy" Condition="'$(DeployDir)' != '' And !$(SkipCopyUnchangedFiles)" DependsOnTargets="Build">
<Copy SourceFiles="@(FileWrites)" DestinationFolder="$(DeployDir)\%(RelativeDir)" />
<Copy SourceFiles="@(Content)" DestinationFolder="$(DeployDir)\%(RelativeDir)" />
<TransformXml Source="Web.config" Transform="Web.$(Configuration).config" Destination="$(DeployDir)\Web.config" Condition="Exists('Web.$(Configuration).config')"/>
</Target>
</Project>

View file

@ -0,0 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,10 @@
<Properties>
<MonoDevelop.Ide.Workspace />
<MonoDevelop.Ide.Workbench />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches>
<Watch file="../../Controllers/BlogsController.cs" line="94" offsetX="537" offsetY="1860" expression="title" liveUpdate="False" />
</MonoDevelop.Ide.DebuggingService.PinnedWatches>
</Properties>

View file

@ -0,0 +1,62 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the "project output directory". The location of the project output
// directory is dependent on whether you are working with a local or web project.
// For local projects, the project output directory is defined as
// <Project Directory>\obj\<Configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// For web projects, the project output directory is defined as
// %HOMEPATH%\VSWebCache\<Machine Name>\<Project Directory>\obj\<Configuration>.
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

View file

@ -0,0 +1,145 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Web"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{2C6862B6-1AF2-49FD-9A6C-8DA7E0CAA799}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "CustomErrors1"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "CustomErrors1"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.Web"
AssemblyName = "System.Web"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Web.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.XML"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
BuildAction = "Compile"
/>
<File
RelPath = "Default.aspx"
SubType = "Form"
BuildAction = "Content"
/>
<File
RelPath = "Default.aspx.cs"
DependentUpon = "Default.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "Default.aspx.resx"
DependentUpon = "Default.aspx.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Global.asax"
SubType = "Component"
BuildAction = "Content"
/>
<File
RelPath = "Global.asax.cs"
DependentUpon = "Global.asax"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Global.asax.resx"
DependentUpon = "Global.asax.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "PageBase.cs"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "Web.config"
BuildAction = "Content"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View file

@ -0,0 +1,11 @@
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="AspNetResources.CustomErrors1._Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Default page</title>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
</form>
</body>
</HTML>

View file

@ -0,0 +1,41 @@
using System;
using System.Web;
namespace AspNetResources.CustomErrors1
{
/// <summary>
/// Summary description for _Default.
/// </summary>
public class _Default : PageBase
{
private void Page_Load (object sender, System.EventArgs e)
{
// ------------------------------------------------------
// No one is sane mind would throw an exception just for
// the heck of it, but for demonstration purposes this
// should work.
// ------------------------------------------------------
throw new Exception ("Silly exception");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used forserialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.TrayAutoArrange" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
</root>

View file

@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="CustomErrors1.Global" %>

View file

@ -0,0 +1,76 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace CustomErrors1
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
protected void Application_Start(Object sender, EventArgs e)
{
}
protected void Session_Start(Object sender, EventArgs e)
{
}
protected void Application_BeginRequest(Object sender, EventArgs e)
{
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
}
protected void Application_Error(Object sender, EventArgs e)
{
}
protected void Session_End(Object sender, EventArgs e)
{
}
protected void Application_End(Object sender, EventArgs e)
{
}
#region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
}
#endregion
}
}

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="ResMimeType">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="Version">
<value>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,32 @@
using System;
using System.Web;
using System.Web.UI;
namespace AspNetResources.CustomErrors1
{
public class PageBase : System.Web.UI.Page
{
protected override void OnError(EventArgs e)
{
// At this point we have information about the error
HttpContext ctx = HttpContext.Current;
Exception exception = ctx.Server.GetLastError ();
string errorInfo = "<br>Offending URL: " + ctx.Request.Url.ToString () +
"<br>Source: " + exception.Source +
"<br>Message: " + exception.Message +
"<br>Stack trace: " + exception.StackTrace;
ctx.Response.Write (errorInfo);
// --------------------------------------------------
// To let the page finish running we clear the error
// --------------------------------------------------
ctx.Server.ClearError ();
base.OnError (e);
}
}
}

View file

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation
defaultLanguage="c#"
debug="true"
/>
<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.
"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors
mode="RemoteOnly"
/>
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"
"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
-->
<authentication mode="Windows" />
<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<allow users="*" /> <!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>

View file

@ -0,0 +1,62 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the "project output directory". The location of the project output
// directory is dependent on whether you are working with a local or web project.
// For local projects, the project output directory is defined as
// <Project Directory>\obj\<Configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// For web projects, the project output directory is defined as
// %HOMEPATH%\VSWebCache\<Machine Name>\<Project Directory>\obj\<Configuration>.
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

View file

@ -0,0 +1,140 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Web"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{BC0E9D65-EEBF-44D3-A376-53CBD0F9A593}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "CustomErrors2"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "CustomErrors2"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.Web"
AssemblyName = "System.Web"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Web.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.XML"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
BuildAction = "Compile"
/>
<File
RelPath = "Default.aspx"
SubType = "Form"
BuildAction = "Content"
/>
<File
RelPath = "Default.aspx.cs"
DependentUpon = "Default.aspx"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "Default.aspx.resx"
DependentUpon = "Default.aspx.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Global.asax"
SubType = "Component"
BuildAction = "Content"
/>
<File
RelPath = "Global.asax.cs"
DependentUpon = "Global.asax"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Global.asax.resx"
DependentUpon = "Global.asax.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Web.config"
BuildAction = "Content"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View file

@ -0,0 +1,12 @@
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="AspNetResources.CustomErrors2._Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>Default</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
</form>
</body>
</html>

View file

@ -0,0 +1,39 @@
using System;
using System.Web;
namespace AspNetResources.CustomErrors2
{
/// <summary>
/// Summary description for _Default.
/// </summary>
public class _Default : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// ------------------------------------------------------
// No one is sane mind would throw an exception just for
// the heck of it, but for demonstration purposes this
// should work. Your event handler in Global.asax will
// catch the exception.
// ------------------------------------------------------
throw new Exception ("Silly exception");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}

Some files were not shown because too many files have changed in this diff Show more