You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
3.6 KiB
C#

11 months ago
using System;
using System.Data;
using BP.DA;
using BP.En;
using BP.Port;
namespace BP.Demo
{
/// <summary>
/// <20><>Ʒ <20><><EFBFBD><EFBFBD>
/// </summary>
public class ProductAttr : EntityNoNameAttr
{
#region <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// <summary>
/// <20>Ա<EFBFBD>
/// </summary>
public const string GuiGe = "GuiGe";
public const string BeiZhu = "BeiZhu";
#endregion
}
/// <summary>
/// <20><>Ʒ
/// </summary>
public class Product : BP.En.EntityNoName
{
#region <20><><EFBFBD><EFBFBD><ECBAAF>
/// <summary>
/// ʵ<><CAB5><EFBFBD><EFBFBD>Ȩ<EFBFBD>޿<EFBFBD><DEBF><EFBFBD>
/// </summary>
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
// uac.LoadRightFromCCGPM(this); //<2F><>GPM<50><4D><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>.
// return uac;
if (BP.Web.WebUser.No.Equals("admin")==true)
{
uac.IsDelete = true;
uac.IsUpdate = true;
uac.IsInsert = true;
uac.IsView = true;
}
else
{
uac.IsView = true;
}
uac.IsImp = true;
return uac;
}
}
/// <summary>
/// <20><>Ʒ
/// </summary>
public Product()
{
}
/// <summary>
/// <20><>Ʒ
/// </summary>
/// <param name="no"></param>
public Product(string no)
: base(no)
{
}
#endregion
#region <20><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><E0B7BD>
/// <summary>
/// <20><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><E0B7BD>
/// </summary>
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("Demo_Product", "<22><>Ʒ");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ.
map.ItIsAllowRepeatName = true; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>.
map.ItIsAutoGenerNo = true; //<2F>Ƿ<EFBFBD><C7B7>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD>.
map.CodeStruct = "4"; // 4λ<34><CEBB><EFBFBD>ı<EFBFBD><C4B1>ţ<EFBFBD><C5A3><EFBFBD> 0001 <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> 9999.
#region <20>ֶ<EFBFBD>ӳ<EFBFBD><D3B3> - <20><>ͨ<EFBFBD>ֶ<EFBFBD>.
map.AddTBStringPK(ProductAttr.No, null, "<22><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>", true, true, 4, 4, 90); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶα<D6B6><CEB1><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>.
map.AddTBString(ProductAttr.Name, null, "<22><><EFBFBD><EFBFBD>", true, false, 0, 200, 70);
map.AddTBString(ProductAttr.GuiGe, null, "<22><><EFBFBD><EFBFBD>", true, false, 0, 200, 100, true);
map.AddTBStringDoc(ResumeAttr.BeiZhu, null, "<22><>ע", true, false);
map.AddTBAtParas(2000);
#endregion <20>ֶ<EFBFBD>ӳ<EFBFBD><D3B3> - <20><>ͨ<EFBFBD>ֶ<EFBFBD>.
this._enMap = map;
return this._enMap;
}
}
#endregion <20><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><E0B7BD>
protected override bool beforeDelete()
{
return base.beforeDelete();
}
}
/// <summary>
/// <20><>Ʒs
/// </summary>
public class Products : BP.En.EntitiesNoName
{
#region <20><><EFBFBD><EFBFBD>
/// <summary>
/// <20><>Ʒs
/// </summary>
public Products() { }
#endregion
#region <20><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><E0B7BD>
/// <summary>
/// <20>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD> Entity
/// </summary>
public override Entity GetNewEntity
{
get
{
return new Product();
}
}
#endregion <20><>д<EFBFBD><D0B4><EFBFBD><EFBFBD><E0B7BD>
#region <20><><EFBFBD>Է<EFBFBD><D4B7><EFBFBD>.
public string EnsMothed()
{
return "EnsMothed@ִ<>гɹ<D0B3>.";
}
public string EnsMothedParas(string para1, string para2)
{
return "EnsMothedParas@ִ<>гɹ<D0B3>." + para1 + " - " + para2;
}
#endregion
}
}