| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- using Castle.ActiveRecord;
- using NHibernate.Criterion;
- using System;
- using System.Text;
- namespace BizCom
- {
- [ActiveRecord("CE_ErpCustomer")]
- public class CeErpCustomer : ComBase<CeErpCustomer>
- {
- /// <summary>
- ///
- /// </summary>
- [PrimaryKey(PrimaryKeyType.Native)]
- public int ID { get; set; }
- private string _buyer_nick = "";
- /// <summary>
- ///买家昵称
- /// </summary>
- [Property]
- public string buyer_nick
- {
- get { return _buyer_nick; }
- set { _buyer_nick = value; }
- }
- private string _star_flag = "";
- /// <summary>
- ///星标
- /// </summary>
- [Property]
- public string star_flag
- {
- get { return _star_flag; }
- set { _star_flag = value; }
- }
- private int _buy_day = 0;
- /// <summary>
- ///
- /// </summary>
- [Property]
- public int buy_day
- {
- get { return _buy_day; }
- set { _buy_day = value; }
- }
- private string _phone = "";
- /// <summary>
- ///电话
- /// </summary>
- [Property]
- public string phone
- {
- get { return _phone; }
- set { _phone = value; }
- }
- private string _address = "";
- /// <summary>
- ///地址
- /// </summary>
- [Property]
- public string address
- {
- get { return _address; }
- set { _address = value; }
- }
- private double _total_fee = 0;
- /// <summary>
- ///总金额
- /// </summary>
- [Property]
- public double total_fee
- {
- get { return _total_fee; }
- set { _total_fee = value; }
- }
- private int _buy_count = 0;
- /// <summary>
- ///购买次数
- /// </summary>
- [Property]
- public int buy_count
- {
- get { return _buy_count; }
- set { _buy_count = value; }
- }
- /// <summary>
- ///最后购买时间
- /// </summary>
- [Property]
- public DateTime? lastbuy_time { get; set; }
- private string _seller_nick = "";
- /// <summary>
- ///
- /// </summary>
- [Property]
- public string seller_nick
- {
- get { return _seller_nick; }
- set { _seller_nick = value; }
- }
- private int _product_count = 0;
- /// <summary>
- ///
- /// </summary>
- [Property]
- public int product_count
- {
- get { return _product_count; }
- set { _product_count = value; }
- }
- private string _lastTid = "";
- /// <summary>
- ///上次购买订单号
- /// </summary>
- [Property]
- public string lastTid
- {
- get { return _lastTid; }
- set { _lastTid = value; }
- }
- private int _isMore = 0;
- /// <summary>
- ///是否比上次买更多
- /// </summary>
- [Property]
- public int isMore
- {
- get { return _isMore; }
- set { _isMore = value; }
- }
- private string _lastTid2 = "";
- /// <summary>
- ///
- /// </summary>
- [Property]
- public string lastTid2
- {
- get { return _lastTid2; }
- set { _lastTid2 = value; }
- }
- private string _buyer_id = "";
- /// <summary>
- ///客户id
- /// </summary>
- [Property]
- public string buyer_id
- {
- get { return _buyer_id; }
- set { _buyer_id = value; }
- }
- /// <summary>
- ///
- /// </summary>
- [Property]
- public DateTime? lastbuy_time2 { get; set; }
- public static CeErpCustomer GetByNick(string nick)
- {
- return FindFirst(Expression.Eq("buyer_nick", nick));
- }
- public static CeErpCustomer GetByNickAndShop(string nick, string shopname)
- {
- return FindFirst(Expression.Sql(string.Format("(buyer_nick='{0}' and seller_nick='{1}')", nick, shopname)));
- }
- public static CeErpCustomer GetByIdAndShop(string id, string shopname)
- {
- return FindFirst(Expression.Sql(string.Format("(buyer_id='{0}' and seller_nick='{1}')", id, shopname)));
- }
- public static void Del(object id)
- {
- StringBuilder sql = new StringBuilder();
- sql.AppendFormat("delete from CE_ErpCustomer where id=" + id);
- ExecuteNonQuery(sql.ToString());
- }
- }
- }
|