Ejemplo n.º 1
0
 /// <summary>
 /// 根据IP和端口获取撮合中心
 /// </summary>
 /// <param name="ip"></param>
 /// <param name="port"></param>
 /// <returns></returns>
 public Entity.RC_MatchCenter GetMatchCenterByIpAndPort(string ip, int port)
 {
     try
     {
         LogHelper.WriteDebug("Debug-8227根据IP和端口获取撮合中心方法名称:GetMatchCenterByIpAndPort(string ip, int port)" + DateTime.Now);
         RC_MatchCenterBLL            MatchCenterBLL     = new RC_MatchCenterBLL();
         List <Entity.RC_MatchCenter> rC_MatchCenterList =
             MatchCenterBLL.GetListArray(string.Format("IP='{0}' AND Port={1}", ip, port));
         if (rC_MatchCenterList.Count > 0)
         {
             Entity.RC_MatchCenter rC_MatchCenter = rC_MatchCenterList[0];
             if (rC_MatchCenter != null)
             {
                 return(rC_MatchCenter);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         string      errCode = "GL-8227";
         string      errMsg  = "根据IP和端口获取撮合中心失败";
         VTException vte     = new VTException(errCode, errMsg, ex);
         LogHelper.WriteError(vte.ToString(), vte.InnerException);
         return(null);
     }
 }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 表格单击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridCenter_Click(object sender, EventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi =
                this.ViewCenter.CalcHitInfo(((Control)sender).PointToClient(Control.MousePosition));

            if (this.ViewCenter != null && this.ViewCenter.FocusedRowHandle >= 0 && hi.RowHandle >= 0)
            {
                m_cutRow = this.ViewCenter.FocusedRowHandle;

                DataRow dw            = ViewCenter.GetDataRow(m_cutRow);
                int     MatchCenterID = int.Parse(dw["MatchCenterID"].ToString());
                MatchCenter = MatchCenterBLL.GetModel(MatchCenterID);
                SetTextValue(MatchCenter);
                SetControlEnAbled();
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ManagementCenter.Model.RC_MatchCenter model)
 {
     dal.Update(model);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ManagementCenter.Model.RC_MatchCenter model)
 {
     return(dal.Add(model));
 }