public ActionResult OrderFulfillmentDetails(DateTime d)
        {
            OrderFulfillmentDetailsDAO detailsDAO = new OrderFulfillmentDetailsDAO();
            IList <OrderFulfillmentDetailsLineItemsModel> orderList = detailsDAO.getOrderList(d);

            OrderFulfillmentDetailsDAO showspecificsDAO = new OrderFulfillmentDetailsDAO();
            OrderFulfillmentDetailsDTO showdata         = showspecificsDAO.getShowDetails(d);

            OrderFulfillmentDetailsModel showdetails = new OrderFulfillmentDetailsModel()
            {
                Orders      = orderList, // IList of products
                Show_Date   = showdata.Show_Date,
                Product_ID  = showdata.Product_ID,
                Description = showdata.Description,
                VendorName  = showdata.VendorName
            };

            return(View(showdetails));
        }
Exemple #2
0
        public OrderFulfillmentDetailsDTO getShowDetails(DateTime date)
        {
            DateTime Show_Date = date.Date;
            OrderFulfillmentDetailsDTO showdetails = new OrderFulfillmentDetailsDTO();

            // needs to get the following: Show Date, Product ID, Product Desc, Vendor
            // Given a Show Date
            using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["gravyliveconnection"].ConnectionString))
            {
                connection.Open();

                string sql = @"SELECT [Product].[Product_ID] AS Product_ID
                                  ,[Product].[Description] AS Description
                                  ,[Product].[VendorName] AS VendorName
                                  ,[Show].[Show_Date] AS Show_Date
                              FROM [Product], [Show]
                                WHERE [Show].[Product_ID]=[Product].[Product_ID] AND Show_Date=@Show_Date;";
                showdetails = connection.QueryFirstOrDefault <OrderFulfillmentDetailsDTO>(sql, new { Show_Date });
            }

            return(showdetails);
        }