private bool BussinessIsExists(string id, BussinessQueueOR[] list) { foreach (var v in list) { if (v.Id == id) { return true; } } return false; }
public void ButtomQH(FrameworkElement element, Window Owener, int Contickettime, BussinessQueueOR _CureentObj) { if (element.DataContext is QhandyOR) { var qhandy = element.DataContext as QhandyOR; if (!qhandy.Buttomtype) { //连续取号限制 int TimeLen = GetTimeLen(LastGetTime, DateTime.Now); if (TimeLen < Contickettime && Contickettime > 0) { ShowErrorMsg(string.Format("连续取号隔不能小于:{0}秒。", Contickettime)); return; } LastGetTime = DateTime.Now; //BussinessQueueOR _CureentObj = GetBussinessByID(qhandy.LabelJobno); if (_CureentObj == null) { ShowErrorMsg("无法获取按钮业务类型。"); return; } string mCard = string.Empty; if (_CureentObj.Ticketmethod != 2) { CreditCardWindow ccw = null; if (_CureentObj.Ticketmethod == 1) { ccw = new CreditCardWindow(TickModth.SK); } else { ccw = new CreditCardWindow(); } ccw.Owner = Owener; ccw.ShowDialog(); if (!ccw.IsOK) { return; } mCard = ccw.CardNo; } string mErrorMsg = string.Empty; if (WebViewModel.Instance.QH(qhandy.LabelJobno, mCard, out mErrorMsg)) { //成功不处理 MessageBox.Show(mErrorMsg); } else { MessageBox.Show(mErrorMsg); } } else { var pageWinOR = WebViewModel.Instance.GetPageWinById(qhandy.Windowonid); PopupWindow pw = new PopupWindow(pageWinOR); pw.Owner = Application.Current.MainWindow; double mWidht = pageWinOR.Width < 300 ? 300 : pageWinOR.Width; double mHeight = pageWinOR.Height < 300 ? 300 : pageWinOR.Height; pw.Width = mWidht; pw.Height = mHeight; pw.Name = pageWinOR.Name; pw.ShowDialog(); } } }