public string DeletarMenu(TRegistro_CadMenu val) { Hashtable hs = new Hashtable(1); hs.Add("@P_ID_MENU", val.id_menu); return(this.executarProc("EXCLUI_DIV_MENU", hs)); }
public string GravarMenu(TRegistro_CadMenu val) { Hashtable hs = new Hashtable(7); hs.Add("@P_ID_MENU", val.id_menu); hs.Add("@P_ID_MENURAIZ", val.id_menuraiz); if (val.ID_Report > 0) { hs.Add("@P_ID_REPORT", val.ID_Report); } hs.Add("@P_DS_MENU", val.ds_menu); hs.Add("@P_CD_MODULO", val.cd_modulo); hs.Add("@P_NM_MODULO", val.nm_modulo); hs.Add("@P_NIVEL", val.nivel); hs.Add("@P_NM_CLASSE", val.nm_classe); hs.Add("@P_TP_EVENTO", val.tp_evento); return(executarProc("IA_DIV_MENU", hs)); }
public TList_CadMenu Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo, string vOrder) { TList_CadMenu lista = new TList_CadMenu(); SqlDataReader reader = null; bool podeFecharBco = false; if (Banco_Dados == null) { this.CriarBanco_Dados(false); podeFecharBco = true; } reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), "", "", vOrder)); try { while (reader.Read()) { TRegistro_CadMenu cadMenu = new TRegistro_CadMenu(); if (!reader.IsDBNull(reader.GetOrdinal("id_menu"))) { cadMenu.id_menu = reader.GetString(reader.GetOrdinal("id_menu")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("id_menuraiz"))) { cadMenu.id_menuraiz = reader.GetString(reader.GetOrdinal("id_menuraiz")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("ds_menu"))) { cadMenu.ds_menu = reader.GetString(reader.GetOrdinal("ds_menu")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("cd_modulo"))) { cadMenu.cd_modulo = reader.GetString(reader.GetOrdinal("cd_modulo")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("nm_modulo"))) { cadMenu.nm_modulo = reader.GetString(reader.GetOrdinal("nm_modulo")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("nivel"))) { cadMenu.nivel = reader.GetDecimal((reader.GetOrdinal("nivel"))); } if (!reader.IsDBNull(reader.GetOrdinal("NM_classe"))) { cadMenu.nm_classe = reader.GetString(reader.GetOrdinal("nm_classe")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("tp_evento"))) { cadMenu.tp_evento = reader.GetString(reader.GetOrdinal("tp_evento")).Trim(); } if (!reader.IsDBNull(reader.GetOrdinal("ID_Report"))) { cadMenu.ID_Report = reader.GetDecimal((reader.GetOrdinal("ID_Report"))); } lista.Add(cadMenu); } } finally { reader.Close(); reader.Dispose(); if (podeFecharBco) { this.deletarBanco_Dados(); } } return(lista); }