Example #1
0
        public void CRE_Modulo(MOD_Modulo obj)
        {
            try
            {
                this.IniciarTransaccion();

                AD_Modulo objBD = new AD_Modulo();

                objBD.CRE_Modulo(this.comando, obj);

                this.ConfirmarTransaccion();
            }
            catch (Exception exc)
            {
                this.DeshacerTransaccion();
                throw exc;
            }
        }
Example #2
0
        public void CRE_Modulo(SqlCommand comando, MOD_Modulo obj)
        {
            try
            {
                string sp = "SP_CRE_Modulo";

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

                comando.Parameters.Add(new SqlParameter("@MODU_NOMBRE", SqlDbType.VarChar));

                comando.Parameters[0].Value = obj.MODU_nombre;

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

                throw exc;
            }
        }
Example #3
0
        public List<MOD_Modulo> SEL_Grid_Modulo(SqlCommand comando, string buscar)
        {
            try
            {
                string sp = "SP_SEL_Grid_Modulo";

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

                comando.Parameters.Add(new SqlParameter("@BUSCAR", SqlDbType.VarChar));

                comando.Parameters[0].Value = buscar;

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Modulo obj = new MOD_Modulo();
                    obj.MODU_id_modulo = Convert.ToInt32(dt.Rows[i]["MODU_ID_MODULO"]);
                    obj.MODU_nombre = dt.Rows[i]["MODU_NOMBRE"].ToString();

                    lista.Add(obj);
                }

                return lista;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Example #4
0
        public MOD_Modulo SEL_ModuloByID(SqlCommand comando, int MODU_CODMODULO)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_MODULO";

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

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

                comando.Parameters[0].Value = MODU_CODMODULO;

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.MODU_id_modulo = Convert.ToInt32(dt.Rows[i]["MODU_ID_MODULO"]);
                    obj.MODU_nombre = dt.Rows[i]["MODU_NOMBRE"].ToString();
                }

                return obj;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Example #5
0
        public Boolean CRE_Modulo(MOD_Modulo obj)
        {
            try
            {
                LOG_Modulo Logica = new LOG_Modulo();
                Logica.CRE_Modulo(obj);
                return true;
            }
            catch (Exception )
            {
                return false;
                throw ;

            }
        }
Example #6
0
 public void UPD_Modulo(MOD_Modulo obj)
 {
     try
     {
         LOG_Modulo Logica = new LOG_Modulo();
         Logica.UPD_Modulo(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }