Beispiel #1
0
        private void findCard(String no)
        {
            this.card        = cardBll.GetMemberCardByNo(no);
            this.card.Record = this.card != null?recordBll.GetMemberCardRecordByMemberCardId(this.card.Id) : null;

            this.card.Category = catBll.GetMemberCardCategoryById(this.card.CategoryId);

            String msg = null;

            if (this.card == null)
            {
                msg = "此卡不存在!";
            }
            else if (this.card.Record == null)
            {
                msg = "此卡未开户,请先开卡!";
            }

            if (!String.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            this.labNo.Text          = this.card.CardNo.Trim();
            this.labBalance.Text     = this.card.Record.Balance.ToString();
            this.labCategory.Text    = this.card.Category.Name.Trim();
            this.labExpirt.Text      = this.card.Record.ExpiredAt.ToString();
            this.btnRecovery.Enabled = true;
        }
Beispiel #2
0
        private void findCard(String no)
        {
            this.card = cardBll.GetMemberCardByNo(no);
            if (this.card != null)
            {
                this.card.Record = recordBll.GetMemberCardRecordByMemberCardId(this.card.Id);
            }

            String msg = null;

            if (this.card == null)
            {
                msg = "此卡不存在!";
            }
            else if (this.card.Record == null)
            {
                msg = "此卡未开户,请先开卡!";
            }

            if (!String.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            this.labExpireDate.Text = TimeStamp.ConvertIntDateTime(this.card.Record.ExpiredAt).ToString("yyyy-MM-dd");
            this.btnSubmit.Enabled  = true;

            this.labValidTime.Visible = false;
            this.validTime.Visible    = true;
        }
Beispiel #3
0
        private void findCard(String no)
        {
            this.card        = cardBll.GetMemberCardByNo(no);
            this.card.Record = this.card != null?recordBll.GetMemberCardRecordByMemberCardId(this.card.Id) : null;

            String msg = null;

            if (this.card == null)
            {
                msg = "此卡不存在!";
            }
            else if (this.card.Record == null)
            {
                msg = "此卡未开户,请先开卡!";
            }

            if (!String.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            this.card.Record.Status = Status.Disabled;
            if (this.recordBll.EditMemberCardRecord(this.card.Record))
            {
                MessageBox.Show("卡片已收回!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("卡片已收回失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 根据会员卡号获取会员卡信息
        /// </summary>
        /// <param name="no">卡号</param>
        /// <returns></returns>
        private Models.MemberCard getMemberCard(String no)
        {
            if (String.IsNullOrEmpty(no))
            {
                MessageBox.Show("请先输入卡号", "数据不完整", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }

            Models.MemberCard card = null;
            try
            {
                card = bll.GetMemberCardByNo(no);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "数据库不可用", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(card);
        }
Beispiel #5
0
        private void findCard(String no)
        {
            this.card = cardBll.GetMemberCardByNo(no);
            if (this.card != null)
            {
                this.card.Record   = recordBll.GetMemberCardRecordByMemberCardId(this.card.Id);
                this.card.Category = catBll.GetMemberCardCategoryById(this.card.CategoryId);
            }


            String msg = null;

            if (this.card == null)
            {
                msg = "此卡不存在!";
            }

            if (!String.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (this.card.Record == null || this.card.Record.Status == Status.Disabled)
            {
                DialogResult result = MessageBox.Show("此卡未开户,是否开卡?", "温馨提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.No)
                {
                    return;
                }

                this.card.Record = new MemberCardRecord();
                this.card.Record.MemberCardId = this.card.Id;
                this.card.Record.CreatedAt    = TimeStamp.GetNowTimeStamp();
            }

            this.labMemberCardCategory.Text = this.card.Category.Name;
            this.labMoney.Text     = String.Format("帐户剩余次数:{0}次", Convert.ToInt32(this.card.Record.Balance));
            this.btnSubmit.Enabled = true;
        }
Beispiel #6
0
        /// <summary>
        /// 查找会员卡信息
        /// </summary>
        /// <param name="no"></param>
        private void FindMemberCard(String no)
        {
            this.initUI();

            String audioKey = null;
            String msg      = "";


            this.card = cardBll.GetMemberCardByNo(no);
            if (this.card != null)
            {
                this.card.Category = catBll.GetMemberCardCategoryById(this.card.CategoryId);
                this.card.Record   = recordBll.GetMemberCardRecordByMemberCardId(this.card.Id);
                this.fullCardInfo();
            }


            //判断会员卡是否存在
            if (card == null)
            {
                msg      = "此卡不存在!";
                audioKey = "AudioCardNotFound";
            }
            else if (card.Record == null)
            {
                msg      = "此卡未开启!";
                audioKey = "AudioCardNotAvailable";
            }
            else if (card.Record.Status == Status.Disabled)
            {
                msg      = "此卡已回收,请重新开卡后使用!";
                audioKey = "AudioCardStatusInvalid";
            }
            else if (card.Record.Balance <= 0)
            {
                msg      = "此卡次数不足,请充值后再试!";
                audioKey = "AudioCardArrearage";
            }
            else if (card.Record.ExpiredAt < TimeStamp.GetNowTimeStamp())
            {
                msg      = "此卡已过期!";
                audioKey = "AudioCardExpired";
            }
            else if (!card.Category.isDateAllow() || !card.Category.isTimeAllow())
            {
                msg      = "此卡不在可用时间段!";
                audioKey = "AudioCardTimeInvalid";
            }

            if (!String.IsNullOrEmpty(msg))
            {
                this.setLabelStatus(msg, Color.Red, audioKey);
                return;
            }

            this.setLabelStatus("此卡可以使用", Color.Green);
            this.numValue.Enabled  = true;
            this.btnSubmit.Enabled = true;
            this.numValue.Maximum  = card.Record.Balance;

            if (!this.ckbAuto.Checked)
            {
                return;
            }

            this.AddRecord();
        }