You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.5 KiB
81 lines
2.5 KiB
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using BWPMModels;
|
|
|
|
namespace BWPMWebForm.Models
|
|
{
|
|
public class MenuItem
|
|
{
|
|
public string ID { get; set; } = "";
|
|
|
|
public string text { get; set; } = "";
|
|
|
|
public string parentId { get; set; } = "";
|
|
|
|
public string url { get; set; } = "";
|
|
|
|
public string menuvalue { get; set; } = "";
|
|
|
|
public int? menutype { get; set; } = 0;
|
|
|
|
public int? sort { get; set; } = 0;
|
|
|
|
public DateTime? erstellt_am { get; set; } = DateTime.Now;
|
|
|
|
public DateTime? mutiert_am { get; set; } = DateTime.Now;
|
|
|
|
public int? mutierer { get; set; } = 0;
|
|
|
|
public bool? aktiv { get; set; } = true;
|
|
|
|
}
|
|
public class AppMenuItem
|
|
{
|
|
|
|
public string id { get; set; }
|
|
public string text { get; set; }
|
|
public string parentId { get; set; }
|
|
public string url { get; set; }
|
|
|
|
//public static List<AppMenuItem> MenuItems(string usertype)
|
|
public static List<object> MenuItems(string usertype)
|
|
{
|
|
|
|
|
|
Helper.HttpClientHelper httpcli = new Helper.HttpClientHelper();
|
|
httpcli.CallService("MenuItem", usertype, "GET", null);
|
|
if (httpcli.Results.resultstatus == true)
|
|
{
|
|
List<object> mis = new List<object>();
|
|
List<MenuItem> menus = JsonConvert.DeserializeObject<List<MenuItem>>(httpcli.Results.daten);
|
|
//List<AppMenuItem> mis = new List<AppMenuItem>();
|
|
|
|
//mis.Add (new AppMenuItem { id = "1", text = "Text 1", parentId = "", url = "Home" });
|
|
//mis.Add(new AppMenuItem { id = "2", text = "Text 2", parentId = "1", url = "Form" });
|
|
//mis.Add(new AppMenuItem { id = "3", text = "Text3", parentId = "null", url = "" });
|
|
//return mis;
|
|
|
|
foreach (MenuItem item in menus)
|
|
{
|
|
mis.Add(new AppMenuItem { id = item.ID, text = item.text, parentId = item.parentId, url = item.url });
|
|
}
|
|
|
|
return mis;
|
|
}
|
|
|
|
//ViewBag.DataSource = users;
|
|
|
|
//menus.Add(new MenuItem { id = "1", text = "Text 1", parentId = "", url="Home" });
|
|
//menus.Add(new MenuItem { id = "2", text = "Text 2", parentId = "1", url="Form"});
|
|
//menus.Add(new MenuItem { id = "3", text = "Text3", parentId = "null",url="" });
|
|
|
|
return null;
|
|
}
|
|
|
|
}
|
|
|
|
}
|