Moon.NET框架架构及介绍
企业开发宗旨在于高效与便捷以及系统升级与维护的稳定.此框架为此而架构设计,目标在于打造一个高效能的.NET开发框架。
Moon.NET由两部分组成:Qin.Data(一个高性能的ORM系统,其特色是提供便捷的开发和高效的数据库访问性能以及方便便捷的系统升级,内含代码生成器、代码自动编译);Qin.Web(一个快速的ASP.NET服务端框架,内含一个前端js脚本一引擎[有了它,你只需专注于业务逻辑,几乎绝大部分代码由引擎生成]、以及实现权限认证的AOP方案和一个前端UI库).其中的Qin.Data已被用于合富网络有限公司的数据层取代原有的实体框架.
Qin.Data的相关介绍
Qin.Web相关介绍
2.强大的脚本引擎
实现一个页面数据的加载和数据更新
前端代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="MoonAjax.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>model加载和数据更新</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="Scripts/Qin.Tool.js"></script>
<script src="Thrid/art/artDialog.js?skin=aero" type="text/javascript"></script>
<script>
$(function () {
Qin_LoadDataToDom("MoonAjax.UserInfoAction", "GetUserInfo", {}, "form_UserInfo");
});
function AjaxUpdateUserInfo() {
var ID = $("#keyID").val();
Qin_AjaxUpdate("MoonAjax.UserInfoAction", "AjaxUpdateUserInfo", "form_UserInfo", "ID", ID, { otherData: 22 }, function (data) {
alert("主键为"+data+" update success");
});
};
</script>
</head>
<body>
<form id="form_UserInfo" >
<input id="keyID" class="Key" field="ID" type="hidden" />
<table style="width: 100%;">
<tr>
<td>
姓名:
</td>
<td>
<input field="UserName" type="text" />
</td>
</tr>
<tr>
<td>
性别
</td>
<td>
<input name="Sex" field="Sex" value="true" type="radio" />男<input name="Sex" field="Sex"
value="false" type="radio" />女
</td>
</tr>
<tr>
<td>
年龄
</td>
<td>
<input field="Age" type="text" />
</td>
</tr>
<tr>
<td>
北京户口
</td>
<td>
<input field="IsBeiJing" type="checkbox" />
</td>
</tr>
<tr>
<td>
年龄段
</td>
<td>
<select field="AgePeriod"><option value="1">老年人</option><option value="2">中年人</option><option value="3">年轻人</option></select>
</td>
</tr>
</table>
<input type="button" onclick="AjaxUpdateUserInfo();" value="更新用户数据" />
</form>
</body>
</html>
后端代码(绝大部分逻辑代码由引擎自动生成).<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>model加载和数据更新</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="Scripts/Qin.Tool.js"></script>
<script src="Thrid/art/artDialog.js?skin=aero" type="text/javascript"></script>
<script>
$(function () {
Qin_LoadDataToDom("MoonAjax.UserInfoAction", "GetUserInfo", {}, "form_UserInfo");
});
function AjaxUpdateUserInfo() {
var ID = $("#keyID").val();
Qin_AjaxUpdate("MoonAjax.UserInfoAction", "AjaxUpdateUserInfo", "form_UserInfo", "ID", ID, { otherData: 22 }, function (data) {
alert("主键为"+data+" update success");
});
};
</script>
</head>
<body>
<form id="form_UserInfo" >
<input id="keyID" class="Key" field="ID" type="hidden" />
<table style="width: 100%;">
<tr>
<td>
姓名:
</td>
<td>
<input field="UserName" type="text" />
</td>
</tr>
<tr>
<td>
性别
</td>
<td>
<input name="Sex" field="Sex" value="true" type="radio" />男<input name="Sex" field="Sex"
value="false" type="radio" />女
</td>
</tr>
<tr>
<td>
年龄
</td>
<td>
<input field="Age" type="text" />
</td>
</tr>
<tr>
<td>
北京户口
</td>
<td>
<input field="IsBeiJing" type="checkbox" />
</td>
</tr>
<tr>
<td>
年龄段
</td>
<td>
<select field="AgePeriod"><option value="1">老年人</option><option value="2">中年人</option><option value="3">年轻人</option></select>
</td>
</tr>
</table>
<input type="button" onclick="AjaxUpdateUserInfo();" value="更新用户数据" />
</form>
</body>
</html>
/*
* 由SharpDevelop创建。
* 用户: qinshichuan
* 日期: 2011-12-9
* 时间: 11:03
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using Qin.Web;
using Qin.Data;
using MoonModel;
namespace MoonAjax
{
/// <summary>
/// Description of UserInfo.
/// </summary>
public class UserInfoAction:QinAction
{
public static void GetStringData()
{
ReturnTextString("秦时明月Ajax框架欢迎你");
}
public static void GetJSONData()
{
var userName = Request["userName"];
var password = Request["password"];
var data = new { Age=12,Address="重庆"};
ReturnJSONString(data);
}
public static void InsertFormData()
{
}
public static void AjaxInsertUserInfo()
{
DBTool db = new DBTool(Table.PersonSet);
var UserName = Request["UserName"];
var Sex = Request["Sex"];
var Age = Request["Age"];
var IsBeiJing = Request["IsBeiJing"];
var AgePeriod = Request["AgePeriod"];
var otherData = Request["otherData"];
db.SetInsertField(PersonSet.UserName_, UserName);
db.SetInsertField(PersonSet.Sex_, Sex);
db.SetInsertField(PersonSet.Age_, Age);
db.SetInsertField(PersonSet.IsBeiJing_, IsBeiJing);
db.SetInsertField(PersonSet.AgePeriod_, AgePeriod);
//db.SetInsertField(PersonSet.otherData_, otherData);
db.SaveChanges();
ReturnTextString(db.NewID);
}
[Log()]
public static void AjaxUpdateUserInfo()
{
DBTool db = new DBTool(Table.PersonSet);
db.Where = PersonSet.ID_.Equals_(Request["PrimaryKey"]);
var ID = Request["ID"];
var UserName = Request["UserName"];
var Sex = Request["Sex"];
var Age = Request["Age"];
var IsBeiJing = Request["IsBeiJing"];
var AgePeriod = Request["AgePeriod"];
var otherData = Request["otherData"];
var PrimaryKey = Request["PrimaryKey"];
db.SetUpdateField(PersonSet.UserName_, UserName);
db.SetUpdateField(PersonSet.Sex_, Sex);
db.SetUpdateField(PersonSet.Age_, Age);
db.SetUpdateField(PersonSet.IsBeiJing_, IsBeiJing);
db.SetUpdateField(PersonSet.AgePeriod_, AgePeriod);
db.SaveChanges();
ReturnTextString(PrimaryKey);
}
[Log()]
public static void GetUserInfo(){
DBTool db = new DBTool(PersonSet.TableName_Qin);
db.Where = PersonSet.ID_.Equals_(1);
var user = db.GetEntity<PersonSet>();
ReturnJSONString(user);
}
}
}
* 由SharpDevelop创建。
* 用户: qinshichuan
* 日期: 2011-12-9
* 时间: 11:03
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using Qin.Web;
using Qin.Data;
using MoonModel;
namespace MoonAjax
{
/// <summary>
/// Description of UserInfo.
/// </summary>
public class UserInfoAction:QinAction
{
public static void GetStringData()
{
ReturnTextString("秦时明月Ajax框架欢迎你");
}
public static void GetJSONData()
{
var userName = Request["userName"];
var password = Request["password"];
var data = new { Age=12,Address="重庆"};
ReturnJSONString(data);
}
public static void InsertFormData()
{
}
public static void AjaxInsertUserInfo()
{
DBTool db = new DBTool(Table.PersonSet);
var UserName = Request["UserName"];
var Sex = Request["Sex"];
var Age = Request["Age"];
var IsBeiJing = Request["IsBeiJing"];
var AgePeriod = Request["AgePeriod"];
var otherData = Request["otherData"];
db.SetInsertField(PersonSet.UserName_, UserName);
db.SetInsertField(PersonSet.Sex_, Sex);
db.SetInsertField(PersonSet.Age_, Age);
db.SetInsertField(PersonSet.IsBeiJing_, IsBeiJing);
db.SetInsertField(PersonSet.AgePeriod_, AgePeriod);
//db.SetInsertField(PersonSet.otherData_, otherData);
db.SaveChanges();
ReturnTextString(db.NewID);
}
[Log()]
public static void AjaxUpdateUserInfo()
{
DBTool db = new DBTool(Table.PersonSet);
db.Where = PersonSet.ID_.Equals_(Request["PrimaryKey"]);
var ID = Request["ID"];
var UserName = Request["UserName"];
var Sex = Request["Sex"];
var Age = Request["Age"];
var IsBeiJing = Request["IsBeiJing"];
var AgePeriod = Request["AgePeriod"];
var otherData = Request["otherData"];
var PrimaryKey = Request["PrimaryKey"];
db.SetUpdateField(PersonSet.UserName_, UserName);
db.SetUpdateField(PersonSet.Sex_, Sex);
db.SetUpdateField(PersonSet.Age_, Age);
db.SetUpdateField(PersonSet.IsBeiJing_, IsBeiJing);
db.SetUpdateField(PersonSet.AgePeriod_, AgePeriod);
db.SaveChanges();
ReturnTextString(PrimaryKey);
}
[Log()]
public static void GetUserInfo(){
DBTool db = new DBTool(PersonSet.TableName_Qin);
db.Where = PersonSet.ID_.Equals_(1);
var user = db.GetEntity<PersonSet>();
ReturnJSONString(user);
}
}
}
脚本引擎代码生成
少侠,我看你气度不凡天赋异禀,骨骼精奇,这么帅,来了就帮推荐一把吧
我的最近更新