コード例 #1
0
        private void FillVipMessage(string vipCardNumber)
        {
            VIPInfo vipTemp = new VIPInfo();

            vipTemp = vipBLL.VipSelectByCardNumber(vipCardNumber);
            if (vipTemp == null)
            {
                epMessge.SetError(txtCard, "此卡号不存在");
                return;
            }
            epMessge.SetError(txtCard, "");
            if (cmbVipDepart.SelectedValue.ToString() == vipTemp.DpId.ToString())
            {
                cmbVipId.SelectedValue = vipTemp.VipId;
            }
            else
            {
                IsCardChang = true;
                cmbVipDepart.SelectedValue = vipTemp.DpId;
                vipId = vipTemp.VipId;
            }

            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;
            }
        }
コード例 #2
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     backgroundWorker1.ReportProgress(20);
     vipTemp = vipBLL.VipSelectByCardNumber(txtCard.Text.Trim());
     backgroundWorker1.ReportProgress(70);
 }