using BP.DA; using BP.Web; using BP.En; namespace BP.CCOA { /// /// 日程 属性 /// public class ScheduleAttr : EntityMyPKAttr { /// /// 名称 /// public const string Name = "Name"; /// /// 功能ID /// public const string DTStart = "DTStart"; /// /// 从 /// public const string TimeStart = "TimeStart"; /// /// 功能来源 /// public const string DTEnd = "DTEnd"; /// /// 时间从 /// public const string TimeEnd = "TimeEnd"; /// /// 持续时间 /// public const string ChiXuTime = "ChiXuTime"; /// /// 重复方式 /// public const string Repeats = "Repeats"; /// /// 位置 /// public const string Local = "Local"; /// /// 描述 /// public const string MiaoShu = "MiaoShu"; /// /// 提醒时间 /// public const string DTAlert = "DTAlert"; /// /// 组织编号 /// public const string OrgNo = "OrgNo"; /// /// 记录人 /// public const string Rec = "Rec"; /// /// 记录日期 /// public const string RDT = "RDT"; /// /// 年月. /// public const string NianYue = "NianYue"; } /// /// 日程 /// public class Schedule : EntityMyPK { #region 基本属性 public string NianYue { get { return this.GetValStrByKey(ScheduleAttr.NianYue); } set { this.SetValByKey(ScheduleAttr.NianYue, value); } } /// /// 组织编号 /// public string OrgNo { get { return this.GetValStrByKey(ScheduleAttr.OrgNo); } set { this.SetValByKey(ScheduleAttr.OrgNo, value); } } public string Rec { get { return this.GetValStrByKey(ScheduleAttr.Rec); } set { this.SetValByKey(ScheduleAttr.Rec, value); } } public string RDT { get { return this.GetValStrByKey(ScheduleAttr.RDT); } set { this.SetValByKey(ScheduleAttr.RDT, value); } } #endregion #region 构造方法 /// /// 权限控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); if (WebUser.IsAdmin) { uac.IsUpdate = true; return uac; } return base.HisUAC; } } /// /// 日程 /// public Schedule() { } public Schedule(string mypk) { this.setMyPK(mypk); this.Retrieve(); } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("OA_Schedule", "日程"); map.AddMyPK(); map.AddTBString(ScheduleAttr.Name, null, "标题", true, false, 0, 300, 10, true); map.AddTBDate(ScheduleAttr.DTStart, null, "开始时间", true, false); map.AddTBDate(ScheduleAttr.DTEnd, null, "结束时间", true, false); map.AddTBString(ScheduleAttr.TimeStart, null, "TimeStart", true, false, 0, 10, 10); map.AddTBString(ScheduleAttr.TimeEnd, null, "TimeEnd", true, false, 0, 10, 10); map.AddTBString(ScheduleAttr.ChiXuTime, null, "持续时间", true, false, 0, 10, 10); map.AddTBDateTime(ScheduleAttr.DTAlert, null, "提醒时间", true, false); map.AddDDLSysEnum(ScheduleAttr.Repeats, 0, "重复", true, false, "Repeat", "@0=永不@1=每年@2=每月"); map.AddTBString(ScheduleAttr.Local, null, "位置", true, false, 0, 300, 10, true); map.AddTBString(ScheduleAttr.MiaoShu, null, "描述", true, false, 0, 300, 10, true); map.AddTBString(ScheduleAttr.NianYue, null, "隶属年月", false, false, 0, 10, 10); map.AddTBString(ScheduleAttr.OrgNo, null, "OrgNo", false, false, 0, 100, 10); map.AddTBString(ScheduleAttr.Rec, null, "记录人", false, false, 0, 100, 10, true); map.AddTBDateTime(ScheduleAttr.RDT, null, "记录时间", false, false); //RefMethod rm = new RefMethod(); //rm.Title = "方法参数"; // "设计表单"; //rm.ClassMethodName = this.ToString() + ".DoParas"; //rm.Visable = true; //rm.RefMethodType = RefMethodType.RightFrameOpen; //rm.Target = "_blank"; ////rm.GroupName = "开发接口"; //// map.AddRefMethod(rm); //rm = new RefMethod(); //rm.Title = "方法内容"; // "设计表单"; //rm.ClassMethodName = this.ToString() + ".DoDocs"; //rm.Visable = true; //rm.RefMethodType = RefMethodType.RightFrameOpen; //rm.Target = "_blank"; ////rm.GroupName = "开发接口"; //map.AddRefMethod(rm); this._enMap = map; return this._enMap; } } #endregion #region 执行方法. protected override bool beforeInsert() { this.setMyPK(DBAccess.GenerGUID()); this.Rec = WebUser.No; this.OrgNo = WebUser.OrgNo; this.RDT = DataType.CurrentDateTime; this.NianYue = DataType.CurrentYearMonth; return base.beforeInsert(); } #endregion 执行方法. } /// /// 日程 s /// public class Schedules : EntitiesMyPK { /// /// 查询事件到. /// /// /// /// public string DTFromTo(string dtFrom, string dtTo) { this.RetrieveAll(); return this.ToJson(); } /// /// 日程 /// public Schedules() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new Schedule(); } } #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((Schedule)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }