Skip to content

Commit

Permalink
Refactoring and updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnp committed Dec 19, 2015
1 parent cf35755 commit 46f9781
Show file tree
Hide file tree
Showing 485 changed files with 114,944 additions and 58,797 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ obj
*.exe
*.suo
*.user
.my
.my
/src/Frapid.Web/Catalogs/
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@
<binding protocol="http" bindingInformation="*:49755:localhost" />
</bindings>
</site>
<site name="Frapid.Account.Api" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\nirvan\Desktop\mixerp\frapid\src\Frapid.Web\Areas\Frapid.Account\WebApi" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:52937:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Web.Mvc;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.DashboardControllers
{
public class ConfigurationProfileController : DashboardController
{
[Route("dashboard/account/configuration-profile")]
[Authorize]
public ActionResult Index()
{
return this.FrapidView(this.GetRazorView<AreaRegistration>("ConfigurationProfile/Index.cshtml"));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Web.Mvc;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.DashboardControllers
{
public class RoleController : DashboardController
{
[Route("dashboard/account/roles")]
[Authorize]
public ActionResult Index()
{
return this.FrapidView(this.GetRazorView<AreaRegistration>("Role/Index.cshtml"));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Web.Mvc;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.DashboardControllers
{
public class UserController : DashboardController
{
[Route("dashboard/account/user-management")]
[Authorize]
public ActionResult Index()
{
return this.FrapidView(this.GetRazorView<AreaRegistration>("User/Index.cshtml"));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// ReSharper disable All
using Npgsql;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using Frapid.Account.Entities;
using Frapid.DataAccess;
using Frapid.DataAccess.Models;
using Frapid.DbPolicy;
using Frapid.Framework.Extensions;
namespace Frapid.Account.DataAccess
{
/// <summary>
/// Prepares, validates, and executes the function "account.can_confirm_registration(_token uuid)" on the database.
/// </summary>
public class CanConfirmRegistrationProcedure : DbAccess, ICanConfirmRegistrationRepository
{
/// <summary>
/// The schema of this PostgreSQL function.
/// </summary>
public override string _ObjectNamespace => "account";
/// <summary>
/// The schema unqualified name of this PostgreSQL function.
/// </summary>
public override string _ObjectName => "can_confirm_registration";
/// <summary>
/// Login id of application user accessing this PostgreSQL function.
/// </summary>
public long _LoginId { get; set; }
/// <summary>
/// User id of application user accessing this table.
/// </summary>
public int _UserId { get; set; }
/// <summary>
/// The name of the database on which queries are being executed to.
/// </summary>
public string _Catalog { get; set; }

/// <summary>
/// Maps to "_token" argument of the function "account.can_confirm_registration".
/// </summary>
public System.Guid Token { get; set; }

/// <summary>
/// Prepares, validates, and executes the function "account.can_confirm_registration(_token uuid)" on the database.
/// </summary>
public CanConfirmRegistrationProcedure()
{
}

/// <summary>
/// Prepares, validates, and executes the function "account.can_confirm_registration(_token uuid)" on the database.
/// </summary>
/// <param name="token">Enter argument value for "_token" parameter of the function "account.can_confirm_registration".</param>
public CanConfirmRegistrationProcedure(System.Guid token)
{
this.Token = token;
}
/// <summary>
/// Prepares and executes the function "account.can_confirm_registration".
/// </summary>
/// <exception cref="UnauthorizedException">Thown when the application user does not have sufficient privilege to perform this action.</exception>
public bool Execute()
{
if (!this.SkipValidation)
{
if (!this.Validated)
{
this.Validate(AccessTypeEnum.Execute, this._LoginId, this._Catalog, false);
}
if (!this.HasAccess)
{
Log.Information("Access to the function \"CanConfirmRegistrationProcedure\" was denied to the user with Login ID {LoginId}.", this._LoginId);
throw new UnauthorizedException("Access is denied.");
}
}
string query = "SELECT * FROM account.can_confirm_registration(@Token);";

query = query.ReplaceWholeWord("@Token", "@0::uuid");


List<object> parameters = new List<object>();
parameters.Add(this.Token);

return Factory.Scalar<bool>(this._Catalog, query, parameters.ToArray());
}


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// ReSharper disable All
using Npgsql;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using Frapid.Account.Entities;
using Frapid.DataAccess;
using Frapid.DataAccess.Models;
using Frapid.DbPolicy;
using Frapid.Framework.Extensions;
namespace Frapid.Account.DataAccess
{
/// <summary>
/// Prepares, validates, and executes the function "account.can_register_with_facebook()" on the database.
/// </summary>
public class CanRegisterWithFacebookProcedure : DbAccess, ICanRegisterWithFacebookRepository
{
/// <summary>
/// The schema of this PostgreSQL function.
/// </summary>
public override string _ObjectNamespace => "account";
/// <summary>
/// The schema unqualified name of this PostgreSQL function.
/// </summary>
public override string _ObjectName => "can_register_with_facebook";
/// <summary>
/// Login id of application user accessing this PostgreSQL function.
/// </summary>
public long _LoginId { get; set; }
/// <summary>
/// User id of application user accessing this table.
/// </summary>
public int _UserId { get; set; }
/// <summary>
/// The name of the database on which queries are being executed to.
/// </summary>
public string _Catalog { get; set; }


/// <summary>
/// Prepares, validates, and executes the function "account.can_register_with_facebook()" on the database.
/// </summary>
public CanRegisterWithFacebookProcedure()
{
}
/// <summary>
/// Prepares and executes the function "account.can_register_with_facebook".
/// </summary>
/// <exception cref="UnauthorizedException">Thown when the application user does not have sufficient privilege to perform this action.</exception>
public bool Execute()
{
if (!this.SkipValidation)
{
if (!this.Validated)
{
this.Validate(AccessTypeEnum.Execute, this._LoginId, this._Catalog, false);
}
if (!this.HasAccess)
{
Log.Information("Access to the function \"CanRegisterWithFacebookProcedure\" was denied to the user with Login ID {LoginId}.", this._LoginId);
throw new UnauthorizedException("Access is denied.");
}
}
string query = "SELECT * FROM account.can_register_with_facebook();";




List<object> parameters = new List<object>();

return Factory.Scalar<bool>(this._Catalog, query, parameters.ToArray());
}


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// ReSharper disable All
using Npgsql;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using Frapid.Account.Entities;
using Frapid.DataAccess;
using Frapid.DataAccess.Models;
using Frapid.DbPolicy;
using Frapid.Framework.Extensions;
namespace Frapid.Account.DataAccess
{
/// <summary>
/// Prepares, validates, and executes the function "account.can_register_with_google()" on the database.
/// </summary>
public class CanRegisterWithGoogleProcedure : DbAccess, ICanRegisterWithGoogleRepository
{
/// <summary>
/// The schema of this PostgreSQL function.
/// </summary>
public override string _ObjectNamespace => "account";
/// <summary>
/// The schema unqualified name of this PostgreSQL function.
/// </summary>
public override string _ObjectName => "can_register_with_google";
/// <summary>
/// Login id of application user accessing this PostgreSQL function.
/// </summary>
public long _LoginId { get; set; }
/// <summary>
/// User id of application user accessing this table.
/// </summary>
public int _UserId { get; set; }
/// <summary>
/// The name of the database on which queries are being executed to.
/// </summary>
public string _Catalog { get; set; }


/// <summary>
/// Prepares, validates, and executes the function "account.can_register_with_google()" on the database.
/// </summary>
public CanRegisterWithGoogleProcedure()
{
}
/// <summary>
/// Prepares and executes the function "account.can_register_with_google".
/// </summary>
/// <exception cref="UnauthorizedException">Thown when the application user does not have sufficient privilege to perform this action.</exception>
public bool Execute()
{
if (!this.SkipValidation)
{
if (!this.Validated)
{
this.Validate(AccessTypeEnum.Execute, this._LoginId, this._Catalog, false);
}
if (!this.HasAccess)
{
Log.Information("Access to the function \"CanRegisterWithGoogleProcedure\" was denied to the user with Login ID {LoginId}.", this._LoginId);
throw new UnauthorizedException("Access is denied.");
}
}
string query = "SELECT * FROM account.can_register_with_google();";




List<object> parameters = new List<object>();

return Factory.Scalar<bool>(this._Catalog, query, parameters.ToArray());
}


}
}
Loading

0 comments on commit 46f9781

Please sign in to comment.