public static int getPersonaId(int competidorId) { try { DBTransaction db = new DBTransaction(); var resultado = db.GetData(string.Format("select indv.fGetPersonaIdComp({0})", competidorId)); var entero = Convert.ToInt32(resultado[0][0]); return(entero); } catch (Exception e) { var mensaje = e.Message; return(0); } }
public static List <Area> GetAreas(int InstalacionId) { List <Area> lins = new List <Area>(); DBTransaction db = new DBTransaction(); DataTable dt = db.GetData(string.Format("select * from prog.fGetAreasInstalacion({0})", InstalacionId)).Table; foreach (DataRow dr in dt.Rows) { Area area = new Area { InstalacionId = Convert.ToInt32(dr["InstalacionId"]), AreaInstalacionId = Convert.ToInt32(dr["AreaInstalacionId"]), Instalacion = Convert.ToString(dr["Instalacion"]), Descripcion = Convert.ToString(dr["Descripcion"]) }; lins.Add(area); } return(lins); }