/// <summary> /// Сброс таблиц /// </summary> private void resetDataTable() { for (ID_Table i = ID_Table.Unknown + 1; i < ID_Table.Count; i++) { m_arr_editTable[(int)i] = m_arr_origTable[(int)i].Copy(); } }
/// <summary> /// Обработчик события кнопки "Применить" /// </summary> private void buttonOK_click(object sender, MouseEventArgs e) { delegateReportClear(true); int err = -1; string[] warning; string keys = string.Empty; if (validate_saving(m_arr_editTable, out warning) == false) { for (ID_Table i = ID_Table.Unknown + 1; i < ID_Table.Count; i++) { switch (i) { case ID_Table.Role: case ID_Table.User: keys = @"ID"; break; case ID_Table.Profiles: keys = "ID_EXT,IS_ROLE,ID_UNIT"; break; default: break; } db_sostav.Edit(getNameMode(i), keys, m_arr_origTable[(int)i], m_arr_editTable[(int)i], out err); } fillDataTable(); resetDataTable(); treeView_Users.Update_tree(m_arr_editTable[(int)ID_Table.User], m_arr_editTable[(int)ID_Table.Role]); btnOK.Enabled = false; btnBreak.Enabled = false; } else { delegateWarningReport(warning[(int)ID_Table.Role] + warning[(int)ID_Table.User] + warning[(int)ID_Table.Profiles]); //MessageBox.Show(warning[0] + warning[1] + warning[2] + warning[3], "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } //db_sostav.Write_Audit(m_table_audit); }
/// <summary> /// Возвратить наименование компонента /// </summary> /// <param name="indx">Индекс </param> /// <returns>Строка - наименование</returns> protected static string getNameMode(ID_Table id) { string[] nameModes = { "roles", "users", "profiles" }; return(nameModes[(int)id]); }
private void Awake() { instance = this; DontDestroyOnLoad(this.gameObject); }