国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

Wojilu學(xué)習(xí)筆記(01)

2019-11-14 16:41:32
字體:
供稿:網(wǎng)友

“我記錄”開發(fā)框架(wojilu framework) 是 .net 平臺(tái)下的綜合開發(fā)框架,主要用于 web 方面的快速開發(fā)。

官方網(wǎng)址:http://www.wojilu.com
源碼托管網(wǎng)址: https://github.com/wojilu/wojilu
授權(quán)協(xié)議:Apache License,可免費(fèi)用于商業(yè)環(huán)境

 

路由配置

 

~/{controller}/{id};requirements:{id=int}

默認(rèn)Controller的Show(int id)方法,此處id直接傳入

public void Show(int id)        {                   }

 

數(shù)據(jù)分頁組件

 

public void Show(int id)      {          set("siteleft", qjw.Web.siteleft());          using (MAction action = new MAction(TableNames.zt_article))          {              int page = ctx.route.page;              int rowcount = 0;              int pagesize = 10;              MDataTable table = action.Select(page, pagesize, "IsDel=0 and classid="+ id +" order by posttime desc", out rowcount);              //MDataTable table = action.Select("IsDel=0 order by posttime desc");              IBlock block = getBlock("Article");              foreach (MDataRow row in table.Rows)              {                  block.Set("article.id", row["id"]);                  block.Set("article.title", row["title"]);                  block.Next();              }              //生成分頁條              int recordCount = rowcount;              int pageSize = pagesize;              int currentPage = ctx.route.page;              wojilu.PageHelper op = new wojilu.PageHelper(recordCount, pageSize, currentPage);              set("page", op.PageBar);          }      }

 

CyqData數(shù)據(jù)

 

單條記錄操作

using (MAction action = new MAction(TableNames.zt_class))            {                if (action.Fill(id))                {                    set("ztclass.id", action.Get<string>(zt_class.ID));                    set("ztclass.classname", action.Get<string>(zt_class.ClassName));                    set("ztclass.content", action.Get<string>(zt_class.Content));                }            }

多條記錄操作

using (MAction action = new MAction(TableNames.zt_class))            {                MDataTable table = action.Select("IsDel=0 and FatherId=0 and IsNav=1 and SystemId=1 and id>1 order by orderflag asc ");                                IBlock cblock = getBlock("Nav");                foreach (MDataRow row in table.Rows)                {                    cblock.Set("ztclass.id", row["id"]);                    cblock.Set("ztclass.classname", row["classname"]);                    cblock.Set("ztclass.url", row["url"]);                    cblock.Next();                }            }

 

using

變量使用后就會(huì)釋放,變量名可以重復(fù)


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 河北省| 娄烦县| 珲春市| 和硕县| 彩票| 东丰县| 宝丰县| 建始县| 平乡县| 慈利县| 大城县| 长兴县| 宿州市| 明溪县| 休宁县| 霍山县| 新乐市| 六盘水市| 天全县| 云梦县| 太保市| 三原县| 化州市| 内丘县| 竹溪县| 皋兰县| 明溪县| 湖南省| 宜城市| 莱西市| 汝州市| 凤凰县| 宝丰县| 温州市| 寿阳县| 南澳县| 新营市| 玉环县| 怀化市| 宕昌县| 武安市|