private void btnInMoney_Click(object sender, System.EventArgs e)
        {
            //充值
            try
            {
                if (txtInMoney.Text.Trim().Length == 0)
                {
                    throw new BusinessException("充值", "充值金额不能为空");
                }
                DateTime dtEndDate = Convert.ToDateTime(cmdEndDateInMoney.Text);
                if (dtEndDate < DateTime.Now)
                {
                    throw new BusinessException("充值", "卡使用时限不能小于当前日期");
                }
                if (string.IsNullOrEmpty(txtAddMoney.Text))
                {
                    txtAddMoney.Text = "0";
                }
                //if (txtFree.Text.Trim().Length == 0)
                //{
                //    throw new BusinessException("充值","场次不能为空");
                //}

//				if (null == cmbShow.SelectedItem)
//				{
//					throw new BusinessException("充值","请选择招聘会");
//				}
                //UltraGridRow row = this.ultraGrid1.ActiveRow;
                //if (null == row)
                //{
                //    throw new BusinessException("充值","请选择充值的会员");
                //}
                //string strFree = row.Cells["cnvcFree"].Value.ToString();
                //if (strFree == ConstApp.Free_Time_NoLimit)
                //{
                //    MessageBox.Show("场次,\""+ConstApp.Free_Time_NoLimit+"\"将被修改成"+txtFree.Text,"充值");
                //}
                decimal      dBalance = Convert.ToDecimal(txtBalance.Text) + Convert.ToDecimal(txtInMoney.Text) + Convert.ToDecimal(txtAddMoney.Text);
                DialogResult dr2      = MessageBox.Show(this, "【会员卡号:" + txtMemberCardNo.Text + "】\n【单位名称:" + txtMemberName.Text + "】\n【工商注册号:" + txtPaperNo.Text + "】\n【充值金额:" + txtInMoney.Text + "】\n"
                                                        + "【赠送金额:" + this.txtAddMoney.Text + "】\n"
                                                        + "\n【充值后余额:" + dBalance.ToString() + "】\n", "充值信息确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (dr2 == DialogResult.Yes)
                {
                    Member member = new Member();
                    member.cnvcMemberCardNo = txtMemberCardNo.Text;

                    //DataTable dt = Helper.Query("select * from tbMember where cnvcMemberCardNo='"+txtMemberCardNo.Text+"'");
                    //if(dt.Rows.Count==0) throw new BusinessException("会员充值","未找到会员");
                    //Member oldmember = new Member(dt);
                    member.cnnPrepay = Decimal.Parse(txtInMoney.Text);
                    //member.cnvcFree = txtFree.Text;
                    member.cnvcOperName   = this.oper.cnvcOperName;
                    member.cnvcPaperNo    = txtPaperNo.Text;
                    member.cndOperDate    = DateTime.Now;
                    member.cnvcMemberName = txtMemberName.Text;
                    member.cndEndDate     = cmdEndDateInMoney.Text;
                    member.cnvcSales      = cmbSales.Text;
                    member.cnvcDiscount   = cmbDiscount.Text;
                    MemberManageFacade memberManage = new MemberManageFacade();
                    PrintedBill        pBill        = new PrintedBill(member.ToTable());
                    pBill.cnnLastBalance = Convert.ToDecimal(txtBalance.Text);
                    pBill.cnnPrepay      = Convert.ToDecimal(txtInMoney.Text);
                    pBill.cnnDonate      = Convert.ToDecimal(txtAddMoney.Text);
                    pBill.cnnBalance     = Convert.ToDecimal(txtBalance.Text) + Convert.ToDecimal(txtInMoney.Text) + Convert.ToDecimal(txtAddMoney.Text);
                    pBill.cnvcBillType   = ConstApp.Bill_Type_InMoney;
                    pBill.cndEndDate     = cmdEndDateInMoney.Text;
                    pBill.cnvcDiscount   = cmbDiscount.Text;

                    memberManage.MemberInMoney(member, pBill);
                    //pMember = member;

                    DialogResult dr = MessageBox.Show(this, "恭喜!充值成功。打印小票吗?\n【否】继续充值,\n【取消】关闭充值界面。", "充值成功", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
                    if (dr == DialogResult.Yes)
                    {
                        //清空进行充值操作
                        Helper.PrintTicket(pBill);
                        //this.ultraPrintDocument1.Print();

//						txtInMoney.Text = "";
//						txtFree.Text = "";

                        //btnQuery_Click(null,null);

                        setdisp();
                    }
                    else if (dr == DialogResult.No)
                    {
                        btnQuery_Click(txtMemberCardNo.Text);
                        txtInMoney.Text  = "";
                        txtAddMoney.Text = "";
                        lblInMoney.Text  = "充值后余额:";
                        //txtFree.Text = "";
                        //setdisp();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
            catch (BusinessException bex)
            {
                MessageBox.Show(this, bex.Message, bex.Type, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(this, ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnInMoney_Click(object sender, System.EventArgs e)
        {
            //充值
            try
            {
                if (txtInMoney.Text.Trim().Length == 0)
                {
                    throw new BusinessException("充值", "充值金额不能为空");
                }
                if (txtFree.Text.Trim().Length == 0)
                {
                    throw new BusinessException("充值", "场次不能为空");
                }

//				if (null == cmbShow.SelectedItem)
//				{
//					throw new BusinessException("充值","请选择招聘会");
//				}
                UltraGridRow row = this.ultraGrid1.ActiveRow;
                if (null == row)
                {
                    throw new BusinessException("充值", "请选择充值的会员");
                }
                string strFree = row.Cells["cnvcFree"].Value.ToString();
                if (strFree == ConstApp.Free_Time_NoLimit)
                {
                    MessageBox.Show("场次,\"" + ConstApp.Free_Time_NoLimit + "\"将被修改成" + txtFree.Text, "充值");
                }
                DialogResult dr2 = MessageBox.Show(this, "【会员卡号:" + txtMemberCardNo.Text + "】\n【单位名称:" + txtMemberName.Text + "】\n【工商注册号:" + txtPaperNo.Text + "】\n【充值金额:" + txtInMoney.Text + "】\n", "充值信息确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (dr2 == DialogResult.Yes)
                {
                    Member member = new Member();
                    member.cnvcMemberCardNo = txtMemberCardNo.Text;
                    member.cnnPrepay        = Decimal.Parse(txtInMoney.Text);
                    member.cnvcFree         = txtFree.Text;
                    member.cnvcOperName     = this.oper.cnvcOperName;
                    member.cnvcPaperNo      = txtPaperNo.Text;
                    member.cndOperDate      = DateTime.Now;
                    member.cnvcMemberName   = txtMemberName.Text;
                    MemberManageFacade memberManage = new MemberManageFacade();
                    PrintedBill        pBill        = new PrintedBill(member.ToTable());
                    pBill.cnvcBillType = ConstApp.Bill_Type_InMoney;
                    memberManage.MemberInMoney(member, pBill);
                    //pMember = member;

                    DialogResult dr = MessageBox.Show(this, "恭喜!充值成功。打印小票吗?\n【否】继续充值,\n【取消】关闭充值界面。", "充值成功", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
                    if (dr == DialogResult.Yes)
                    {
                        //清空进行充值操作
                        Helper.PrintTicket(pBill);
                        //this.ultraPrintDocument1.Print();

//						txtInMoney.Text = "";
//						txtFree.Text = "";

                        btnQuery_Click(null, null);
                    }
                    else if (dr == DialogResult.No)
                    {
                        txtInMoney.Text = "";
                        //txtFree.Text = "";
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
            catch (BusinessException bex)
            {
                MessageBox.Show(this, bex.Message, bex.Type, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(this, ex.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }