using Castle.ActiveRecord; using System; using System.Text; namespace BizCom { [ActiveRecord("CE_ErpUserInfo")] public class CeErpUserInfo : ComBase { /// /// /// [PrimaryKey(PrimaryKeyType.Native)] public int ID { get; set; } private string _nickName = ""; /// /// /// [Property] public string NickName { get { return _nickName; } set { _nickName = value; } } private string _picture = ""; /// /// /// [Property] public string Picture { get { return _picture; } set { _picture = value; } } private string _sex = ""; /// /// /// [Property] public string Sex { get { return _sex; } set { _sex = value; } } private string _mobile = ""; /// /// /// [Property] public string Mobile { get { return _mobile; } set { _mobile = value; } } private string _mobile2 = ""; /// /// /// [Property] public string Mobile2 { get { return _mobile2; } set { _mobile2 = value; } } private string _phone = ""; /// /// /// [Property] public string Phone { get { return _phone; } set { _phone = value; } } private string _email = ""; /// /// /// [Property] public string Email { get { return _email; } set { _email = value; } } private string _carNumber = ""; /// /// /// [Property] public string CarNumber { get { return _carNumber; } set { _carNumber = value; } } private string _identityCard = ""; /// /// /// [Property] public string IdentityCard { get { return _identityCard; } set { _identityCard = value; } } private string _party = ""; /// /// /// [Property] public string Party { get { return _party; } set { _party = value; } } private string _address = ""; /// /// /// [Property] public string Address { get { return _address; } set { _address = value; } } /// /// /// [Property] public DateTime? BirthDay { get; set; } /// /// /// [Property] public DateTime? EnterTime { get; set; } /// /// /// [Property] public DateTime? LeaveTime { get; set; } private bool _isDel = false; /// /// /// [Property] public bool isDel { get { return _isDel; } set { _isDel = value; } } private int _state = 0; /// /// /// [Property] public int State { get { return _state; } set { _state = value; } } private string _tb = ""; /// /// /// [Property] public string Tb { get { return _tb; } set { _tb = value; } } private string _pdd = ""; /// /// /// [Property] public string Pdd { get { return _pdd; } set { _pdd = value; } } private string _jd = ""; /// /// /// [Property] public string Jd { get { return _jd; } set { _jd = value; } } private string _ali = ""; /// /// /// [Property] public string Ali { get { return _ali; } set { _ali = value; } } private string _ding = ""; /// /// /// [Property] public string Ding { get { return _ding; } set { _ding = value; } } private int _onDuty = 0; /// ///是否在岗 /// [Property] public int OnDuty { get { return _onDuty; } set { _onDuty = value; } } private int _dayOrderReceive = 0; /// ///日接单数量 /// [Property] public int DayOrderReceive { get { return _dayOrderReceive; } set { _dayOrderReceive = value; } } private double _dayOrderPer = 0; /// ///日可接单比例 /// [Property] public double DayOrderPer { get { return _dayOrderPer; } set { _dayOrderPer = value; } } private int _beOnDuty = 0; /// ///是否值班 /// [Property] public int BeOnDuty { get { return _beOnDuty; } set { _beOnDuty = value; } } private int _noFinish = 0; /// ///抢单未定稿数量 /// [Property] public int NoFinish { get { return _noFinish; } set { _noFinish = value; } } private int _total = 0; /// ///一次性抢单数量 /// [Property] public int Total { get { return _total; } set { _total = value; } } private int _finalization = 0; /// ///抢单定稿率限制 /// [Property] public int Finalization { get { return _finalization; } set { _finalization = value; } } public static int Del(object id, string code) { StringBuilder str = new StringBuilder(); str.AppendFormat("update ce_erpuser set state=1 where personid={0} ;", id); str.AppendFormat("update ce_erpuserinfo set isdel=1 where id={0} and code={1} ;", id, code); return ExecuteNonQuery(str.ToString()); } public static int RealDel(object id) { StringBuilder str = new StringBuilder(); str.AppendFormat("delete from ce_erppersonpost where PersonID={0} ;", id); str.AppendFormat("delete from ce_erpuser where personid={0} ;", id); str.AppendFormat("delete from ce_erpperson where id={0} ;", id); return ExecuteNonQuery(str.ToString()); } public static void OpenAccount(object pId, string pwd) { StringBuilder str = new StringBuilder(); str.AppendFormat("update ce_erpuserinfo set isopen=1 where id={0} ;", pId); str.AppendFormat("if (select count(0) from ce_erpuser where PersonID={0})<1 ", pId); str.AppendFormat(" begin "); str.AppendFormat("insert into ce_erpuser(personid,account,password,createtime) select ID,Code,'{1}',getdate() from ce_erpperson where ID={0} ;", pId, pwd); str.AppendFormat(" end "); str.AppendFormat(" else "); str.AppendFormat(" begin "); str.AppendFormat("update ce_erpuser set state=0 where personID={0} ;", pId); str.AppendFormat(" end "); TransExecuteNonQuery(str.ToString()); } public static void FreezeAccount(object pId) { StringBuilder str = new StringBuilder(); str.AppendFormat("update ce_erpuserinfo set isopen=0 where id={0} ;", pId); str.AppendFormat("update ce_erpuser set state=1 where personid={0} ;", pId); DbConn.ExecuteNonQuery(str.ToString()); } } }