private 券商 GetPageEntity() { if (this.GroupEntity == null) { GroupEntity = new 券商() { IsIMSAccount = true } } ; var o = GroupEntity; o.称 = this.txt名称.Text.Trim(); o.启用 = this.ckIsEnable.IsChecked == true; o.版本号 = this.txt版本号.Text.Trim(); //o.交易服务器 = this.txt交易服务器.Text.Trim(); //var serverInfo = Regex.Match(o.交易服务器, "[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}").Value; //o.IP = serverInfo; o.交易帐号 = this.txt帐号.Text.Trim(); if (ckIsEncrypt.IsChecked == true) { o.交易密码 = this.txt密码.Password; o.通讯密码 = Cryptor.MD5Encrypt(string.Empty);; } else { o.交易密码 = Cryptor.MD5Encrypt(this.txt密码.Password); o.通讯密码 = Cryptor.MD5Encrypt(string.Empty); } o.产品信息 = this.txt产品信息.Text.Trim(); o.资产单元 = this.txt资产单元.Text.Trim(); o.投资组合 = this.txt投资组合.Text.Trim(); int time = 0; if (int.TryParse(this.txt查询时间间隔.Text.Trim(), out time)) { o.查询间隔时间 = time; } //o.Multithreading = ckIsMultiThread.IsChecked == true; return(o); }
public static bool UpdateGroup(券商 o) { try { var groupJson = (new GroupInfo(o)).ToJson(); CommonUtils.SetConfig(o.称, Cryptor.MD5Encrypt(groupJson)); if (o.ClientID == -1 && o.启用) { o.Start(); } } catch (Exception ex) { CommonUtils.Log("新增或编辑组合号出错", ex); return(false); } return(true); }
private void Init(券商 group) { GroupEntity = group; this.Title = "组合号编辑"; this.ckIsEnable.IsChecked = group.启用; this.ckIsEncrypt.IsChecked = true; //this.txtIP.Text = group.IP; //this.txtPort.Text = group.Port.ToString(); this.txt版本号.Text = group.版本号; this.txt帐号.Text = group.交易帐号; this.txt密码.Password = group.交易密码; this.txt名称.Text = group.称; this.txt查询时间间隔.Text = group.查询间隔时间.ToString(); this.txt产品信息.Text = group.产品信息; this.txt资产单元.Text = group.资产单元; this.txt投资组合.Text = group.投资组合; this.btnSave.IsEnabled = true; }
public GroupInfo(券商 o) { this.IP = o.IP; this.Port = o.Port; this.版本号 = o.版本号; this.查询间隔时间 = o.查询间隔时间; this.登录帐号 = o.登录帐号; this.交易服务器 = o.交易服务器; this.交易密码 = o.交易密码; this.交易帐号 = o.交易帐号; this.称 = o.称; this.启用 = o.启用; this.通讯密码 = o.通讯密码; this.营业部代码 = o.营业部代码; this.Multithreading = o.Multithreading; this.IsIMSAccount = o.IsIMSAccount; this.产品信息 = o.产品信息; this.资产单元 = o.资产单元; this.投资组合 = o.投资组合; }
public void Init(券商 group) { GroupEntity = group; this.Title = "组合号编辑"; this.ckIsEnable.IsChecked = group.启用; this.ckIsEncrypt.IsChecked = true; this.txtIP.Text = group.IP; this.txtPort.Text = group.Port.ToString(); this.txt版本号.Text = group.版本号; this.txt登录帐号.Text = group.登录帐号; this.txt交易服务器.Text = group.交易服务器; this.txt交易密码.Password = group.交易密码; this.txt交易帐号.Text = group.交易帐号; this.txt名称.Text = group.称; this.txt通讯密码.Password = group.通讯密码; this.txt营业部代码.Text = group.营业部代码.ToString(); this.txt查询时间间隔.Text = group.查询间隔时间.ToString(); this.ckIsMultiThread.IsChecked = group.Multithreading; }
private 券商 GetPageEntity() { if (this.GroupEntity == null) { GroupEntity = new 券商(); } var o = GroupEntity; o.IP = this.txtIP.Text; o.Port = short.Parse(this.txtPort.Text.Trim()); o.版本号 = this.txt版本号.Text.Trim(); o.登录帐号 = this.txt登录帐号.Text.Trim(); o.交易服务器 = this.txt交易服务器.Text.Trim(); o.交易帐号 = this.txt交易帐号.Text.Trim(); o.称 = this.txt名称.Text.Trim(); o.启用 = this.ckIsEnable.IsChecked == true; if (ckIsEncrypt.IsChecked == true) { o.交易密码 = this.txt交易密码.Password; o.通讯密码 = this.txt通讯密码.Password; } else { o.交易密码 = Cryptor.MD5Encrypt(this.txt交易密码.Password); o.通讯密码 = Cryptor.MD5Encrypt(this.txt通讯密码.Password); } int time = 0; if (int.TryParse(this.txt查询时间间隔.Text.Trim(), out time)) { o.查询间隔时间 = time; } o.营业部代码 = short.Parse(this.txt营业部代码.Text); o.Multithreading = ckIsMultiThread.IsChecked == true; return(o); }
public AddImsGroup(券商 groupItem) { InitializeComponent(); Init(groupItem); }