Example #1
0
        public StockUI()
        {
            InitializeComponent();

            container          = Logic.DI_Container.Configure();
            stockBusinessLogic = container.Resolve <IStockBusinessLogic>();

            stockBusinessLogic.NewStockItemList();
        }
Example #2
0
        /// <summary>
        /// Method used to get productivity info
        /// </summary>
        /// <param name="stockBusinessLogic">The stock business logic info</param>
        private static void GetProductivityInfo(IStockBusinessLogic stockBusinessLogic)
        {
            var stock = HttpContext.Current.Request.QueryString["stock"];

            using (var page = new Page())
            {
                var stockInfo = stockBusinessLogic.GetStocks().FirstOrDefault(s => string.Equals(s.Name, stock));
                if (stockInfo == null)
                {
                    return;
                }

                var ctrl = (ProductivityControl)page.LoadControl("~/Controls/ProductivityControl.ascx");
                ctrl.Productivity = stockBusinessLogic.GetStockProductivity(stockInfo);
                page.Controls.Add(ctrl);
                using (var writer = new StringWriter())
                {
                    page.Controls.Add(ctrl);
                    HttpContext.Current.Server.Execute(page, writer, false);
                    HttpContext.Current.Response.Write(writer.ToString());
                    HttpContext.Current.Response.Flush();
                }
            }
        }
Example #3
0
 public HomeController(IStockBusinessLogic stockBusinessLogic)
 {
     this._stockBusinessLogic = stockBusinessLogic;
 }