예제 #1
0
        public ClsNodo ConsultaArbol()
        {
            List <ClsPantallasPerfil> LstPantallaPerfil = (from q in ClsPantallasPerfil.getList() where q.NumeroDePerfil == MoSesion.NumeroDePerfil select q).ToList();
            List <ClsMenu>            LstMenu           = (from q in ClsMenu.getList() orderby q.NumeroDeMenuPadre ascending, q.NumeroDeOrden ascending, q.NumeroDePantalla ascending select q).ToList();

            LstMenu.RemoveAll(f => (!LstPantallaPerfil.Exists(x => x.NumeroDePantalla == f.NumeroDePantalla)) && f.NumeroDeMenuPadre != 0);
            Dictionary <String, object> Informacion = new Dictionary <String, object>();

            Informacion.Add("Arbol de Nodos para Menú", "");
            ClsNodo NodoRaiz = new ClsNodo(0, Informacion);

            if (LstMenu.Count != 0)
            {
                foreach (var item in LstMenu)
                {
                    Informacion = new Dictionary <String, object>();
                    Informacion.Add("NombreInterno", item.NombreDePantallaInt);
                    Informacion.Add("NumeroDeMenu", item.NumeroDeMenu);
                    Informacion.Add("NombreDeMenu", item.NombreDeMenu);
                    Informacion.Add("NumeroDePantalla", item.NumeroDePantalla);
                    Informacion.Add("NombreDePantalla", item.NombreDePantalla);
                    Informacion.Add("NombreInternoDePantalla", item.NombreDePantallaInt);
                    Informacion.Add("NumeroDePadre", item.NumeroDeMenuPadre);

                    NodoRaiz.IntegraNodo(item.NumeroDeMenuPadre, new ClsNodo(item.NumeroDeMenu, Informacion));
                }
            }
            return(NodoRaiz);
        }
예제 #2
0
        //Lấy danh sách Menu từ  id Bàn chưa thanh toán
        public List <ClsMenu> getListMenu(int id)
        {
            List <ClsMenu> listMenu = new List <ClsMenu>();

            DataTable data = DataProvider.Instance.ExcuteQuery("SELECT d.name,db.count,d.price,d.price*db.count AS TotalPrice FROM dbo.DrinkBill AS db,dbo.drink AS d,dbo.Bill AS bi WHERE db.idBill = bi.id AND db.idDrink = d.id AND bi.status = 0 AND bi.idTable = " + id);

            foreach (DataRow item in data.Rows)
            {
                ClsMenu menu = new ClsMenu(item);
                listMenu.Add(menu);
            }

            return(listMenu);
        }
예제 #3
0
 protected void ObtenerMenuIzquierda(DataTable dtbArbol)
 {
     try
     {
         int       intCodigoUsuario = Session["CodigoUsuario"] == null ? 0 : (int)Session["CodigoUsuario"];
         int       intCodigoAcceso  = Session["CodigoAcceso"] == null ? 0 : (int)Session["CodigoAcceso"];
         DataTable dtbMenu          = new ClsMenu().ObtenerMenu(intCodigoUsuario, intCodigoAcceso);
         Session["MenuIzquierda"] = dtbMenu;
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #4
0
 private void OpcionMenu_Click(object sender, EventArgs e)
 {
     try
     {
         Form form = ClsMenu.FormPorNombre(ToolStripMenuItem).Tag, espacio);
         try
         {
             if (form != null)
                 form.Show();
             else
                 throw new Exception("Esta opción de Menú no tiene asignado o no esta creado su Formulario");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     catch (Exception ex)
     {
     }
 }