static public void AddPassenger(string[] fill_text) { List <Field> new_field = FieldTypeCol.get_value(); for (int i = 0; i < fill_text.Count <string>(); ++i) { new_field[i].SetValue(fill_text[i]); } Passenger new_pass = new Passenger(); new_pass.fields = new_field; FirmCol.add_pass(new_pass); }
private void frmCreate_Load(object sender, EventArgs e) { fields = FieldTypeCol.get_value(); int count = fields.Count; int[] x = { 10, 200 }; int y = 10; name = new Label[count]; textBox = new TextBox[count]; for (int i = 0; i < count; i++) { name[i] = new Label(); textBox[i] = new TextBox(); } for (int i = 0; i < count; ++i) { y += 30; int index = 0; name[i].Text = fields[i].GetName(); name[i].Left = x[index++]; name[i].Top = y; name[i].Name = fields[i].TypeField(); textBox[i].Width = 200; textBox[i].Left = x[index++]; textBox[i].Top = y; name[i].Width = 180; } for (int i = 0; i < count; i++) { this.Controls.Add(name[i]); this.Controls.Add(textBox[i]); } }