Git Product home page Git Product logo

easyframework's Introduction

该项目不再单独维护,请移步至:

ZKEACMS

ZKEACMS .net core

EasyFrameWork

主旨:简单使用,快速开发。

使用本框架开发,从访问数据库,到UI交互都可以快速,轻松完成。如无特别需求,基本可不写代码。

简单示例

数据库的设置:

Web.Config:

<connectionStrings>
    <add name="Easy" connectionString="App_Data\DataBase.mdb" />
</connectionStrings>
<appSettings>
    <add key="DataBase" value="Ace"/> //可选值:Ace(Access 2007),Jet(Access 2003),SQL
</appSettings>

EntityConfig

public override void DataConfigure()
{
    DataTable("Advertisement");
    DataConfig(m => m.ID).AsIncreasePrimaryKey(); 
}

UI的配置,如何呈现,一切随你简单配置。

public override void ViewConfigure()
{
    ViewConfig(m => m.ID).AsHidden();
    ViewConfig(m => m.Title).AsTextBox().Required().Order(1).MaxLength(100);
    ViewConfig(m => m.Description).AsMutiLineTextBox().Order(101);
    ViewConfig(m => m.Position).AsDropDownList().DataSource<EnumFlag.ADPosition>();
}

控制器(Controller)

public class AdvertisementController : BasicController<[Entity], [long], [Service]>
{

}

不用写一句代码,增,删,改,查,便可轻松完成。

界面(UI)

列表:

@(
    Html.Grid().Name("AdvertisementList")
        .SetAsToolBar("#toolBar")
        .SetColumnTemplate(m => { m.Add(q => q.Title, "<a>{Title}</a>"); })
        .ShowCheckbox(m => m.ID)
        .OrderBy(m=>m.OrderIndex, Easy.Constant.DataEnumerate.OrderType.Descending)
)

这样,便完成了一个复杂的列表页面,包括检索,分页,自定义排序等。

编辑,新建:

@Html.EditModel(2)

这样,便完成了一个2例N行的自动布局。

EasyFramework使用如此简单,并不代表它只能实现这样简单的东西。简约,但并不简单。 License

Apache-2.0

easyframework's People

Contributors

seriawei avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.