本文整理汇总了C#中MvcContext.ex方法的典型用法代码示例。如果您正苦于以下问题:C# MvcContext.ex方法的具体用法?C# MvcContext.ex怎么用?C# MvcContext.ex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MvcContext
的用法示例。
在下文中一共展示了MvcContext.ex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getOwnerByUrl
public virtual IMember getOwnerByUrl( MvcContext ctx )
{
Group group = new GroupService().GetByUrl( ctx.route.owner );
if (group == null) {
throw ctx.ex( HttpStatus.NotFound_404, "owner error : " + lang.get( "exGroupNotFound" ) );
}
return group;
}
示例2: GetHelper
public static IInitHelper GetHelper( Type ownerType, MvcContext ctx )
{
IInitHelper obj = null;
_InitList.TryGetValue( ownerType.Name.ToLower(), out obj );
if (obj == null) throw ctx.ex( HttpStatus.NotFound_404, "not support owner" );
return obj;
}
示例3: IsAppRunning
public bool IsAppRunning( MvcContext ctx )
{
SiteAppService userAppService = new SiteAppService();
IMemberApp app = userAppService.GetByApp( (IApp)ctx.app.obj );
if (app == null || app.IsStop == 1)
throw ctx.ex( HttpStatus.NotFound_404, lang.get( "exAppNotFound" ) );
return app.IsStop == 0;
}
示例4: InitController
/// <summary>
/// ��ʼ����ǰ controller
/// </summary>
/// <param name="ctx"></param>
public virtual void InitController( MvcContext ctx )
{
ControllerBase controller = ControllerFactory.InitController( ctx );
if (controller == null) {
String typeName = ctx.route.getControllerNameWithoutRootNamespace();
String msg = lang.get( "exControllerNotExist" ) + ": " + typeName;
throw ctx.ex( HttpStatus.NotFound_404, msg );
}
ctx.utils.setController( controller );
}
示例5: InitOwner
//-------------------------------- owner ----------------------------------
public void InitOwner( MvcContext ctx )
{
if (strUtil.IsNullOrEmpty( ctx.route.ownerType )) return;
IMember owner = getHelper( ctx ).getOwnerByUrl( ctx );
if (owner.Status == MemberStatus.Deleted || owner.Status == MemberStatus.Approving) {
throw ctx.ex( HttpStatus.NotFound_404, "owner not found" );
}
OwnerContext context = new OwnerContext();
context.Id = owner.Id;
context.obj = owner;
ctx.utils.setOwnerContext( context );
this.updateRoute_ByOwnerMenus( ctx, owner );
}