Beispiel #1
0
        public Tb_Wx_Ucard GetCard(string cardid, string code)
        {
            var    edc       = new Tb_Wx_Ucard(this.DataSource);
            string condition = string.Format(" card_id='{0}' and card_code='{1}'", cardid, code);
            var    card      = edc.FindFirst <Tb_Wx_Ucard>(condition);

            return(card);
        }
Beispiel #2
0
        public Tb_Wx_Ucard GetCard(string openid, string appid, string mch_id)
        {
            var    edc       = new Tb_Wx_Ucard(this.DataSource);
            string condition = string.Format("openid='{0}' and appid='{1}'", openid, appid);

            condition += string.Format(" and mch_id='{0}'", mch_id);
            var card = edc.FindFirst <Tb_Wx_Ucard>(condition);

            if (card == null)
            {
                card             = new Tb_Wx_Ucard(this.DataSource);
                card.Id          = edc.Create();
                card.Openid      = openid;
                card.Appid       = appid;
                card.MchId       = mch_id;
                card.OperateTime = DateTime.Now;
                card.Store();
            }
            return(card);
        }