Initial import
This commit is contained in:
369
web/Controllers/AccountController.cs
Normal file
369
web/Controllers/AccountController.cs
Normal 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 ();
|
||||
}
|
||||
}
|
||||
}
|
66
web/Controllers/BackOfficeController.cs
Normal file
66
web/Controllers/BackOfficeController.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
71
web/Controllers/BasketController.cs
Normal file
71
web/Controllers/BasketController.cs
Normal 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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
269
web/Controllers/BlogsController.cs
Normal file
269
web/Controllers/BlogsController.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
21
web/Controllers/Commande.cs
Normal file
21
web/Controllers/Commande.cs
Normal 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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
127
web/Controllers/FileSystemController.cs
Normal file
127
web/Controllers/FileSystemController.cs
Normal file
@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
85
web/Controllers/FrontOfficeApiController.cs
Normal file
85
web/Controllers/FrontOfficeApiController.cs
Normal 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";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
128
web/Controllers/FrontOfficeController.cs
Normal file
128
web/Controllers/FrontOfficeController.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
101
web/Controllers/HomeController.cs
Normal file
101
web/Controllers/HomeController.cs
Normal 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
22
web/Controllers/T.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
51
web/Controllers/WorkFlowController.cs
Normal file
51
web/Controllers/WorkFlowController.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user