void Initialize() { Tabs = new Dictionary <string, GUIComponent>(); Icons = TextureManager.GetTexture(ContentPaths.GUI.icons); TabButtons = new List <Button>(); GUI = new DwarfGUI(Game, Game.Content.Load <SpriteFont>(ContentPaths.Fonts.Default), Game.Content.Load <SpriteFont>(ContentPaths.Fonts.Title), Game.Content.Load <SpriteFont>(ContentPaths.Fonts.Small), Input) { DebugDraw = false }; IsInitialized = true; Drawer = new Drawer2D(Game.Content, Game.GraphicsDevice); MainWindow = new GUIComponent(GUI, GUI.RootComponent) { LocalBounds = new Rectangle(EdgePadding, EdgePadding, Game.GraphicsDevice.Viewport.Width - EdgePadding * 2, Game.GraphicsDevice.Viewport.Height - EdgePadding * 2) }; Layout = new GridLayout(GUI, MainWindow, 11, 4); Layout.UpdateSizes(); Button back = new Button(GUI, Layout, "Back", GUI.DefaultFont, Button.ButtonMode.ToolButton, GUI.Skin.GetSpecialFrame(GUISkin.Tile.LeftArrow)); Layout.SetComponentPosition(back, 0, 10, 1, 1); back.OnClicked += back_OnClicked; Panel tabPanel = new Panel(GUI, Layout); Layout.SetComponentPosition(tabPanel, 0, 0, 4, 1); GridLayout tabLayout = new GridLayout(GUI, tabPanel, 1, 10) { EdgePadding = 10 }; CreateTabButton(tabLayout, "Employees", "Hire and fire dwarves", 5, 0); EmployeeDisplay employeeDisplay = new EmployeeDisplay(GUI, Layout, PlayState.Master.Faction) { IsVisible = false }; Tabs["Employees"] = employeeDisplay; CreateTabButton(tabLayout, "Assets", "Buy/Sell goods", 3, 1); GoodsPanel assetsPanel = new GoodsPanel(GUI, Layout, PlayState.Master.Faction) { IsVisible = false }; Tabs["Assets"] = assetsPanel; CreateTabButton(tabLayout, "Capital", "Financial report", 2, 1); CapitalPanel capitalPanel = new CapitalPanel(GUI, Layout, PlayState.Master.Faction) { IsVisible = false }; Tabs["Capital"] = capitalPanel; ButtonClicked(TabButtons[0]); }
public JsonResult GetOne(int?id) { if (id == null) { return(null); } Employee employeeModel = db.Employees.Find(id); EmployeeDisplay emp = new EmployeeDisplay(); emp.ID = employeeModel.ID; emp.name = employeeModel.name; emp.start_date = employeeModel.start_date; emp.end_date = employeeModel.end_date; emp.title = employeeModel.title; byte[] img = employeeModel.image; if (img != null) { string path = byteArrayToImage(img); emp.imageString = "data:image/jpeg;base64," + path; } return(Json(emp, JsonRequestBehavior.AllowGet)); }
public OrderInfo ConvertBusinessToPresentation(Order businessEntity) { OrderInfo orderInfo = new OrderInfo(); if (businessEntity.OrderId > 0) { orderInfo.OrderId = businessEntity.OrderId.ToString(CultureInfo.CurrentCulture); } else { orderInfo.OrderId = Resources.DraftStatusDescription; } orderInfo.OrderName = businessEntity.OrderName; orderInfo.Description = businessEntity.Description; orderInfo.Address = businessEntity.ShipAddress; orderInfo.City = businessEntity.ShipCity; orderInfo.PostalCode = businessEntity.ShipPostalCode; orderInfo.State = businessEntity.ShipRegion; ConvertOrderStatus(businessEntity, orderInfo); Customer customer = _customerService.GetCustomerById(businessEntity.CustomerId); orderInfo.CustomerName = customer.CompanyName; Employee employee = _employeeService.GetEmployeeById(businessEntity.Approver); EmployeeDisplay employeeDisplay = _employeeConverter.ConvertBusinessToPresentation(employee); orderInfo.Approver = employeeDisplay.Name; if (businessEntity.Details != null) { orderInfo.OrderTotal = businessEntity.OrderTotal; } return(orderInfo); }
void Initialize() { Tabs = new Dictionary<string, GUIComponent>(); Icons = TextureManager.GetTexture(ContentPaths.GUI.icons); TabButtons = new List<Button>(); GUI = new DwarfGUI(Game, Game.Content.Load<SpriteFont>(ContentPaths.Fonts.Default), Game.Content.Load<SpriteFont>(ContentPaths.Fonts.Title), Game.Content.Load<SpriteFont>(ContentPaths.Fonts.Small), Input) { DebugDraw = false }; IsInitialized = true; Drawer = new Drawer2D(Game.Content, Game.GraphicsDevice); MainWindow = new GUIComponent(GUI, GUI.RootComponent) { LocalBounds = new Rectangle(EdgePadding, EdgePadding, Game.GraphicsDevice.Viewport.Width - EdgePadding * 2, Game.GraphicsDevice.Viewport.Height - EdgePadding * 2) }; Layout = new GridLayout(GUI, MainWindow, 11, 4); Layout.UpdateSizes(); Button back = new Button(GUI, Layout, "Back", GUI.DefaultFont, Button.ButtonMode.ToolButton, GUI.Skin.GetSpecialFrame(GUISkin.Tile.LeftArrow)); Layout.SetComponentPosition(back, 0, 10, 1, 1); back.OnClicked += back_OnClicked; Panel tabPanel = new Panel(GUI, Layout); Layout.SetComponentPosition(tabPanel, 0, 0, 4, 1); GridLayout tabLayout = new GridLayout(GUI, tabPanel, 1, 10) { EdgePadding = 10 }; CreateTabButton(tabLayout, "Employees", "Hire and fire dwarves", 5, 0); EmployeeDisplay employeeDisplay = new EmployeeDisplay(GUI, Layout, PlayState.Master.Faction) { IsVisible = false }; Tabs["Employees"] = employeeDisplay; CreateTabButton(tabLayout, "Assets", "Buy/Sell goods", 3, 1); GoodsPanel assetsPanel = new GoodsPanel(GUI, Layout, PlayState.Master.Faction) { IsVisible = false }; Tabs["Assets"] = assetsPanel; CreateTabButton(tabLayout, "Capital", "Financial report", 2, 1); CapitalPanel capitalPanel = new CapitalPanel(GUI, Layout, PlayState.Master.Faction) { IsVisible = false }; Tabs["Capital"] = capitalPanel; ButtonClicked(TabButtons[0]); }