//------------------------------------------- //Interface . Configuration nIntClase = 1009 //------------------------------------------- public string Get_Interface_CFG(long nIntClase, long nIntCodigo) { BE_Req_Interface Request = new BE_Req_Interface(); DA_Interface DA = new DA_Interface(); Request.nIntClase = Convert.ToInt32(nIntClase); Request.nIntCodigo = Convert.ToInt32(nIntCodigo); return(DA.Get_Interface_CFG(Request)); }
public BE_Res_Interface getInterface(BE_Req_Interface Request) { BE_Res_Interface Item = new BE_Res_Interface(); try { clsConection Obj = new clsConection(); string Cadena = Obj.GetConexionString("Naylamp"); using (SqlConnection cn = new SqlConnection(Cadena)) { cn.Open(); using (SqlCommand cm = new SqlCommand()) { cm.CommandText = "sp_get_Interface"; cm.CommandType = CommandType.StoredProcedure; cm.Parameters.AddWithValue("nIntClase", Request.nIntClase); cm.Parameters.AddWithValue("nIntCodigo", Request.nIntCodigo); cm.Connection = cn; using (SqlDataReader dr = cm.ExecuteReader()) { while (dr.Read()) { Item.nIntClase = dr.GetInt32(dr.GetOrdinal("nIntClase")); Item.nIntCodigo = dr.GetInt32(dr.GetOrdinal("nIntCodigo")); Item.nIntTipo = dr.GetInt32(dr.GetOrdinal("nIntTipo")); Item.cIntDescripcion = dr.GetString(dr.GetOrdinal("cIntDescripcion")); Item.cIntJerarquia = dr.GetString(dr.GetOrdinal("cIntJerarquia")); Item.cIntNombre = dr.GetString(dr.GetOrdinal("cIntNombre")); } } } } } catch (Exception) { throw; } return(Item); }
//------------------------------------------------------------------ // Select: Interface por (nIntClase and nIntCodigo) - Configuracion //------------------------------------------------------------------ public string Get_Interface_CFG(BE_Req_Interface Request) { string Item = ""; try { clsConection Obj = new clsConection(); string Cadena = Obj.GetConexionString("Naylamp"); using (SqlConnection cn = new SqlConnection(Cadena)) { cn.Open(); using (SqlCommand cm = new SqlCommand()) { cm.CommandText = "[usp_Get_Interface_CFG]"; cm.CommandType = CommandType.StoredProcedure; cm.Parameters.AddWithValue("nIntClase", Request.nIntClase); cm.Parameters.AddWithValue("nIntCodigo", Request.nIntCodigo); cm.Connection = cn; SqlParameter pCod = new SqlParameter(); pCod.ParameterName = "cIntNombre"; pCod.DbType = DbType.String; pCod.Size = 200; pCod.Direction = ParameterDirection.Output; cm.Parameters.Add(pCod); cm.ExecuteNonQuery(); Item = cm.Parameters["cIntNombre"].Value.ToString(); } } } catch (Exception) { throw; } return(Item); }