public List <beAlarmasResolution> ListarAlarmas(SqlConnection con) { List <beAlarmasResolution> lbeAlarmas = null; string sql = "SELECT cAlrmCode0,cAlrmCode1,sAlrmDesc FROM ma_SpCLAlrm ORDER BY sAlrmDesc"; SqlCommand cmd = new SqlCommand(sql, con); cmd.CommandType = CommandType.Text; SqlDataReader drd = cmd.ExecuteReader(); if (drd != null) { int AlarmCode = drd.GetOrdinal("cAlrmCode0"); int AlarmCode1 = drd.GetOrdinal("cAlrmCode1"); int Description = drd.GetOrdinal("sAlrmDesc"); lbeAlarmas = new List <beAlarmasResolution>(); beAlarmasResolution obeAlarmas; while (drd.Read()) { obeAlarmas = new beAlarmasResolution(); obeAlarmas.ResolutionCode = drd.GetString(AlarmCode) + "|" + drd.GetString(AlarmCode1); obeAlarmas.ResolutionDesc = drd.GetString(Description); lbeAlarmas.Add(obeAlarmas); } drd.Close(); } return(lbeAlarmas); }
public List <beAlarmasResolution> ListarAlarmas(SqlConnection con) { List <beAlarmasResolution> lbeAlarmas = null; string sql = "select al.AlarmCode, al.Description from AlarmConditions al" + " where al.AlarmCode in (select alXML.AlarmCode from AlarmConditions_XML alXML" + " where alXML.bClienteXML = 1) Union select '$A$', 'TODAS LAS ALARMAS' order by 2"; SqlCommand cmd = new SqlCommand(sql, con); cmd.CommandType = CommandType.Text; SqlDataReader drd = cmd.ExecuteReader(); if (drd != null) { int AlarmCode = drd.GetOrdinal("AlarmCode"); int Description = drd.GetOrdinal("Description"); lbeAlarmas = new List <beAlarmasResolution>(); beAlarmasResolution obeAlarmas; while (drd.Read()) { obeAlarmas = new beAlarmasResolution(); obeAlarmas.ResolutionCode = drd.GetString(AlarmCode); obeAlarmas.ResolutionDesc = drd.GetString(Description); lbeAlarmas.Add(obeAlarmas); } drd.Close(); } return(lbeAlarmas); }
public List <beAlarmasResolution> ListarResolucion(SqlConnection con) { List <beAlarmasResolution> lbeAlarmas = null; SqlCommand cmd = new SqlCommand("sp_listar_resolucion", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader drd = cmd.ExecuteReader(); if (drd != null) { int AlarmCode = drd.GetOrdinal("ResolutionCode"); int Description = drd.GetOrdinal("Description"); lbeAlarmas = new List <beAlarmasResolution>(); beAlarmasResolution obeAlarmas; while (drd.Read()) { obeAlarmas = new beAlarmasResolution(); obeAlarmas.ResolutionCode = drd.GetString(AlarmCode); obeAlarmas.ResolutionDesc = drd.GetString(Description); lbeAlarmas.Add(obeAlarmas); } drd.Close(); } return(lbeAlarmas); }