示例#1
0
 public bool Login(string userid, string password,out string errorMsg)
 {
     errorMsg = string.Empty;
     using (var client = new QueueClientSoapClient())
     {
         try
         {
             string msg = client.getLogin(userid, password, GlobalData.WindowNo);
             if (msg != "0")
             {
                 errorMsg = msg;
                 return false;
             }
         }
         catch (EndpointNotFoundException exEnd)
         {
             errorMsg = "配置Web服务不存在!";
             return false;
         }
         catch (Exception ex)
         {
             errorMsg = "登录失败!";
             return false;
         }
         EmployeeOR obj = client.GetEmployeeInfo(userid);
         GlobalData.UserID = userid.Trim();
         GlobalData.UserName = obj.Name;
     }
     return true;
 }
示例#2
0
 public string GetPwd()
 {
     using (var client = new QueueClientSoapClient())
       {
       return client.GetClientValue("pwd");
       }
       //return GetClient().GetClientValue("pwd");
 }
示例#3
0
        private MainViewModel()
        {
            _command = new DelegateCommand<string>(Excute);//, CanExcute);
            //
            using (var client = new QueueClientSoapClient())
            {
                _SysParaConfigObj = client.GetSysParamConfigOR();
            }

            InitData();

            //刷新队列
            //定时更新值
            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 5);
            timer.Tick += new EventHandler(timer_Tick);
            timer.Start();
        }
示例#4
0
        private bool Init()
        {
            try
            {
                BussinessList = new ObservableCollection<BussinessQueueOR>();
                var v = WebViewModel.Instance.GetQueues();
                foreach (BussinessQueueOR obj in v)
                {
                    BussinessList.Add(obj);
                }

                //获取退出密码
                Userpsw = ImgSetViewModel.Instance.GetPwd();
                if (string.IsNullOrEmpty(Userpsw))
                    Userpsw = "ABCabc123";

                //参数设置
                using (var client = new QueueClientSoapClient())
                {
                    _SysParaConfigObj = client.GetSysParamConfigOR();
                    _ShutdownTimeObj = client.SelectShutdownTime();
                }

                if (_ShutdownTimeObj != null)
                {
                    //MessageBox.Show(_ShutdownTimeObj.Mondaytime);
                    ShutDownInit();
                }
                //处理、硬件信息
                _HDHead=new DeviceCheckHead();

                thHDandPJQ = new Thread(_HDHead.HDMain);
                thHDandPJQ.IsBackground = true;
                thHDandPJQ.Start();
            }
            catch (EndpointNotFoundException exEnd)
            {
                ShowErrorMsg("配置Web服务不存在!");
                return false;
            }
            catch (Exception ex)
            {
                ShowErrorMsg("获取业务类型出错:Webservice未启动,或配置错误!\r\n详细信息:" + ex.Message);
                return false;
            }

            LoadButton(string.Empty);
            return true;
        }
示例#5
0
 /// <summary>
 /// 结束服务
 /// </summary>
 private void StopServer()
 {
     if (MessageBox.Show("确定要退出系统吗?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
     {
         return;
     }
     using (var client = new QueueClientSoapClient())
     {
         string msg = client.endService(GlobalData.UserID, GlobalData.WindowNo);
         if (msg == "0")
         {
             Application.Current.Shutdown();
         }
         else
         {
             ShowErrorMsg(msg);
         }
     }
 }
示例#6
0
 /// <summary>
 /// 调用呼号接口
 /// </summary>
 /// <param name="mType"></param>
 /// <param name="mParameter"></param>
 /// <returns></returns>
 private string GetCall(string mType, string mParameter)
 {
     using (var client = new QueueClientSoapClient())
     {
         string value = client.getCall(mType, mParameter);
         return value;
     }
 }
示例#7
0
 private BussinessQueueOR[] GetBussinessList()
 {
     using (var client = new QueueClientSoapClient())
     {
         var v = client.getQueuesByWindow(GlobalData.WindowNo);
         return v;
     }
 }
示例#8
0
 private void Window_Closed(object sender, EventArgs e)
 {
     using (var client = new QueueClientSoapClient())
     {
         string msg = client.endService(GlobalData.UserID, GlobalData.WindowNo);
         if (msg == "0")
         {
             Application.Current.Shutdown();
         }
         //else
         //{
         //    ShowErrorMsg(msg);
         //}
     }
 }
示例#9
0
 public QueueClientSoapClient GetQueueClient()
 {
     QueueClientSoapClient CClient = new QueueClientSoapClient();
     return CClient;
 }
示例#10
0
        /// <summary>
        /// 取号
        /// </summary>
        /// <param name="_qhjobNo">取号业务号</param>
        /// <param name="mCard">取号卡号</param>
        /// <param name="errorMsg">错误信息</param>
        /// <returns></returns>
        public bool QH(string  _qhjobNo,string mCard,out string errorMsg)
        {
            errorMsg = string.Empty;
            using (var client = new QueueClientSoapClient())
            {
                if (string.IsNullOrEmpty(_qhjobNo))
                {
                    errorMsg = "没有配置业务队列不能取号!";
                    return false;
                }

                var result = client.BussinessQH(_qhjobNo, mCard);

                if (result.ToLower().IndexOf("error:") >= 0)//有错
                {
                    errorMsg = result;
                    return false;
                }

                //ImgSetViewModel.Instance.PrintSlip(result);
                //取号成功: result票号
                errorMsg = result;
                //打印票号
                return true;
            }
        }
示例#11
0
 public BussinessQueueOR[] GetQueues()
 {
     using (var client = new QueueClientSoapClient())
     {
        BussinessQueueOR[] list= client.getQueue();
        return list;
     }
 }
示例#12
0
 public string GetQhImgName()
 {
     using (var client = new QueueClientSoapClient())
     {
         string imgName = client.GetClientValue("");
         return imgName;
     }
 }
示例#13
0
        /// <summary>
        /// 获取页窗口
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public PageWinOR GetPageWinById(string id)
        {
            if (_pageCahches.ContainsKey(id))
            {
                return _pageCahches[id];
            }

            try
            {
                using (var client = new QueueClientSoapClient())
                {
                    var result = client.GetPageWinById(id);
                    _pageCahches.Add(id, result);
                    return result;
                }
            }
            catch (Exception ex)
            {
                throw new Exception("获取数据出错啦,可能出现原因:Webservice未启动,或配置错误!\r\n详细信息:" + ex.Message);
            }
        }
示例#14
0
        /// <summary>
        /// 获取按钮,为空或页窗口ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public QhandyOR[] GetButtonsByPageWinId(string id)
        {
            if (_qhandyCaches.ContainsKey(id))
            {
                return _qhandyCaches[id];
            }

            using (var client = new QueueClientSoapClient())
            {
                var result = client.GetButtonsByPageWinId(id);
                _qhandyCaches.Add(id, result);
                return result;
            }
        }
示例#15
0
        public void RefButtomWaitNumber()
        {
            var client = new QueueClientSoapClient();
            do
            {
                if (StopRef)
                    return;

                foreach (RefButtomText obj in ListQH)
                {
                    try
                    {
                        if (obj.QHOR.LabelCaption.IndexOf("#wait") >= 0 || obj.QHOR.EnlabelCaption.IndexOf("#wait") >= 0 || obj.QHOR.TagCaption.IndexOf("#wait") >= 0)
                        {
                            int UserNum = 0;
                            if (!string.IsNullOrEmpty(obj.QHOR.LabelJobno))
                            {
                                UserNum = client.GetBussinessWiatUser(obj.QHOR.LabelJobno);
                            }
                            else
                            {
                                UserNum = 0;
                            }

                            if (obj.BtnKJ != null)
                            {
                                obj.BtnKJ.SetText(obj.QHOR.LabelCaption.Replace("#wait", UserNum.ToString()));
                            }

                            if (obj.BtnEn != null)
                            {
                                obj.BtnEn.SetText(obj.QHOR.EnlabelCaption.Replace("#wait", UserNum.ToString()));
                            }

                            if (obj.BtnTag != null)
                            {
                                obj.BtnTag.SetText(obj.QHOR.TagCaption.Replace("#wait", UserNum.ToString()));
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ErrorLog.WriteLog("RefButtomText:#wait", ex.Message);
                    }
                }
                Thread.Sleep(10 * 1000);

            } while (true);
        }
示例#16
0
 private bool CheckCard(string mCard)
 {
     using (var client = new QueueClientSoapClient())
     {
        return client.ValidationCard(mCard);
     }
 }