using Castle.ActiveRecord; using NHibernate.Criterion; using System.Text; namespace BizCom { [ActiveRecord("CE_ErpProductPrice")] public class CeErpProductPrice : ComBase { /// /// /// [PrimaryKey(PrimaryKeyType.Native)] public int ID { get; set; } private int _pClass = 0; /// ///产品类别: 1设计 2现货 3电子稿 /// [Property] public int pClass { get { return _pClass; } set { _pClass = value; } } private string _pClassText = ""; /// ///产品类别 /// [Property] public string pClassText { get { return _pClassText; } set { _pClassText = value; } } private int _pType = 0; /// ///产品类型 /// [Property] public int pType { get { return _pType; } set { _pType = value; } } private string _pTypeText = ""; /// ///产品类型 /// [Property] public string pTypeText { get { return _pTypeText; } set { _pTypeText = value; } } private double _ws = 0; /// ///卡片位数 /// [Property] public double ws { get { return _ws; } set { _ws = value; } } private string _pMaterial = ""; /// ///材质 /// [Property] public string pMaterial { get { return _pMaterial; } set { _pMaterial = value; } } private double _modifyPrice = 0; /// ///改稿费 /// [Property] public double modifyPrice { get { return _modifyPrice; } set { _modifyPrice = value; } } private double _designPrice = 0; /// ///设计费 /// [Property] public double designPrice { get { return _designPrice; } set { _designPrice = value; } } public static void Del(object id) { StringBuilder sql = new StringBuilder(); sql.AppendFormat("delete from CE_ErpProductPrice where id=" + id); ExecuteNonQuery(sql.ToString()); } internal static CeErpProductPrice GetByPType(int pid, double ws) { return FindFirst(Expression.Sql(string.Format("pType={0} and ws = {1}", pid, ws))); } internal static CeErpProductPrice GetByPType(int pid, string bz) { return FindFirst(Expression.Sql(string.Format("pType={0} and pMaterial like '%{1}%'", pid, bz))); } } }