Esempio n. 1
0
 /// <summary>
 /// 填充租车信息
 /// </summary>
 private void FillVipBorrowMessage()
 {
     try
     {
         if (borrowList == null || borrowList.Count == 0)
         {
             DialogResult result = MessageBox.Show("该用户没有需要还的车辆!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (result == DialogResult.No || result == DialogResult.Yes)
             {
                 isDispose = true;
             }
             this.Close();
             return;
         }
         cmbBorrowTime.DataSource    = borrowList;
         cmbBorrowTime.DisplayMember = "BBKTIME";
         cmbBorrowTime.ValueMember   = "BBKID";
         first = false;
         int           id         = (int)cmbBorrowTime.SelectedValue;
         VipBorrowInfo borrowTemp = new VipBorrowInfo();
         borrowTemp.BbkId = id;
         borrowTemp       = borrowBLL.VipBorrowSelectById(borrowTemp);
         BorrowKind borrowKind = new BorrowKind();
         borrowKind.BkId    = borrowTemp.RkrId;
         txtKind.Text       = borrowKindBLL.BorrowKindSelectById(borrowKind).BbkName;
         txtBorrowNum.Text  = borrowTemp.BbkNumber.ToString();
         txtUnReturn.Text   = borrowTemp.LeftNum.ToString();
         txtBorrowT.Text    = borrowList[0].Times.ToString();
         txtBorrowMark.Text = borrowTemp.Mark;
         if (borrowTemp.IsNight)
         {
             labNightCost.ForeColor = Color.Red;
             labNightCost.Text      = "包夜租车";
         }
         else
         {
             labNightCost.Text = "";
         }
     }
     catch (Exception)
     {
         MessageBox.Show("网络不稳定,请重新加载!");
     }
 }
 private void backgroundWorker2_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (bikeNoList != null)
     {
         bikeList.AddRange(bikeNoList);
     }
     if (bikeList == null || bikeList.Count == 0)
     {
         MessageBox.Show("未查询到相应还车信息!");
         lvReturnMessage.Items.Clear();
         progressBar1.Visible = false;
         btnOK.Enabled        = true;
         return;
     }
     lvReturnMessage.BeginUpdate();
     lvReturnMessage.Items.Clear();
     for (int i = 0; i < bikeList.Count; i++)
     {
         lvReturnMessage.Items.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         lvReturnMessage.Items[i].SubItems.Add("");
         if (bikeList[i].IsVip)
         {
             vipTemp.VipId   = bikeList[i].VipId;
             vipTemp         = vipBLL.VipSelectById(vipTemp);
             departTemp.DpId = bikeList[i].DpId;
             departTemp      = departBLL.DepartSelectById(departTemp);
             vipLvInfo.LvId  = vipTemp.VipLevelId;
             vipLvInfo       = vipLvBLL.VipLevelSelectById(vipLvInfo);
             vipBorrow.BbkId = bikeList[i].BbkId;
             vipBorrow       = vipBorrowBLL.VipBorrowSelectById(vipBorrow);
             lvReturnMessage.Items[i].SubItems[0].Text = vipTemp.VipNumber;
             lvReturnMessage.Items[i].SubItems[1].Text = vipTemp.VipName;
             lvReturnMessage.Items[i].SubItems[2].Text = vipLvInfo.LvName;
             lvReturnMessage.Items[i].SubItems[3].Text = vipBorrow.BbkTime.ToString();
             lvReturnMessage.Items[i].SubItems[4].Text = bikeList[i].BrNumber.ToString();
             lvReturnMessage.Items[i].SubItems[5].Text = kind[vipBorrow.RkrId];
             lvReturnMessage.Items[i].SubItems[6].Text = bikeList[i].RbkTime.ToString();
             lvReturnMessage.Items[i].SubItems[7].Text = bikeList[i].BuTimeString;
             lvReturnMessage.Items[i].SubItems[8].Text = bikeList[i].BuCost.ToString();
             lvReturnMessage.Items[i].SubItems[9].Text = departTemp.DpName;
         }
         else
         {
             vipNoTemp.VipId       = bikeList[i].VipId;
             vipNoTemp             = vipNoBLL.VipNoSelectByVIPNoId(vipNoTemp);
             departTemp.DpId       = bikeList[i].DpId;
             departTemp            = departBLL.DepartSelectById(departTemp);
             vipLvInfo.LvId        = vipNoTemp.LvId;
             vipLvInfo             = vipLvBLL.VipLevelSelectById(vipLvInfo);
             vipNoBorrowTemp.BbkId = bikeList[i].BbkId;
             vipNoBorrowTemp       = vipNoBorrowBLL.VipNoBorrowSelectByBBKId(vipNoBorrowTemp);
             lvReturnMessage.Items[i].SubItems[0].Text = vipNoTemp.VipNumber;
             lvReturnMessage.Items[i].SubItems[1].Text = vipNoBorrowTemp.VnName;
             lvReturnMessage.Items[i].SubItems[2].Text = vipLvInfo.LvName;
             lvReturnMessage.Items[i].SubItems[3].Text = vipNoBorrowTemp.BbkTime.ToString();
             lvReturnMessage.Items[i].SubItems[4].Text = bikeList[i].BrNumber.ToString();
             lvReturnMessage.Items[i].SubItems[5].Text = kind[vipNoBorrowTemp.RkrId];
             lvReturnMessage.Items[i].SubItems[6].Text = bikeList[i].RbkTime.ToString();
             lvReturnMessage.Items[i].SubItems[7].Text = bikeList[i].BuTimeString;
             lvReturnMessage.Items[i].SubItems[8].Text = bikeList[i].BuCost.ToString();
             lvReturnMessage.Items[i].SubItems[9].Text = departTemp.DpName;
         }
     }
     lvReturnMessage.EndUpdate();
     progressBar1.Visible = false;
     btnOK.Enabled        = true;
 }