コード例 #1
0
 void returnBg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (resultBg > 0)
     {
         try
         {
             txtUseCost.Text = bikeReturnTemp.BuCost.ToString() + "元";
             txtUseTime.Text = bikeReturnTemp.BuTimeString;
             MessageBox.Show("还车成功!租车花费:" + bikeReturnTemp.BuCost.ToString() + "元");
             if (vipMoneyTemp.VmBalance < bikeReturnTemp.BuCost)
             {
                 MessageBox.Show("会员卡已透支,请充值!");
                 CheckMiGo miGo = new CheckMiGo();
                 miGo.ShowDialog();
                 if (miGo.isTrue)
                 {
                     ReChargeWindow rechargeWinodw = new ReChargeWindow(true);
                     rechargeWinodw.ShowDialog();
                 }
             }
             btnOK.Enabled = true;
             this.Close();
             //gbCost.Visible = true;
         }
         catch (Exception ex)
         {
         }
     }
     else
     {
         MessageBox.Show("还车失败!");
         btnOK.Enabled = true;
     }
 }
コード例 #2
0
 private void btnOKClick()
 {
     this.Invoke(new Action(() =>
     {
         int result = 0;
         VipBorrowInfo borrowInfo = new VipBorrowInfo();
         borrowInfo.BbkNumber     = int.Parse(txtNum.Text.Trim());
         borrowInfo.BbkTime       = DateTime.Now;
         borrowInfo.DpId          = StaticData.departLocal.DpId;
         borrowInfo.VipId         = int.Parse(txtVIPNum.Text.Trim());
         borrowInfo.UserId        = StaticData.userLocal.UserId;
         borrowInfo.Mark          = txtMark.Text.Trim();
         if ((int)cmbKind.SelectedValue == 1)
         {
             borrowInfo.RkrId = 1;
             result           = vipBorrowBLL.VipBorrowInsert(borrowInfo, 1);
         }
         else if ((int)cmbKind.SelectedValue == 2)
         {
             borrowInfo.RkrId = 2;
             result           = vipBorrowBLL.VipBorrowInsert(borrowInfo, 2);
         }
         else if ((int)cmbKind.SelectedValue == 3)
         {
             borrowInfo.RkrId = 3;
             result           = vipBorrowBLL.VipBorrowInsert(borrowInfo, 3);
         }
         if (result == -2)
         {
             MessageBox.Show("该用户余额不足以支付起始扣费金额,请充值!");
             CheckMiGo miGo = new CheckMiGo();
             miGo.ShowDialog();
             if (miGo.isTrue)
             {
                 ReChargeWindow rechargeWinodw = new ReChargeWindow(true);
                 rechargeWinodw.ShowDialog();
                 txtBalance.Text = (double.Parse(txtBalance.Text) + rechargeWinodw.chargeMoney).ToString();
             }
         }
         else if (result == -1)
         {
             MessageBox.Show("系统出错,请联系管理员!");
         }
         else if (result == 1)
         {
             MessageBox.Show("租车成功!");
             btnOK.Enabled   = false;
             LogInfo logInfo = new LogInfo();
             logInfo.UserId  = StaticData.userLocal.UserId;
             logInfo.Content = "为会员‘" + txtVipName.Text + "'租车" + txtNum.Text.ToString() + "辆";
             logInfo.LogTime = DateTime.Now;
             logInfo.DpId    = StaticData.departLocal.DpId;
             bool b          = new LogBLL().LogInsert(logInfo);
             this.Close();
         }
     }));
 }
コード例 #3
0
        private void 会员充值ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CheckMiGo miGo = new CheckMiGo();

            miGo.ShowDialog();
            if (miGo.isTrue)
            {
                ReChargeWindow rechargeWinodw = new ReChargeWindow(miGo.isAdmin);
                rechargeWinodw.ShowDialog();
            }
        }