コード例 #1
0
ファイル: FormHelper.cs プロジェクト: fdsa-ltd/DMS
        public static string ProcessRazorView(ISchema schema, string form, out bool rendered)
        {
            string controlFile = GetFormView(form);

            rendered = false;
            if (System.IO.File.Exists(controlFile))
            {
                if (HttpContext.Current != null && HttpContext.Current.Items["ControllerContext"] != null)
                {
                    var controllerContext = (ControllerContext)HttpContext.Current.Items["ControllerContext"];
                    var viewData          = new ViewDataDictionary()
                    {
                        Model = schema
                    };
                    rendered = true;
                    return(RazorViewHelper.RenderView(GetFormViewVirtualPath(form), controllerContext, viewData));
                }
            }

            return("");
        }
コード例 #2
0
        public static string ProcessRazorView(ISchema schema, IColumn column, out bool rendered)
        {
            string controlFile = GetControlView(column.ControlType);

            rendered = false;
            if (System.IO.File.Exists(controlFile))
            {
                if (HttpContext.Current != null && HttpContext.Current.Items["ControllerContext"] != null)
                {
                    var controllerContext = (ControllerContext)HttpContext.Current.Items["ControllerContext"];
                    var viewData          = new ViewDataDictionary()
                    {
                        Model = column
                    };
                    viewData["Schema"] = schema;
                    rendered           = true;
                    return(RazorViewHelper.RenderView(GetControlViewVirtualPath(column.ControlType), controllerContext, viewData));
                }
            }

            return("");
        }