using System; using System.Text.RegularExpressions; using System.Data; using BP.DA; using BP.En; using BP.Sys; namespace BP.Cloud { /// /// 操作员 属性 /// public class GuestAttr : BP.En.EntityNoNameAttr { #region 基本属性 /// /// 电话 /// public const string Tel = "Tel"; /// /// 密码 /// public const string Password = "Password"; /// /// 邮箱 /// public const string Email = "Email"; /// /// 拼音 /// public const string PinYin = "PinYin"; /// /// Addr /// public const string Addr = "Addr"; /// /// QQ号 /// public const string QQ = "QQ"; /// /// 组织结构编码 /// public const string OrgNo = "OrgNo"; #endregion } /// /// 操作员 的摘要说明。 /// public class Guest : EntityNoName { #region 扩展属性 /// /// 密码 /// public string Password { get { return this.GetValStrByKey(GuestAttr.Password); } set { this.SetValByKey(GuestAttr.Password, value); } } /// /// 电话 /// public string Tel { get { return this.GetValStrByKey(GuestAttr.Tel); } set { this.SetValByKey(GuestAttr.Tel, value); } } public string Email { get { return this.GetValStrByKey(GuestAttr.Email); } set { this.SetValByKey(GuestAttr.Email, value); } } public string QQ { get { return this.GetValStrByKey(GuestAttr.QQ); } set { this.SetValByKey(GuestAttr.QQ, value); } } public string Addr { get { return this.GetValStringByKey(GuestAttr.Addr); } set { this.SetValByKey(GuestAttr.Addr, value); } } /// /// 组织结构编码 /// public string OrgNo { get { return this.GetValStrByKey(GuestAttr.OrgNo); } set { this.SetValByKey(GuestAttr.OrgNo, value); } } #endregion #region 公共方法 #endregion 公共方法 #region 构造函数 /// /// 操作员 /// public Guest() { } /// /// 操作员 /// /// 编号 public Guest(string no) { this.No = no; this.Retrieve(); } public override UAC HisUAC { get { UAC uac = new UAC(); if (BP.Web.WebUser.IsAdmin == true) uac.OpenAll(); else uac.Readonly(); return uac; } } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Port_Guest", "用户"); map.setEnType(EnType.App); #region 字段 /*关于字段属性的增加 */ map.AddTBStringPK(GuestAttr.No, null, "身份ID", true, false, 1, 500, 90); map.AddTBString(GuestAttr.Name, null, "姓名", true, false, 0, 500, 130); map.AddTBString(GuestAttr.Tel, null, "电话", true, false, 0, 20, 130); map.AddTBString(GuestAttr.Password, null, "密码", true, false, 0, 20, 130); map.AddTBString(GuestAttr.Email, null, "邮箱", true, false, 0, 100, 132, true); map.AddTBString(GuestAttr.PinYin, null, "拼音", true, false, 0, 1000, 132, true); map.AddTBString(GuestAttr.QQ, null, "QQ", true, false, 0, 500, 132, true); map.AddTBString(GuestAttr.Addr, null, "Addr", true, false, 0, 500, 132, true); map.AddTBString(GuestAttr.OrgNo, null, "OrgNo", false, false, 0, 50, 36); #endregion 字段 this._enMap = map; return this._enMap; } } protected override bool beforeInsert() { return base.beforeInsert(); } /// /// 删除之后要做的事情 /// protected override void afterDelete() { base.afterDelete(); } /// /// 获取集合 /// public override Entities GetNewEntities { get { return new Guests(); } } #endregion 构造函数 } /// /// 操作员s // public class Guests : EntitiesNoName { #region 构造方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new Guest(); } } /// /// 操作员s /// public Guests() { } #endregion 构造方法 #region 为了适应自动翻译成java的需要,把实体转换成List. /// /// 转化成 java list,C#不能调用. /// /// List public System.Collections.Generic.IList ToJavaList() { return (System.Collections.Generic.IList)this; } /// /// 转化成list /// /// List public System.Collections.Generic.List Tolist() { System.Collections.Generic.List list = new System.Collections.Generic.List(); for (int i = 0; i < this.Count; i++) { list.Add((Guest)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }