private void BtnAdd_Click(object sender, EventArgs e)
 {
     if (!CheckParam())
     {
         XtraMessageBox.Show("信息不完整请检查", "提示");
         return;
     }
     if (memberVo == null)
     {
         //添加会员
         List <object> infoList = new List <object>()
         {
             this.textMId.Text, this.textMName.Text, this.comCardLevel.Text, this.textPhone.Text, this.comStatus.Text, Convert.ToDouble(this.textBalance.Text), SystemConst.companyId
         };
         if (ProcedureDao.MemberRegister(infoList) > 0)
         {
             XtraMessageBox.Show("添加会员成功!", "提示");
             EventBus.PublishEvent("AddMemberSuccess");
             EventBus.PublishEvent("MemberRechargeSuccess");
         }
         else
         {
             XtraMessageBox.Show("添加会员失败!", "提示");
             return;
         }
     }
     else
     {
         memberVo.MName     = this.textMName.Text;
         memberVo.MPhone    = this.textPhone.Text;
         memberVo.CardName  = this.comCardLevel.Text;
         memberVo.CompanyId = SystemConst.companyId;
         if (InsertDao.InsertData(memberVo, typeof(MemberInfoVo)) > 0)
         {
             XtraMessageBox.Show("更新会员成功!", "提示");
         }
         else
         {
             XtraMessageBox.Show("更新会员失败!", "提示");
         }
     }
     this.DialogResult = DialogResult.OK;
 }
Beispiel #2
0
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.textEdit1.Text))
            {
                return;
            }
            if (!FilterUtil.isNumberic(this.textEdit1.Text))
            {
                XtraMessageBox.Show("请输入正确的金额!", "提示");
                return;
            }
            double amount    = Convert.ToDouble(this.textEdit1.Text);
            int    companyId = SystemConst.companyId;

            if (ProcedureDao.MemberRechargeByID(this.mId, this.mName, companyId, amount) > 0)
            {
                XtraMessageBox.Show("充值成功!", "提示");
                EventBus.PublishEvent("UpdateMemberInfoChanged", this, this.mId);
                this.Close();
            }
        }