Ejemplo n.º 1
0
 public void SetMenuItem(MenuItemModel menuItem)
 {
     using (SQLiteCommand command = new SQLiteCommand(base.SQLConnection))
     {/*
       * command.CommandText =
       * @"UPDATE S_MENUS
       * SET MENU_NAME = " + ParameterString(menuItem.Name) + @"
       * , MENU_TEXT = " + ParameterString(menuItem.Text) + @"
       * , CSS_CLASS = " + ParameterString(menuItem.ClassCSS) + @"
       * WHERE ID = " + ParameterInt(menuItem.ID);
       * command.ExecuteNonQuery();*/
     }
 }
Ejemplo n.º 2
0
        public MenuItemModel GetMenuItem(int itemID)
        {
            MenuItemModel menuItem = null;

            using (SQLiteCommand command = new SQLiteCommand(base.SQLConnection))
            {
                command.CommandText =
                    @"SELECT mmi.ID
       , mmi.ITEM_TEXT
       , mmi.MENU_ID
       , mmi.PARENT_ID
       , mmi.MENU_ITEM_TYPE_ID
       , mmi.ORDER_NO 
       , mmi.ITEM_VALUE
       , mmi.LINK_AREA
       , mmi.LINK_CONTROLLER
       , mmi.LINK_ACTION
FROM S_MENU_ITEMS mmi
WHERE mmi.ID = " + ParameterInt(itemID);
                using (SQLiteDataReader dReader = command.ExecuteReader())
                {
                    if (dReader.HasRows && dReader.Read())
                    {
                        menuItem = new MenuItemModel
                        {
                            ID             = ParseInt(dReader["ID"].ToString()),
                            Text           = dReader["ITEM_TEXT"].ToString(),
                            MenuID         = ParseInt(dReader["MENU_ID"].ToString()),
                            ParentID       = ParseInt(dReader["PARENT_ID"].ToString()),
                            TypeID         = ParseInt(dReader["MENU_ITEM_TYPE_ID"].ToString()),
                            OrderNo        = ParseInt(dReader["ORDER_NO"].ToString()),
                            LinkValue      = dReader["ITEM_VALUE"].ToString(),
                            LinkArea       = dReader["LINK_AREA"].ToString(),
                            LinkController = dReader["LINK_CONTROLLER"].ToString(),
                            LinkAction     = dReader["LINK_ACTION"].ToString()
                        };
                    }
                }
                menuItem.TypeList = GetMenuItemTypes(menuItem.TypeID);
            }
            return(menuItem);
        }