📄 dsuser.cs
字号:
public event tblRoleRowChangeEventHandler tblRoleRowChanging;
public event tblRoleRowChangeEventHandler tblRoleRowDeleted;
public event tblRoleRowChangeEventHandler tblRoleRowDeleting;
public void AddtblRoleRow(tblRoleRow row) {
this.Rows.Add(row);
}
public tblRoleRow AddtblRoleRow(string RoleName, string UserName, string Email, int ID) {
tblRoleRow rowtblRoleRow = ((tblRoleRow)(this.NewRow()));
rowtblRoleRow.ItemArray = new object[] {
RoleName,
UserName,
Email,
ID,
null};
this.Rows.Add(rowtblRoleRow);
return rowtblRoleRow;
}
public tblRoleRow FindByIDUserId(int ID, int UserId) {
return ((tblRoleRow)(this.Rows.Find(new object[] {
ID,
UserId})));
}
public System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
public override DataTable Clone() {
tblRoleDataTable cln = ((tblRoleDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
protected override DataTable CreateInstance() {
return new tblRoleDataTable();
}
internal void InitVars() {
this.columnRoleName = this.Columns["RoleName"];
this.columnUserName = this.Columns["UserName"];
this.columnEmail = this.Columns["Email"];
this.columnID = this.Columns["ID"];
this.columnUserId = this.Columns["UserId"];
}
private void InitClass() {
this.columnRoleName = new DataColumn("RoleName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnRoleName);
this.columnUserName = new DataColumn("UserName", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnUserName);
this.columnEmail = new DataColumn("Email", typeof(string), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnEmail);
this.columnID = new DataColumn("ID", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnID);
this.columnUserId = new DataColumn("UserId", typeof(int), null, System.Data.MappingType.Element);
this.Columns.Add(this.columnUserId);
this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
this.columnID,
this.columnUserId}, true));
this.columnUserName.AllowDBNull = false;
this.columnEmail.AllowDBNull = false;
this.columnID.AllowDBNull = false;
this.columnUserId.AutoIncrement = true;
this.columnUserId.AllowDBNull = false;
this.columnUserId.ReadOnly = true;
}
public tblRoleRow NewtblRoleRow() {
return ((tblRoleRow)(this.NewRow()));
}
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
return new tblRoleRow(builder);
}
protected override System.Type GetRowType() {
return typeof(tblRoleRow);
}
protected override void OnRowChanged(DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.tblRoleRowChanged != null)) {
this.tblRoleRowChanged(this, new tblRoleRowChangeEvent(((tblRoleRow)(e.Row)), e.Action));
}
}
protected override void OnRowChanging(DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.tblRoleRowChanging != null)) {
this.tblRoleRowChanging(this, new tblRoleRowChangeEvent(((tblRoleRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleted(DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.tblRoleRowDeleted != null)) {
this.tblRoleRowDeleted(this, new tblRoleRowChangeEvent(((tblRoleRow)(e.Row)), e.Action));
}
}
protected override void OnRowDeleting(DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.tblRoleRowDeleting != null)) {
this.tblRoleRowDeleting(this, new tblRoleRowChangeEvent(((tblRoleRow)(e.Row)), e.Action));
}
}
public void RemovetblRoleRow(tblRoleRow row) {
this.Rows.Remove(row);
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class tblRoleRow : DataRow {
private tblRoleDataTable tabletblRole;
internal tblRoleRow(DataRowBuilder rb) :
base(rb) {
this.tabletblRole = ((tblRoleDataTable)(this.Table));
}
public string RoleName {
get {
try {
return ((string)(this[this.tabletblRole.RoleNameColumn]));
}
catch (InvalidCastException e) {
throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
}
}
set {
this[this.tabletblRole.RoleNameColumn] = value;
}
}
public string UserName {
get {
return ((string)(this[this.tabletblRole.UserNameColumn]));
}
set {
this[this.tabletblRole.UserNameColumn] = value;
}
}
public string Email {
get {
return ((string)(this[this.tabletblRole.EmailColumn]));
}
set {
this[this.tabletblRole.EmailColumn] = value;
}
}
public int ID {
get {
return ((int)(this[this.tabletblRole.IDColumn]));
}
set {
this[this.tabletblRole.IDColumn] = value;
}
}
public int UserId {
get {
return ((int)(this[this.tabletblRole.UserIdColumn]));
}
set {
this[this.tabletblRole.UserIdColumn] = value;
}
}
public bool IsRoleNameNull() {
return this.IsNull(this.tabletblRole.RoleNameColumn);
}
public void SetRoleNameNull() {
this[this.tabletblRole.RoleNameColumn] = System.Convert.DBNull;
}
}
[System.Diagnostics.DebuggerStepThrough()]
public class tblRoleRowChangeEvent : EventArgs {
private tblRoleRow eventRow;
private DataRowAction eventAction;
public tblRoleRowChangeEvent(tblRoleRow row, DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
public tblRoleRow Row {
get {
return this.eventRow;
}
}
public DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -