public string[] ToLines() { return(new string[] { A1.ToString(), A2.ToString(), A3.ToString(), B1.ToString(), B2.ToString(), B3.ToString(), C1.ToString(), C2.ToString(), C3.ToString(), Start.ToString() }); }
private void FemSelect_Load(object sender, EventArgs e) { if (this.PailieMode == 3) { this.buttonX1.Visible = true; this.textBoxX29.Visible = true; this.textBoxX30.Visible = true; this.textBoxX31.Visible = true; this.textBoxX32.Visible = true; this.textBoxX33.Visible = true; } else { this.buttonX1.Visible = false; this.textBoxX29.Visible = false; this.textBoxX30.Visible = false; this.textBoxX31.Visible = false; this.textBoxX32.Visible = false; this.textBoxX33.Visible = false; } if (this.isOneOrTwo == 0) { this.textBoxX1.Text = "情况一组合方式"; this.textBoxX8.Text = A1.ToString(); this.textBoxX9.Text = A2.ToString(); this.textBoxX10.Text = A3.ToString(); this.textBoxX20.Text = B1.ToString(); this.textBoxX21.Text = B2.ToString(); this.textBoxX22.Text = B3.ToString(); this.textBoxX23.Text = C1.ToString(); this.textBoxX24.Text = C2.ToString(); this.textBoxX25.Text = C3.ToString(); this.textBoxX26.Text = D1.ToString(); this.textBoxX27.Text = D2.ToString(); this.textBoxX28.Text = D3.ToString(); } else if (this.isOneOrTwo == 1) { this.textBoxX1.Text = "情况二组合方式"; this.textBoxX8.Text = A1.ToString(); this.textBoxX9.Text = A2.ToString(); this.textBoxX10.Text = A3.ToString(); this.textBoxX20.Text = B1.ToString(); this.textBoxX21.Text = B2.ToString(); this.textBoxX22.Text = B3.ToString(); this.textBoxX23.Text = C1.ToString(); this.textBoxX24.Text = C2.ToString(); this.textBoxX25.Text = C3.ToString(); this.textBoxX26.Text = D1.ToString(); this.textBoxX27.Text = D2.ToString(); this.textBoxX28.Text = D3.ToString(); } }
public void VerifyEnums() { var values = EnumValues.NamedValues <Choices>(); var choices = EnumValues.Get <Choices>(); var scalars = EnumValues.NamedScalars <Choices, byte>(); Claim.eq(6, values.Count); Claim.eq(C0, values[C0.ToString()].Value); Claim.eq(C1, values[C1.ToString()].Value); Claim.eq(C2, values[C2.ToString()].Value); Claim.eq(C3, values[C3.ToString()].Value); Claim.eq(C0, choices.Parse(C0.ToString()).Require()); Claim.eq(C1, choices.Parse(C1.ToString()).Require()); Claim.eq(C2, choices.Parse(C2.ToString()).Require()); Claim.eq(C3, choices.Parse(C3.ToString()).Require()); Claim.eq(C0, EnumValues.ToGeneric(C0).Value); Claim.eq(C0.ToString(), EnumValues.ToGeneric(C0).Label); Claim.eq(C1, EnumValues.ToGeneric(C1).Value); Claim.eq(C1.ToString(), EnumValues.ToGeneric(C1).Label); Claim.eq(C2, EnumValues.ToGeneric(C2).Value); Claim.eq(C2.ToString(), EnumValues.ToGeneric(C2).Label); Claim.eq((byte)0, scalars[0].Value); Claim.eq((byte)1, scalars[1].Value); Claim.eq((byte)2, scalars[2].Value); Claim.eq((byte)3, scalars[3].Value); Claim.eq(C0.ToString(), scalars[0].Name); Claim.eq(C1.ToString(), scalars[1].Name); Claim.eq(C2.ToString(), scalars[2].Name); Claim.eq(C3.ToString(), scalars[3].Name); }
private void Filter4_SelectedIndexChanged(object sender, EventArgs e) { try { VisualComboBox filter = sender as VisualComboBox; if (filter.SelectedItem != null) { F4 = filter.SelectedItem.ToString(); C4 = (Field)Enum.Parse(typeof(Field), filter.Tag.ToString()); } DataTable table = Table.AsEnumerable().Where(p => p.Field <string>(C1.ToString()).Equals(F1)).Where(p => p.Field <string>(C2.ToString()).Equals(F2)).Where(p => p.Field <string>(C3.ToString()).Equals(F3)).Where(p => p.Field <string>(C4.ToString()).Equals(F4)).Select(p => p).CopyToDataTable(); BindingSource.DataSource = table; if (table.Columns.Contains("Amount")) { label6.Text = DbData.GetTotal(Source, table).ToString("c"); } label12.Text = table.Rows.Count.ToString(); } catch (Exception ex) { new Error(ex).ShowDialog(); } }
private void Filter3_SelectedIndexChanged(object sender, EventArgs e) { try { VisualComboBox filter = sender as VisualComboBox; if (filter?.SelectedItem != null) { F3 = filter.SelectedItem.ToString(); C3 = (Field)Enum.Parse(typeof(Field), filter.Tag.ToString()); } DataTable table = Table.AsEnumerable().Where(p => p.Field <string>(C1.ToString()).Equals(F1)).Where(p => p.Field <string>(C2.ToString()).Equals(F2)).Where(p => p.Field <string>(C3.ToString()).Equals(F3)).Select(p => p).CopyToDataTable(); BindingSource.DataSource = table; label6.Text = DbData.GetTotal(Source, table).ToString("c") ?? "0"; label12.Text = table.Rows.Count.ToString() ?? "0"; if (Filter4.Tag != null) { PopulateFilterItems(Filter4.Tag.ToString(), table, Filter4, label4); } } catch (Exception ex) { new Error(ex).ShowDialog(); } }