private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { lvVip.BeginUpdate(); lvVip.Items.Clear(); VIPInfo vipTemp; labCount.Text = vipList.Count.ToString(); if (vipList.Count <= 0) { lvVip.EndUpdate(); MessageBox.Show("无会员信息"); progressBar1.Visible = false; btnOK.Enabled = true; return; } for (int i = 0; i < vipList.Count; i++) { vipTemp = vipList[i]; levelInfo.LvId = vipTemp.VipLevelId; levelInfo = levelBLL.VipLevelSelectById(levelInfo); moneyTemp.VipId = vipTemp.VipId; moneyTemp.IsVip = true; moneyTemp = moneyBLL.VipMoneySelectByVipId(moneyTemp); lvVip.Items.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].SubItems.Add(""); lvVip.Items[i].Tag = vipTemp; lvVip.Items[i].SubItems[0].Text = vipTemp.VipId.ToString(); lvVip.Items[i].SubItems[1].Text = vipTemp.VipNumber; lvVip.Items[i].SubItems[2].Text = vipTemp.VipName; lvVip.Items[i].SubItems[3].Text = moneyTemp.VmBalance.ToString(); lvVip.Items[i].SubItems[4].Text = moneyTemp.Integral.ToString(); lvVip.Items[i].SubItems[5].Text = levelInfo.LvName; lvVip.Items[i].SubItems[6].Text = vipTemp.VipSex == true ? "男" : "女"; lvVip.Items[i].SubItems[7].Text = vipTemp.VipPhone; lvVip.Items[i].SubItems[8].Text = vipTemp.VipCard; lvVip.Items[i].SubItems[9].Text = vipTemp.VipBirthDay.ToShortDateString(); lvVip.Items[i].SubItems[10].Text = vipTemp.VipAddress; lvVip.Items[i].SubItems[11].Text = vipTemp.AddDate.ToString(); lvVip.Items[i].SubItems[12].Text = vipTemp.Mark; lvVip.Items[i].SubItems.Add(vipTemp.VipPWD); } lvVip.EndUpdate(); progressBar1.Visible = false; btnOK.Enabled = true; }
private void btnvipNoSearch_Click(object sender, EventArgs e) { vipNoTemp = null; if (!IsCardSelect) { try { vipNoId = (int)cmbVipNoId.SelectedValue; } catch (Exception) { MessageBox.Show("请选择非会员"); return; } IsCardSelect = false; vipNoTemp = vipNoList.Find(item => item.VipId == vipNoId); } else { string vipNoNumber = txtVipNoNumber.Text.Trim(); vipNoTemp = vipNoList.Find(item => item.VipNumber == vipNoNumber); if (vipNoTemp == null) { progressBar2.Visible = true; btnvipNoSearch.Enabled = false; backgroundWorker1.RunWorkerAsync(); return; } cmbVipNoId.SelectedValue = vipNoTemp.VipId; IsCardSelect = false; } if (vipNoTemp == null) { MessageBox.Show("无该会员信息!"); return; } txtVipNoNumber.Text = vipNoTemp.VipNumber; txtMark.Text = vipNoTemp.Mark; txtVipNoPhone.Text = vipNoTemp.VipPhone; txtVipNoCard.Text = vipNoTemp.VipCard; txtMark.Text = vipNoTemp.Mark; int vipLV = vipNoTemp.LvId; VipLevelInfo levelInfo = new VipLevelInfo(); levelInfo.LvId = vipLV; levelInfo = vipLVBLL.VipLevelSelectById(levelInfo); txtVipNoLevel.Text = levelInfo.LvName; vipNoId = vipNoTemp.VipId; SelectMoneyLeft(vipNoId, false); }
/// <summary> /// 填充会员信息 /// </summary> private void FillVipMessage() { try { txtAddress.Text = vipTemp.VipAddress; txtBirthday.Text = vipTemp.VipBirthDay.ToShortDateString(); txtCard.Text = vipTemp.VipNumber; txtVIPNum.Text = vipTemp.VipId.ToString(); txtPhone.Text = vipTemp.VipPhone; txtVipName.Text = vipTemp.VipName; txtVipCard.Text = vipTemp.VipCard; txtVipMark.Text = vipTemp.Mark; txtMoneyLeft.Text = vipMoneyTemp.VmBalance.ToString(); int vipLV = vipTemp.VipLevelId; VipLevelInfo levelInfo = new VipLevelInfo(); levelInfo.LvId = vipLV; levelInfo = vipLVBLL.VipLevelSelectById(levelInfo); txtVipLv.Text = levelInfo.LvName; int dpid = vipTemp.DpId; DepartInfo dpInfo = new DepartInfo(); dpInfo.DpId = dpid; dpInfo = dpBLL.DepartSelectById(dpInfo); txtDp.Text = dpInfo.DpName; } catch (Exception) { MessageBox.Show("网络不稳定,请重新加载!"); } }
private void FillDp() { lvRule.Items.Clear(); CostRule ruleTemp; for (int i = 0; i < ruleList.Count; i++) { ruleTemp = ruleList[i]; vipLvInfo = new VipLevelInfo(); vipLvInfo.LvId = ruleTemp.LvId; lvRule.Items.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].SubItems.Add(""); lvRule.Items[i].Tag = ruleTemp.CrId; lvRule.Items[i].SubItems[0].Text = ruleTemp.CrId.ToString(); lvRule.Items[i].SubItems[1].Text = ruleTemp.CrName; lvRule.Items[i].SubItems[2].Text = ruleTemp.CostPh.ToString() + "元"; lvRule.Items[i].SubItems[3].Text = borrowKind[ruleTemp.crKind]; lvRule.Items[i].SubItems[4].Text = ruleTemp.CostTime.ToString() + danwei[ruleTemp.crKind - 1]; //扣费时间的单位比包含时间的单位小一度,日租是每小时的几分扣费当一个小时,月租每天的几个小时扣费当一天,年租每月的几天扣费当一月 lvRule.Items[i].SubItems[5].Text = ruleTemp.costBegin.ToString() + "元"; lvRule.Items[i].SubItems[6].Text = ruleTemp.conTime.ToString() + danwei[ruleTemp.crKind]; //时间单位,日租的时间单位是小时,月租时间单位是天,年租时间单位是月 lvRule.Items[i].SubItems[7].Text = vipLvBLL.VipLevelSelectById(vipLvInfo).LvName; levelModel.LvId = ruleTemp.LvId; levelModel = levelBLL.VipLevelSelectById(levelModel); lvRule.Items[i].SubItems[7].Text = levelModel.LvName; } }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (vipTemp == null) { MessageBox.Show("无该会员信息!"); } else { cmbDpVip.SelectedValue = vipTemp.DpId; txtAddress.Text = vipTemp.VipAddress; txtBirthday.Text = vipTemp.VipBirthDay.ToShortDateString(); txtCard.Text = vipTemp.VipNumber; txtPhone.Text = vipTemp.VipPhone; txtVipName.Text = vipTemp.VipName; txtVipCard.Text = vipTemp.VipCard; txtMark.Text = vipTemp.Mark; vipId = vipTemp.VipId; int vipLV = vipTemp.VipLevelId; VipLevelInfo levelInfo = new VipLevelInfo(); levelInfo.LvId = vipLV; levelInfo = vipLVBLL.VipLevelSelectById(levelInfo); txtVipLv.Text = levelInfo.LvName; //int dpid = vipTemp.DpId; try { if (vipTemp.VipPhoto != new Byte[0]) { MemoryStream stream = new MemoryStream(vipTemp.VipPhoto, true); stream.Write(vipTemp.VipPhoto, 0, vipTemp.VipPhoto.Length); pbVip.Image = new Bitmap(stream); pbVip.SizeMode = PictureBoxSizeMode.StretchImage; } else { pbVip.Image = null; } } catch (Exception ex) { pbVip.Image = null; } SelectMoneyLeft(vipId, true); } progressBar1.Visible = false; btnVipSearch.Enabled = true; if (!IsAdmin && vipTemp.DpId != StaticData.departLocal.DpId) { MessageBox.Show("不是该店会员无权充值!"); btnOK.Enabled = false; } else { btnOK.Enabled = true; } }
private void FillVipMessage() { int id = Int32.Parse(cmbVipId.SelectedValue.ToString()); VIPInfo vipTemp = new VIPInfo(); vipInfo.VipId = id; vipTemp = vipBLL.VipSelectById(vipInfo); txtAddress.Text = vipTemp.VipAddress; txtBirthday.Text = vipTemp.VipBirthDay.ToShortDateString(); txtCard.Text = vipTemp.VipNumber; txtPhone.Text = vipTemp.VipPhone; txtVipName.Text = vipTemp.VipName; txtVipCard.Text = vipTemp.VipCard; int vipLV = vipTemp.VipLevelId; VipLevelInfo levelInfo = new VipLevelInfo(); levelInfo.LvId = vipLV; levelInfo = vipLVBLL.VipLevelSelectById(levelInfo); txtVipLv.Text = levelInfo.LvName; int dpid = vipTemp.DpId; DepartInfo dpInfo = new DepartInfo(); dpInfo.DpId = dpid; dpInfo = dpBLL.DepartSelectById(dpInfo); try { MemoryStream stream = new MemoryStream(vipTemp.VipPhoto, true); stream.Write(vipTemp.VipPhoto, 0, vipTemp.VipPhoto.Length); pbVip.Image = new Bitmap(stream); pbVip.SizeMode = PictureBoxSizeMode.StretchImage; } catch (Exception ex) { pbVip.Image = null; } }
private void BindingCmb() { this.Invoke(new Action(() => { levelModel = levelBLL.VipLevelSelectById(levelModel); txtLvName.Text = levelModel.LvName; if (levelModel.IsVip) { rbVip.Checked = true; } else { rbNoVip.Checked = true; } })); }
private void backgroundWorker2_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { levelInfo = new VipLevelInfo(); levelBLL = new VipLevelBLL(); if (vipNoList == null) { return; } lvVipNo.BeginUpdate(); lvVipNo.Items.Clear(); if (vipNoList.Count <= 0) { lvVipNo.EndUpdate(); btnOK.Enabled = true; progressBar1.Visible = false; MessageBox.Show("无非会员信息"); return; } VipNoInfo vipNoTemp; for (int i = 0; i < vipNoList.Count; i++) { vipNoTemp = vipNoList[i]; levelInfo.LvId = vipNoTemp.LvId; levelInfo = levelBLL.VipLevelSelectById(levelInfo); lvVipNo.Items.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].SubItems.Add(""); lvVipNo.Items[i].Tag = vipNoTemp.VipId; lvVipNo.Items[i].SubItems[0].Text = vipNoTemp.VipId.ToString(); lvVipNo.Items[i].SubItems[1].Text = vipNoTemp.VipNumber; lvVipNo.Items[i].SubItems[2].Text = vipNoTemp.VipName; lvVipNo.Items[i].SubItems[3].Text = vipNoTemp.VipPhone; lvVipNo.Items[i].SubItems[4].Text = vipNoTemp.VipCard; lvVipNo.Items[i].SubItems[5].Text = levelInfo.LvName; lvVipNo.Items[i].SubItems[6].Text = vipNoTemp.AddDate.ToString(); lvVipNo.Items[i].SubItems[7].Text = vipNoTemp.Mark; } lvVipNo.EndUpdate(); btnOK.Enabled = true; progressBar1.Visible = false; }
private void FillVipMessage() { VIPInfo vipTemp = new VIPInfo(); VipMoney moneyTemp = new VipMoney(); moneyTemp.VipId = vipInfo.VipId; moneyTemp.IsVip = true; try { moneyTemp = vipMoneyBLL.VipMoneySelectByVipId(moneyTemp); if (moneyTemp != null) { txtInte.Text = moneyTemp.Integral.ToString(); txtBalance.Text = moneyTemp.VmBalance.ToString(); } vipTemp = vipBLL.VipSelectById(vipInfo); txtAddress.Text = vipTemp.VipAddress; txtBirthday.Text = vipTemp.VipBirthDay.ToShortDateString(); txtCard.Text = vipTemp.VipNumber; txtVIPNum.Text = vipTemp.VipId.ToString(); txtPhone.Text = vipTemp.VipPhone; txtVipName.Text = vipTemp.VipName; txtVipCard.Text = vipTemp.VipCard; int vipLV = vipTemp.VipLevelId; VipLevelInfo levelInfo = new VipLevelInfo(); levelInfo.LvId = vipLV; levelInfo = vipLVBLL.VipLevelSelectById(levelInfo); txtVipLv.Text = levelInfo.LvName; int dpid = vipTemp.DpId; DepartInfo dpInfo = new DepartInfo(); dpInfo.DpId = dpid; dpInfo = dpBLL.DepartSelectById(dpInfo); txtDp.Text = dpInfo.DpName; } catch (Exception) { MessageBox.Show("网络不稳定,请刷新!"); } }
private void FillVipNoMessage() { VipNoInfo vipNoTemp = new VipNoInfo(); vipNoTemp = vipNoBLL.VipNoSelectByVIPNoId(vipNoInfo); txtVipNoNumber.Text = vipNoTemp.VipNumber; txtVipNoId.Text = vipNoTemp.VipId.ToString(); txtVipNoName.Text = vipNoTemp.VipName; txtVipNoPhone.Text = vipNoTemp.VipPhone; txtVipNoCard.Text = vipNoTemp.VipCard; txtVipNoMark.Text = vipNoTemp.Mark; int vipLV = vipNoTemp.LvId; VipLevelInfo levelInfo = new VipLevelInfo(); levelInfo.LvId = vipLV; levelInfo = vipLevelBLL.VipLevelSelectById(levelInfo); txtVipNoLevel.Text = levelInfo.LvName; int dpid = vipNoTemp.DpId; DepartInfo dpInfo = new DepartInfo(); dpInfo.DpId = dpid; dpInfo = dpBLL.DepartSelectById(dpInfo); txtDpId.Text = dpInfo.DpName; VipMoney vipMoney = new VipMoney(); VipMoneyBLL vipMoneyBll = new VipMoneyBLL(); vipMoney.VipId = vipNoTemp.VipId; vipMoney.IsVip = false; vipMoney = vipMoneyBll.VipMoneySelectByVipId(vipMoney); try { txtMoneyLeft.Text = vipMoney.VmBalance.ToString(); } catch (Exception) { } }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { VipNoInfo vipNoTemp = new VipNoInfo(); VIPInfo vipTemp = new VIPInfo(); VipLevelInfo vipLvInfo = new VipLevelInfo(); if (vipBorrowList == null || vipBorrowList.Count == 0) { MessageBox.Show("未查询到相应租车信息!"); lvBorrowMessage.Items.Clear(); btnOK.Enabled = true; progressBar1.Visible = false; return; } int length = vipBorrowList.Count; lvBorrowMessage.BeginUpdate(); lvBorrowMessage.Items.Clear(); for (int i = 0; i < vipBorrowList.Count; i++) { lvBorrowMessage.Items.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); lvBorrowMessage.Items[i].SubItems.Add(""); vipTemp.VipId = vipBorrowList[i].VipId; vipTemp = vipBLL.VipSelectById(vipTemp); vipLvInfo.LvId = vipTemp.VipLevelId; vipLvInfo = vipLvBLL.VipLevelSelectById(vipLvInfo); lvBorrowMessage.Items[i].SubItems[0].Text = vipTemp.VipNumber; lvBorrowMessage.Items[i].SubItems[1].Text = vipTemp.VipName; lvBorrowMessage.Items[i].SubItems[2].Text = vipTemp.VipPhone; lvBorrowMessage.Items[i].SubItems[3].Text = vipLvInfo.LvName; lvBorrowMessage.Items[i].SubItems[4].Text = vipBorrowList[i].BbkTime.ToString(); lvBorrowMessage.Items[i].SubItems[5].Text = vipBorrowList[i].BbkNumber.ToString(); lvBorrowMessage.Items[i].SubItems[6].Text = kind[vipBorrowList[i].RkrId]; lvBorrowMessage.Items[i].SubItems[7].Text = vipBorrowList[i].IsReturn == true ? "已还" : "未还"; lvBorrowMessage.Items[i].SubItems[8].Text = vipBorrowList[i].LeftNum.ToString(); } if (vipNoBorrowList == null) { return; } for (int i = 0; i < vipNoBorrowList.Count; i++) { lvBorrowMessage.Items.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); lvBorrowMessage.Items[i + length].SubItems.Add(""); vipNoTemp.VipId = vipNoBorrowList[i].VipId; vipNoTemp = vipNoBLL.VipNoSelectByVIPNoId(vipNoTemp); vipLvInfo.LvId = vipNoTemp.LvId; vipLvInfo = vipLvBLL.VipLevelSelectById(vipLvInfo); lvBorrowMessage.Items[i + length].SubItems[0].Text = vipNoTemp.VipNumber; lvBorrowMessage.Items[i + length].SubItems[1].Text = vipNoBorrowList[i].VnName; lvBorrowMessage.Items[i + length].SubItems[2].Text = vipNoBorrowList[i].VnPhone; lvBorrowMessage.Items[i + length].SubItems[3].Text = vipLvInfo.LvName; lvBorrowMessage.Items[i + length].SubItems[4].Text = vipNoBorrowList[i].BbkTime.ToString(); lvBorrowMessage.Items[i + length].SubItems[5].Text = vipNoBorrowList[i].VnNumber.ToString(); lvBorrowMessage.Items[i + length].SubItems[6].Text = kind[vipNoBorrowList[i].RkrId]; lvBorrowMessage.Items[i + length].SubItems[7].Text = vipNoBorrowList[i].IsReturn == true ? "已还" : "未还"; lvBorrowMessage.Items[i + length].SubItems[8].Text = vipNoBorrowList[i].LeftNum.ToString(); } lvBorrowMessage.EndUpdate(); btnOK.Enabled = true; progressBar1.Visible = false; }