using System;
using System.Data;
using BP.DA;
using BP.En;
namespace BP.Demo
{
///
/// 学生科目对应 -属性
///
public class StudentKeMuAttr
{
#region 基本属性
///
/// 学生
///
public const string FK_Student="FK_Student";
///
/// 科目
///
public const string FK_KeMu="FK_KeMu";
#endregion
}
///
/// 学生科目对应
///
public class StudentKeMu :EntityMM
{
#region 基本属性
///
/// 学生
///
public string FK_Student
{
get
{
return this.GetValStringByKey(StudentKeMuAttr.FK_Student);
}
set
{
SetValByKey(StudentKeMuAttr.FK_Student,value);
}
}
///
/// 科目名称
///
public string FK_KeMuT
{
get
{
return this.GetValRefTextByKey(StudentKeMuAttr.FK_KeMu);
}
}
///
///科目
///
public string FK_KeMu
{
get
{
return this.GetValStringByKey(StudentKeMuAttr.FK_KeMu);
}
set
{
SetValByKey(StudentKeMuAttr.FK_KeMu,value);
}
}
#endregion
#region 构造函数
///
/// 学生科目对应
///
public StudentKeMu(){}
///
/// 工作学生科目对应
///
/// 学生
/// 科目编号
public StudentKeMu(string fk_student,string fk_km)
{
this.FK_Student = fk_student;
this.FK_KeMu = fk_km;
this.Retrieve();
}
///
/// 重写基类方法
///
public override Map EnMap
{
get
{
if (this._enMap!=null)
return this._enMap;
Map map = new Map("Demo_StudentKeMu", "学生科目对应");
map.EnType=EnType.Dot2Dot;
map.AddTBStringPK(StudentKeMuAttr.FK_Student, null, "学生", false, false, 1, 20, 1);
map.AddDDLEntitiesPK(StudentKeMuAttr.FK_KeMu,null,"科目",new BP.Demo.KeMus(),true);
this._enMap=map;
return this._enMap;
}
}
#endregion
#region 重载基类方法
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
//if (BP.Web.WebUser.No.Equals("admin")==true)
//{
uac.IsView = true;
uac.IsDelete = true;
uac.IsInsert = true;
uac.IsUpdate = true;
uac.IsAdjunct = true;
// }
return uac;
}
}
///
/// 插入前所做的工作
///
/// true/false
protected override bool beforeInsert()
{
return base.beforeInsert();
}
///
/// 更新前所做的工作
///
/// true/false
protected override bool beforeUpdate()
{
return base.beforeUpdate();
}
///
/// 删除前所做的工作
///
/// true/false
protected override bool beforeDelete()
{
return base.beforeDelete();
}
#endregion
}
///
/// 学生科目对应s -集合
///
public class StudentKeMus : EntitiesMM
{
#region 构造
///
/// 学生科目对应s
///
public StudentKeMus(){}
#endregion
#region 重写方法
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new StudentKeMu();
}
}
#endregion
}
}