コード例 #1
0
ファイル: ADSaludSexo.cs プロジェクト: Grob2401/protect-salud
        public bool Insertar(ENSaludSexo oENSaludSexo)
        {
            DbCommand oCommand = null;

            try
            {
                oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludSexo_ins");
                GenericDataAccess.AgregarParametro(oCommand, "@argCodigoSexo", oENSaludSexo.CodigoSexo, TipoParametro.STR, Direccion.INPUT);
                GenericDataAccess.AgregarParametro(oCommand, "@argDescripcionSexo", oENSaludSexo.DescripcionSexo, TipoParametro.STR, Direccion.INPUT);

                GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT);
                if (GenericDataAccess.ExecuteNonQuery(oCommand) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw new Excepciones.ManejoExcepciones(ex);
            }
            finally
            {
                GenericDataAccess.CerrarConexion(oCommand, null);
            }
        }
コード例 #2
0
ファイル: ADSaludSexo.cs プロジェクト: Grob2401/protect-salud
        public ENSaludSexo  ObtenerUno(string CodigoSexo)
        {
            DbCommand   oCommand     = null;
            ENSaludSexo oENSaludSexo = new ENSaludSexo();

            try
            {
                oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludSexo_sel");
                GenericDataAccess.AgregarParametro(oCommand, "@argCodigoSexo", oENSaludSexo.CodigoSexo, TipoParametro.STR, Direccion.INPUT);

                GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT);
                DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand);
                if (oDataReader.Read())
                {
                    oENSaludSexo.CodigoSexo      = oDataReader["CodigoSexo"].ToString();
                    oENSaludSexo.DescripcionSexo = oDataReader["DescripcionSexo"].ToString();
                }
                return(oENSaludSexo);
            }
            catch (Exception ex)
            {
                throw  new Exception();
            }
            finally
            {
                GenericDataAccess.CerrarConexion(oCommand, null);
            }
        }
コード例 #3
0
ファイル: ADSaludSexo.cs プロジェクト: Grob2401/protect-salud
        public List <ENSaludSexo> ObtenerTodos()
        {
            DbCommand          oCommand        = null;
            List <ENSaludSexo> oListaSaludSexo = new List <ENSaludSexo>();

            try
            {
                oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_GenSaludSexo_sel");
                GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode ", 1, TipoParametro.INT, Direccion.OUTPUT);
                DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand);
                while (oDataReader.Read())
                {
                    ENSaludSexo oEnListaSaludSexo = new ENSaludSexo();
                    oEnListaSaludSexo.CodigoSexo      = oDataReader["CodigoSexo"].ToString();
                    oEnListaSaludSexo.DescripcionSexo = oDataReader["DescripcionSexo"].ToString();

                    oListaSaludSexo.Add(oEnListaSaludSexo);
                }
                return(oListaSaludSexo);
            }
            catch (Exception ex)
            {
                throw  new Exception();
            }
            finally
            {
                GenericDataAccess.CerrarConexion(oCommand, null);
            }
        }
コード例 #4
0
ファイル: LNSaludSexo.cs プロジェクト: Grob2401/protect-salud
 public static bool Actualizar(ENSaludSexo oENSaludSexo)
 {
     return((new ADSaludSexo()).Actualizar(oENSaludSexo));
 }
コード例 #5
0
ファイル: LNSaludSexo.cs プロジェクト: Grob2401/protect-salud
 public static bool Insertar(ENSaludSexo oENSaludSexo)
 {
     return((new ADSaludSexo()).Insertar(oENSaludSexo));
 }