大家看了架构后,有什么Question建议,请回复.我好修改修改一下
注:要使用生器,则必须安装Codesmith3.2,因为我的生成器里使用了Codesmith的Schema.
由于这是Bata版,对数据库的设计有一点要求,详细请看文档
如果要转载,请注明出入
使用说明:
在SRC.rar里面
com.Robert.AccountTestFramework是由代码生成的工程,
数据库在 sql.sql,新建一个数据库后运行两次sql.sql(第一次会报错)就行了。
数据库联接不在Web.Config里,而是写在com.Robert.AccountTestFramework\ConnectionHelper\ConnectionHelper.cs
的GetConnectionString()函数里
生成器(更新)
生成器说明文档
文档
如果有什么建议,请到 http://vcsproject.com/forums/3/ShowForum.aspx
如果要获取更多的信息,请到 http://vcsproject.com/forums/3/ShowForum.aspx
下面是代码的剪辑:
1
2using System;
3using System.Data;
4using com.Robert.Framework;
5
6
7namespace com.EBiz
8{
9 /**//// <summary>
10 ///
11 /// </summary>
12 [Serializable]
13 public partial class COMM_User
14 {
15
16 public COMM_User()
17 {
18 this._data = new COMM_UserData();
19
20 this.UserID = Guid.NewGuid();
21
22 }
23
24 public COMM_User(Guid ID)
25 {
26 this._data = new COMM_UserManager().GetCOMM_UserByID(ID)._data;
27 }
28
29
30 Property#region Property
31
32
33
34 public virtual MyGuid UserID
35 {
36 get { return ((COMM_UserData) this.ObjectData).UserID; }
37 set {((COMM_UserData) this.ObjectData).UserID=value;}
38 }
39
40 public virtual MyGuid OldUserID
41 {
42 get { return ((COMM_UserData) this.ObjectData).OldUserID; }
43 }
44
45
46
47 public virtual string UserName
48 {
49 get { return ((COMM_UserData) this.ObjectData).UserName; }
50 set {((COMM_UserData) this.ObjectData).UserName=value;}
51 }
52
53 public virtual string OldUserName
54 {
55 get { return ((COMM_UserData) this.ObjectData).OldUserName; }
56 }
57
58
59
60 public virtual string Password
61 {
62 get { return ((COMM_UserData) this.ObjectData).Password; }
63 set {((COMM_UserData) this.ObjectData).Password=value;}
64 }
65
66 public virtual string OldPassword
67 {
68 get { return ((COMM_UserData) this.ObjectData).OldPassword; }
69 }
70
71
72
73 public virtual MyInt PermissionTypeCode
74 {
75 get { return ((COMM_UserData) this.ObjectData).PermissionTypeCode; }
76 set {((COMM_UserData) this.ObjectData).PermissionTypeCode=value;}
77 }
78
79 public virtual MyInt OldPermissionTypeCode
80 {
81 get { return ((COMM_UserData) this.ObjectData).OldPermissionTypeCode; }
82 }
83
84
85
86 List#region List
87 #endregion
88
89 object info#region object info
90 #endregion
91
92 #endregion
93
94
95 Operation#region Operation
96
97 public virtual COMM_User Clone()
98 {
99 COMM_User m_obj = new COMM_User();
100 m_obj._data = this.ObjectData.Clone();
101 return m_obj;
102 }
103
104 protected override BaseProfile GetProfile()
105 {
106 return new COMM_UserProfile(this);
107 }
108
109
110 #endregion
111
112 public override bool Equals(object obj)
113 {
114 if (obj is COMM_User)
115 {
116 return this.UserID == ((COMM_User)obj).UserID;
117 }
118 else
119 {
120 return base.Equals(obj);
121 }
122 }
123 public override int GetHashCode()
124 {
125 return base.GetHashCode();
126 }
127
128 }
129}
130
使用的代码剪辑:
新增,修改
1
/**/
/// </summary>
2 private void SaveData()
3 {
4 com.EBiz.COMM_User m_obj;
5
6 if (this.ObjectID == Guid.Empty)
7 {
8 //新增,不用ID去构造
9 m_obj = new com.EBiz.COMM_User();
10 }
11 else
12 {
13 //修改
14 m_obj = new com.EBiz.COMM_User(this.ObjectID);
15 }
16 m_obj.UserName = this.txtUserNo.Text;
17 m_obj.Password = this.txtPwd.Text;
18 m_obj.PermissionTypeCode = this.ddlUserType.SelectedValue;
19 m_obj.Save();
20 }
2 private void SaveData()
3 {
4 com.EBiz.COMM_User m_obj;
5
6 if (this.ObjectID == Guid.Empty)
7 {
8 //新增,不用ID去构造
9 m_obj = new com.EBiz.COMM_User();
10 }
11 else
12 {
13 //修改
14 m_obj = new com.EBiz.COMM_User(this.ObjectID);
15 }
16 m_obj.UserName = this.txtUserNo.Text;
17 m_obj.Password = this.txtPwd.Text;
18 m_obj.PermissionTypeCode = this.ddlUserType.SelectedValue;
19 m_obj.Save();
20 }