Exemplo n.º 1
0
        public List<MOD_Raza> SEL_DL_RAZA(SqlCommand comando)
        {
            try
            {
                string sp = "SP_SEL_DL_RAZA";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                List<MOD_Raza> lista = new List<MOD_Raza>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Raza obj = new MOD_Raza();
                    obj.RAZ_id_raza = Convert.ToInt32(dt.Rows[i]["RAZ_ID_RAZA"]);
                    obj.RAZ_descripcion = dt.Rows[i]["RAZ_DESCRIPCION"].ToString();
                    lista.Add(obj);
                }

                return lista;

            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Exemplo n.º 2
0
 public void CRE_Raza(MOD_Raza obj)
 {
     try
     {
         this.IniciarTransaccion();
         AD_Raza objRaza = new AD_Raza();
         objRaza.CRE_Raza(this.comando, obj);
         this.ConfirmarTransaccion();
     }
     catch (Exception exc)
     {
         this.DeshacerTransaccion();
         throw exc;
     }
 }
Exemplo n.º 3
0
        public void CRE_Raza(SqlCommand comando, MOD_Raza obj)
        {
            try
            {
                string sp = "SP_CRE_Raza";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@RAZ_ID_RAZA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@RAZ_DESCRIPCION", SqlDbType.VarChar));

                comando.Parameters[0].Value = obj.RAZ_id_raza;
                comando.Parameters[1].Value = obj.RAZ_descripcion;

                comando.ExecuteNonQuery();
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Exemplo n.º 4
0
        public MOD_Raza SEL_Grid_By_Id_Raza(SqlCommand comando, int codigo)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_Raza";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@RAZ_ID_RAZA", SqlDbType.Int));

                comando.Parameters[0].Value = codigo;

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                MOD_Raza obj = new MOD_Raza();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.RAZ_id_raza = Convert.ToInt32(dt.Rows[i]["RAZ_ID_RAZA"]);
                    obj.RAZ_descripcion = dt.Rows[i]["RAZ_DESCRIPCION"].ToString();
                }

                return obj;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Exemplo n.º 5
0
        public Boolean CRE_Raza(MOD_Raza obj)
        {
            try
            {
                LOG_Raza Logica = new LOG_Raza();
                Logica.CRE_Raza(obj);
                return true;
            }
            catch (Exception )
            {
                return false;
                throw ;

            }
        }
Exemplo n.º 6
0
 public void UPD_Raza(MOD_Raza obj)
 {
     try
     {
         LOG_Raza Logica = new LOG_Raza();
         Logica.UPD_Raza(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }