Esempio n. 1
0
        private void WebCode(string path)
        {
            var folder = ConfigPath(path, "File_Web_Script", $"{Entity.Parent.Name}\\{Entity.Name}");
            var file   = $"{folder}\\Index.aspx";

            {
                var coder = new EasyUiIndexPageCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile(file, coder.Code());
            }
            file = $"{folder}\\Action.aspx";
            {
                WriteFile(file, ActionAspxCode());
            }
            file = $"{folder}\\Export.aspx";
            {
                WriteFile(file, ExportAspxCode());
            }
            file = ConfigPath(path, "File_Web_Form", $"{Entity.Parent.Name}\\{Entity.Name}\\Form.htm");
            {
                var coder = new EasyUiFormCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile(file, coder.Code());
            }
            file = ConfigPath(path, "File_Web_Item", $"{Entity.Parent.Name}\\{Entity.Name}\\Item.aspx");
            {
                var coder = new EasyUiItemCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile(file, coder.Code());
            }

            if (Entity.ListDetails)
            {
                file = ConfigPath(path, "File_Web_Details", $"{Entity.Parent.Name}\\{Entity.Name}\\Details.aspx");
                {
                    var coder = new EasyUiListDetailsPageCoder
                    {
                        Entity  = Entity,
                        Project = Project
                    };
                    WriteFile(file, coder.Code());
                }
            }
            {
                if (folder.Contains(".js"))
                {
                    folder = Path.GetDirectoryName(folder);
                }
                // ReSharper disable once PossibleNullReferenceException
                Entity["File_Web_Script"] = folder.Replace(path, "").Trim('\\');
                var coder = new EasyUiPageScriptCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile($"{folder}\\script.js", coder.Code());
                WriteFile($"{folder}\\form.js", coder.FormJsCode());
                WriteFile($"{folder}\\page.js", coder.PageJsCode());
            }
        }
Esempio n. 2
0
        private void WebCode(string path)
        {
            var file = ConfigPath(Entity, "File_Web_Index", path, $"{Entity.Parent.Name}\\{Entity.Name}", "Index.aspx");

            {
                var coder = new EasyUiIndexPageCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile(file, coder.Code());
            }
            file = ConfigPath(Entity, "File_Web_Action", path, $"{Entity.Parent.Name}\\{Entity.Name}", "Action.aspx");
            {
                WriteFile(file, ActionAspxCode());
            }
            file = ConfigPath(Entity, "File_Web_Export", path, $"{Entity.Parent.Name}\\{Entity.Name}", "Export.aspx");
            {
                WriteFile(file, ExportAspxCode());
            }
            file = ConfigPath(Entity, "File_Web_Form", path, $"{Entity.Parent.Name}\\{Entity.Name}", "Form.htm");
            {
                var coder = new EasyUiFormCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile(file, coder.Code());
            }
            file = ConfigPath(Entity, "File_Web_Item", path, $"{Entity.Parent.Name}\\{Entity.Name}", "Item.aspx");
            {
                var coder = new EasyUiItemCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                WriteFile(file, coder.Code());
            }

            if (Entity.ListDetails)
            {
                file = ConfigPath(Entity, "File_Web_Details", path, $"{Entity.Parent.Name}\\{Entity.Name}", "Details.aspx");
                {
                    var coder = new EasyUiListDetailsPageCoder
                    {
                        Entity  = Entity,
                        Project = Project
                    };
                    WriteFile(file, coder.Code());
                }
            }
            {
                var coder = new EasyUiPageScriptCoder
                {
                    Entity  = Entity,
                    Project = Project
                };
                file = ConfigPath(Entity, "File_Web_Script_js", path, $"{Entity.Parent.Name}\\{Entity.Name}", "script.js");
                WriteFile(file, coder.Code());
                file = ConfigPath(Entity, "File_Web_Form_js", path, $"{Entity.Parent.Name}\\{Entity.Name}", "form.js");
                WriteFile(file, coder.FormJsCode());
                file = ConfigPath(Entity, "File_Web_Page_js", path, $"{Entity.Parent.Name}\\{Entity.Name}", "page.js");
                WriteFile(file, coder.PageJsCode());
            }
        }