Пример #1
0
        /// <summary>
        /// 检测输入
        /// </summary>
        /// <returns></returns>
        public bool CheckInPut()
        {
            try
            {
                if (MatchCenter == null)
                {
                    MatchCenter = new RC_MatchCenter();
                }

                if (this.txt_CenterName.Text == string.Empty)
                {
                    ShowMessageBox.ShowInformation("请输入撮合中心名称!");
                    return(false);
                }
                MatchCenter.MatchCenterName = this.txt_CenterName.Text;
                if (this.txt_CenterIP.Text == string.Empty)
                {
                    ShowMessageBox.ShowInformation("请输入IP地址!");
                    return(false);
                }
                if (!InputTest.IPTest(this.txt_CenterIP.Text.Trim()))
                {
                    ShowMessageBox.ShowInformation("IP地址,输入有误,请重新输入!");
                    return(false);
                }
                MatchCenter.IP = this.txt_CenterIP.Text;
                if (!InputTest.intTest(this.txt_Port.Text))
                {
                    ShowMessageBox.ShowInformation("端口输入有误,请重新输入!");
                    return(false);
                }
                MatchCenter.Port = int.Parse(this.txt_Port.Text);
                if (this.txt_cuoheService.Text == string.Empty)
                {
                    ShowMessageBox.ShowInformation("请输入撮合服务的名称!");
                    return(false);
                }
                MatchCenter.CuoHeService = this.txt_cuoheService.Text;
                if (this.txt_xiadanService.Text == string.Empty)
                {
                    ShowMessageBox.ShowInformation("请输入下单服务的名称!");
                    return(false);
                }
                MatchCenter.XiaDanService = this.txt_xiadanService.Text;
                return(true);
            }
            catch (Exception ex)
            {
                string      errCode = "GL-2004";
                string      errMsg  = "检测输入失败";
                VTException vte     = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(vte.ToString(), vte.InnerException);
                return(false);
            }
        }