当前位置: 首页>>代码示例>>C#>>正文


C# IExecutionContext.Transfer方法代码示例

本文整理汇总了C#中IExecutionContext.Transfer方法的典型用法代码示例。如果您正苦于以下问题:C# IExecutionContext.Transfer方法的具体用法?C# IExecutionContext.Transfer怎么用?C# IExecutionContext.Transfer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IExecutionContext的用法示例。


在下文中一共展示了IExecutionContext.Transfer方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoProcessRequest

        /// <summary>
        /// Controller implementation. User signout is performed by calling Authenticate with null as the 
        /// user. 
        /// </summary>
        /// <param name="context">The context.</param>
        public override void DoProcessRequest(IExecutionContext context)
        {
            FormsAuth.SignOut();
            context.Authenticate(null);

            context.Transfer("home/index");
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:12,代码来源:Logoff.cs

示例2: DoProcessRequest

        /// <summary>
        /// Controller implementation
        /// </summary>
        /// <param name="context">The context.</param>
        public override void DoProcessRequest(IExecutionContext context)
        {
            if (!ValidateLogon())
                return;

            context.Authenticate(FormsAuth.SignIn(username, rememberMe));

            context.Transfer("/home/index");
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:13,代码来源:Logon.cs

示例3: DoProcessRequest

        public override void DoProcessRequest(IExecutionContext context)
        {
            if (!String.IsNullOrEmpty(published))
                SetPublishState();
            else
                UpdatePosting();

            context.Transfer("/posting/manage");
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:9,代码来源:Ad.cs

示例4: DoProcessRequest

 public override void DoProcessRequest(IExecutionContext context)
 {
     if (!String.IsNullOrEmpty(published))
     {
         SetPublishState();
         context.Transfer("/posting/resume/preview/byname/" + posting.ShortName);
     }
     else
         UpdatePosting();
 }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:10,代码来源:Resume.cs

示例5: DoProcessRequest

        public override void DoProcessRequest(IExecutionContext context)
        {
            ContentType def = ContentTypeHelper.Instance.Parse(defaultContentType);

            // if preferences have been reset elsewhere, we need to stay on this page.
            if (def == null || preferenceReset)
                return;

            // otherwise, we have a default content type, so we redirect to the search page for it
            context.Transfer("/postings/" + (def.Equals(ContentType.Resume) ? "resume" : "ad"));
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:11,代码来源:Home.cs

示例6: DoProcessRequest

        public override void DoProcessRequest(IExecutionContext context)
        {
            // if preferences have been reset elsewhere, we need to stay on this page.
            if (String.IsNullOrEmpty(defaultContentType) || preferenceReset)
                return;

            ContentType def = ContentTypeUtility.FromString(defaultContentType);

            // otherwise, we have a default content type, so we redirect to the search page for it
            context.Transfer("/postings/" + ContentTypeUtility.AsString(def));
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:11,代码来源:Home.cs

示例7: DoProcessRequest

        public override void DoProcessRequest(IExecutionContext context)
        {
            UserProfile profile = UserDataAccess.Instance.LoadUser(username);
            if (profile == null || !profile.Authenticate(password))
            {
                ReportError(null, "The user name or password is incorrect");
                return;
            }

            else
                // this is the key line. this sets the profile as the 
                // current user, and marks the session as authenticated
                context.Authenticate(profile);

            ContentType userContentType = UserTypeUtility.AsContentType(profile.UserType);
            if (ContentTypeUtility.FromString(defaultContentType) != userContentType)
                defaultContentType = ContentTypeUtility.AsString(userContentType);

            if (String.IsNullOrEmpty(originalRequest))
                context.Transfer("/default");
            else
                context.Transfer(HttpUtility.UrlDecode(originalRequest));
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:23,代码来源:Signin.cs

示例8: DoProcessRequest

        public override void DoProcessRequest(IExecutionContext context)
        {
            if (!ValidateRegistration())
                return;

            MembershipCreateStatus createStatus = MembershipService.CreateUser(username, password, email);

            if (createStatus == MembershipCreateStatus.Success)
            {
                FormsAuth.SignIn(username, false);
                context.Transfer("/home/index");
            }
            else
                ReportError(null, ErrorCodeToString(createStatus));
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:15,代码来源:Register.cs

示例9: DoProcessRequest

        public override void DoProcessRequest(IExecutionContext context)
        {
            userProfile profile = UserHelper.Instance.LoadUser(username);
            if (profile == null || !profile.Authenticate(password))
            {
                ReportError(null, "The user name or password is incorrect");
                return;
            }

            else
                // this is the key line. this sets the profile as the 
                // current user, and marks the session as authenticated
                context.Authenticate(profile);

            if (ContentTypeHelper.Instance.Parse(defaultContentType) != profile.UserType.ContentType)
                defaultContentType = ContentTypeHelper.Instance.GetSimpleName(profile.UserType.ContentType);

            // hack. we didn't create a table to store the roles, so now 
            // we're faking them through here
            if (profile.UserType.Equals(UserType.Company)) {
                var node = profile.role.AppendNode();
                node.Name = "company";
            }

            if (String.IsNullOrEmpty(originalRequest))
                context.Transfer("/default");
            else
                context.Transfer(HttpUtility.UrlDecode(originalRequest));
        }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:29,代码来源:Signin.cs

示例10: DoProcessRequest

 public override void DoProcessRequest(IExecutionContext context)
 {
     if (posting == null)
         context.Transfer("get /posting/resume/byname");
 }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:5,代码来源:Preview.cs


注:本文中的IExecutionContext.Transfer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。