예제 #1
0
 public static void RegistrarMenu(MenuEn _menu)
 {
     try
     {
         ConsultasAd.RegistrarMenu(_menu);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public Rol_X_Menu()
 {
     rol = new RolEn();
     menu = new MenuEn();
 }
예제 #3
0
        public static void RegistrarMenu(MenuEn _menu)
        {
            try
            {
                using (SqlConnection con = DataBaseManager.OpenSqlDatabase(user, pass, servidor, baseDatos))
                {
                    using (SqlCommand command = con.CreateCommand())
                    {
                        command.CommandText = "PA_MENU";
                        command.CommandType = System.Data.CommandType.StoredProcedure;

                        command.Parameters.AddWithValue("@ID_MENU", _menu.Id_menu);
                        command.Parameters.AddWithValue("@COD_OBJETO", _menu.Cod_objeto);
                        command.Parameters.AddWithValue("@DESC_MENU", _menu.Desc_menu);

                        command.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
        public static List<MenuEn> ConsultaMenu(UsuariosEn _usuario)
        {
            List<MenuEn> response = new List<MenuEn>();
            try
            {
                using (SqlConnection con = DataBaseManager.OpenSqlDatabase(user, pass, servidor, baseDatos))
                {
                    using (SqlCommand command = con.CreateCommand())
                    {
                        command.CommandText = "sp_consulta_menuxuser";
                        command.CommandType = System.Data.CommandType.StoredProcedure;

                        command.Parameters.AddWithValue("@p_username", _usuario.User_name);

                        using (SqlDataReader dr = command.ExecuteReader())
                        {
                            while (dr.Read())
                            {
                                MenuEn tmp = new MenuEn();

                                tmp.Cod_objeto = dr["cod_objeto"].ToString() ?? string.Empty;
                                tmp.Id_menu = dr["id_menu"] != DBNull.Value ?Convert.ToInt32(dr["id_menu"]) : 0;

                                response.Add(tmp);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return response;
        }
예제 #5
0
 public Rol_X_Menu()
 {
     rol  = new RolEn();
     menu = new MenuEn();
 }