private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e) { if (superGridControlStorage.GetSelectedRows().Count > 0) { Storage storage = new Storage(); SelectedElementCollection col = superGridControlStorage.GetSelectedRows(); if (col.Count > 0) { GridRow gridRow = col[0] as GridRow; storage.St_Address = gridRow["St_Address"].Value.ToString(); storage.St_Clear = Convert.ToInt32(gridRow["St_Clear"].Value); storage.St_Code = gridRow["St_Code"].Value.ToString(); storage.St_EmpName = gridRow["St_EmpName"].Value.ToString(); storage.St_Enable = Convert.ToInt32(gridRow["St_Enable"].Value); storage.St_ID = Convert.ToInt32(gridRow["St_ID"].Value); storage.St_Name = gridRow["St_Name"].Value.ToString(); storage.St_Phone = gridRow["St_Phone"].Value.ToString(); storage.St_Remark = gridRow["St_Remark"].Value.ToString(); storage.St_Safetyone = gridRow["St_Safetyone"].Value.ToString(); storage.St_Safetytwo = gridRow["St_Safetytwo"].Value.ToString(); } StorageCreateForm scf = new StorageCreateForm(); scf._update = true; scf._storage = storage; scf.ShowDialog(this); } else { MessageBox.Show("请先选择需要编辑的信息"); } }
private void 新增ToolStripMenuItem_Click(object sender, EventArgs e) { StorageCreateForm scf = new StorageCreateForm(); scf._update = false; scf.ShowDialog(this); }