private void 导入用户ToolStripMenuItem_Click(object sender, EventArgs e) { try { DialogResult DialogResult1 = this.openFileDialog1.ShowDialog(); if (DialogResult1 != System.Windows.Forms.DialogResult.OK) { return; } string[] FileContent = File.ReadAllLines(this.openFileDialog1.FileName, Encoding.Default); for (int i = 1; i < FileContent.Length; i++) { string[] Data = FileContent[i].Split(','); 角色 角色1 = (角色)Enum.Parse(typeof(角色), Data[2], false); 分组 分组1 = (分组)Enum.Parse(typeof(分组), Data[7], false); Program.AASServiceClient.AddUser(Data[0], Data[1], 角色1, decimal.Parse(Data[3]), decimal.Parse(Data[4]), decimal.Parse(Data[5]), Data[6] == "是" ? true : false, 分组1); } } catch (Exception ex) { Exception ex1 = ex.InnerException == null ? ex : ex.InnerException; MessageBox.Show(ex1.Message + ex1.StackTrace); } this.bindingSource用户.DataSource = Program.AASServiceClient.QueryUser(); }
private void button确定_Click(object sender, EventArgs e) { 分组 region = (分组)Enum.Parse(typeof(分组), this.comboBox分组.SelectedItem.ToString(), false); Program.AASServiceClient.UpdateUser(this.平台用户.用户名, this.numericUpDown仓位限制.Value, this.numericUpDown亏损限制.Value, this.numericUpDown手续费率.Value, this.checkBox允许删除碎股订单.Checked, region); this.DialogResult = System.Windows.Forms.DialogResult.OK; }
private void dataGridView用户_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if ((sender as DataGridView).Columns[e.ColumnIndex].HeaderText == "角色") { int int1 = (int)e.Value; 角色 角色1 = (角色)Enum.Parse(typeof(角色), int1.ToString(), false); e.Value = 角色1.ToString(); } else if ((sender as DataGridView).Columns[e.ColumnIndex].HeaderText == "分组") { 分组 分组1 = (分组)Enum.Parse(typeof(分组), e.Value.ToString(), false); e.Value = 分组1.ToString(); } }
private void button确定_Click(object sender, EventArgs e) { if (this.textBox密码.Text != this.textBox确认密码.Text) { MessageBox.Show("确认密码与密码不同"); return; } 角色 角色1 = (角色)Enum.Parse(typeof(角色), this.comboBox角色.SelectedItem.ToString(), false); 分组 region = (分组)Enum.Parse(typeof(分组), this.comboBox分组.SelectedItem.ToString(), false); Program.AASServiceClient.AddUser(this.textBox用户名.Text, this.textBox密码.Text, 角色1, this.numericUpDown仓位限制.Value, this.numericUpDown亏损限制.Value, this.numericUpDown手续费率.Value, this.checkBox允许删除碎股订单.Checked, region); this.DialogResult = System.Windows.Forms.DialogResult.OK; }