private void add_Click(object sender, EventArgs e) { ModuleInfo minfo = new ModuleInfo(); minfo.Led_id = info.Id; var childForm = new AreaDefine(minfo); var result = childForm.ShowDialog(); if (result == DialogResult.OK) { ModuleManager_Load(sender, e); } }
private void edit_Click(object sender, EventArgs e) { ModuleInfo minfo = new ModuleInfo(); minfo.Led_id = info.Id; if (this.moduleList.SelectedRows.Count > 0) { if (this.moduleList.SelectedRows.Count == 1) { var row = this.moduleList.SelectedRows[0].Cells; // info. = ; minfo.Id = Int32.Parse(row[0].Value.ToString()); minfo.Left_begin = Int32.Parse(row[1].Value.ToString()); minfo.Top_begin = Int32.Parse(row[2].Value.ToString()); minfo.Width = Int32.Parse(row[3].Value.ToString()); minfo.Height = Int32.Parse(row[4].Value.ToString()); minfo.Area_type = Int32.Parse(row[5].Value.ToString()); minfo.Module_type = row[6].Value.ToString(); minfo.Multi_nAlignment = Int32.Parse(row[7].Value.ToString()); minfo.Multi_IsVCenter = Int32.Parse(row[8].Value.ToString()); minfo.Font_size = Int32.Parse(row[9].Value.ToString()); minfo.Font_bold = Int32.Parse(row[10].Value.ToString()); minfo.In_style = Int32.Parse(row[11].Value.ToString()); minfo.Delay_time = Int32.Parse(row[12].Value.ToString()); minfo.Speed = Int32.Parse(row[13].Value.ToString()); var childForm = new AreaDefine(minfo); var result = childForm.ShowDialog(); if (result == DialogResult.OK) { ModuleManager_Load(sender, e); } } else { MessageBox.Show("请选择一条数据进行编辑!"); return; } } else { MessageBox.Show("请选择要编辑的数据!"); return; } }