/// <summary> /// 保存过程 /// </summary> /// <returns></returns> private int Save() { string s_ro001 = lookup_roles.EditValue.ToString(); if (string.IsNullOrEmpty(s_ro001)) { return(0); } List <string> ri001_list = new List <string>(); List <string> right_list = new List <string>(); for (int i = 0; i < gridView1.RowCount; i++) { ri001_list.Add(gridView1.GetRowCellValue(i, "RI001").ToString()); if (gridView1.GetRowCellValue(i, "GR009") == null || gridView1.GetRowCellValue(i, "GR009") is System.DBNull) { right_list.Add("0"); } else { right_list.Add(gridView1.GetRowCellValue(i, "GR009").ToString()); } } if (MiscAction.GrantRights(s_ro001, ri001_list.ToArray(), right_list.ToArray()) > 0) { MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); isUpdate = false; return(1); } else { return(-1); } }