text:
<file_sep>@model DataLayer.Entities.CookingInstruction
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Cooking Instructions";
}

            @{
                Html.RenderAction("CookingInstrItems");
            }

            @using (Ajax.BeginForm("AddInsrtruction", new { val = 1 }, new AjaxOptions { HttpMethod = "POST", OnSuccess = "NewCookingInstrItem" }, new { id = "myForm" }))
            {
                @Html.HiddenFor(m => m.Id, new { id = "InstrId" })

                        Item

                        @Html.TextBoxFor(m => m.Title, new { id = "text", @style = "width: 84%;" })
                        @*<input type="text" id="text" style="width: 84%;" />*@

                @*

                        Toppings

                        @Html.TextAreaFor(m => m.Toppings, new { id = "toppings" })
                        @*<textarea id="toppings"></textarea>*@

                <fieldset>
                    <legend>Fonts</legend>

Size

                                    @Html.DropDownListFor(m => m.FontSize, new List<SelectListItem>
                                    {
                                       new SelectListItem{  Text="22px" , Value="22px" },
                                    new SelectListItem{  Text="14px" , Value="14px" },
                                    new SelectListItem{  Text="16px" , Value="16px" },
                                    new SelectListItem{  Text="18px" , Value="18px" },
                                    new SelectListItem{  Text="20px" , Value="20px" },
                                    new SelectListItem{  Text="24px" , Value="24px" },
                                    new SelectListItem{  Text="26px" , Value="26px" },
                                    new SelectListItem{  Text="28px" , Value="28px" },
                                    new SelectListItem{  Text="30px" , Value="30px" },
                                    new SelectListItem{  Text="32px" , Value="32px" },
                                    new SelectListItem{  Text="0px" , Value="0px" },
                                    }, new { id = "fontsize" })

                                        Style

                                            @Html.DropDownListFor(m => m.TextStyle, new List<SelectListItem>
                                    {
                                    new SelectListItem{  Text="Times New Roman" , Value="Times-New-Roman" },
                                    new SelectListItem{ Text="Verdana", Value = "Verdana" },
                                    new SelectListItem{ Text="Comic-Sans-MS", Value = "Comic-Sans-MS" },
                                    new SelectListItem{ Text="WildWest", Value = "WildWest" },
                                    new SelectListItem{ Text="Bedrock", Value = "Bedrock" },
                                    new SelectListItem{ Text="Arial", Value = "Arial" },
                                    new SelectListItem{ Text="Courier", Value = "Courier" },
                                    new SelectListItem{ Text="Tahoma", Value = "Tahoma" },
                                    new SelectListItem{ Text="Comic-Sans-MS", Value = "Comic-Sans-MS" },
                                    new SelectListItem{ Text="sans-serif", Value = "sans-serif" },
                                    }, new { id = "fontstyle" })

@Html.CheckBoxFor(m => m.IsBold, new { id = "isBold" })Bold  @*<input type="checkbox" id="isBold" />Bold*@

@Html.CheckBoxFor(m => m.IsItalic, new { id = "isitalic" })italic  @*<input type="checkbox" id="isitalic" />italic*@

Text color

                                <input id="textcolor" type="color" class="colorfields" value="#ffffff" name="TextColor" />

Button color

                                <input id="btncolor" type="color" name="BackgroundColor" class="colorfields" value="#ffffff" />

                </fieldset>

                <fieldset>
                    <legend>Menu Buttons</legend>

                            <button class="menuBtn btn-success" id="addCookInstrItem" type="submit">Add Item</button>

                            <button class="menuBtn btn-danger" id="deleteCookInstrItem" type="button">Delete Item</button>

                            <button class="menuBtn btn-info" id="UpdateCookInstrItem" type="button" disabled>Update Item</button>

                </fieldset>
            }

            @*

                        @using (Ajax.BeginForm("DeleteAllItems", new AjaxOptions { HttpMethod = "POST", OnSuccess = "DeleteAllSuccess" }))
                        {
                            @Html.Hidden("CategoryId", null, new { id = "deleteAllCatId" })
                            <button class="menuBtn btn-danger" id="deleteAll" type="submit">Delete All </button>
                        }

*@

 <button class="btn customBttn1 redBg" style="height:48px !important;" onclick="location.href='@Url.Action("MenuItem", "ManagementSection")'">Back</button>

<file_sep>
    @{
        Layout = "~/Views/Shared/_Layout.cshtml";
        ViewBag.Title = "Take Away";
    }
    <!DOCTYPE html>

                    @{
                        int catId = 1;
                        var OrdersList = (ProjectMy.Models.RepeatOrderViewModel)ViewData["OrderDetailsList"];
                        var id = ViewData["CategoryID"];
                        if (id != null)
                        {
                            catId = Convert.ToInt32(id);
                        }
                        Html.RenderAction("TakeAwayItems", "Home", new { categoryId = catId });
                    }

                                        Qty
                                        Description
                                        Price

                                    @foreach (var item in OrdersList.OrderDetails)
                                    {

                                            @item.ItemQty
                                            @item.ItemName
                                            @item.Amount

                                    }

<button class="BtnOpt" id="plus">+</button>

<button class="BtnOpt" id="minus">-</button>

<button class="BtnOpt" id="miscItem">Misc Item</button>

<button class="BtnOpt" id="editPrice">Edit Price</button>

Total

:

@OrdersList.Total

<button class="redBg orderBtn" id="canelOrder">Cancel Order</button>

<button class="greenBg orderBtn" id="orderCmplt">Order Complete</button>

<button class="customBttn1 skyBlueBg">Meal Deals</button>

<button class="customBttn1 greenBg">Cook Inst</button>

 <button class="customBttn1 redBg">No</button>

<button class="customBttn1 greenBg" id="toppings">Extras / Toppings</button>

 <button class="customBttn1 redBg" onclick="location.href='@Url.Action("TakeAwayHome", "Home")'">Back</button>

                @{
                    Html.RenderAction("GetCategories");
                }

                @{
                    Html.RenderAction("GetSizesPartial", "Home", new { categoryId = catId });
                }

                @{
                    Html.RenderAction("GetExtrasPartial", "Home", new { categoryId = catId });
                }

                    Please Select Free Pizza ...

            <input type="hidden" value="@ViewBag.ordertype" id="orderType" />
            <form action="@Url.Action("OrderComplete","Home")" id="formPost" method="post" hidden>

            </form>

<file_sep>
@{
    Layout = null;
}

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/styles/style.css" rel="stylesheet" />
    <title>DataFiles</title>

            45 Minute Delay - @DateTime.Now.ToString("dd/MM/yyyy")

            Data Files

            @DateTime.Now.ToString("HH:mm:ss")

        <button class="largeButton skyBlueBackg" onclick="location.href='@Url.Action("DefineCategories", "ManagementSection")'">
            Menu Items
        </button>

        <button class="largeButton skyBlueBackg"  onclick="location.href='@Url.Action("MenuItem", "ManagementSection")'">
            Item Categories
        </button>

        <button class="smallBtn skyBlueBackg">
            Customers List
        </button>
        <button class="smallBtn skyBlueBackg">
            Customers
        </button>

        <button class="largeButton skyBlueBackg">
            Staff
        </button>

        <button class="largeButton skyBlueBackg">
            Suppliers & Contracts
        </button>

        <button class="largeButton skyBlueBackg">
            Recipes
        </button>

        <button class="smallBtn skyBlueBackg">
            Adress Lables
        </button>
        <button class="smallBtn skyBlueBackg">
            Win
        </button>

        <button class="largeButton skyBlueBackg">
            Cancel Reason Options
        </button>

        <button class="largeButton skyBlueBackg">
            Discount Reason Options
        </button>

        <button class="largeButton skyBlueBackg">
            Refunf Reason Options
        </button>

        <button class="largeButton skyBlueBackg">
            Expense Item Options
        </button>

        <button class="largeButton skyBlueBackg">
            Waste Reason Options
        </button>

        <button class="largeButton redBg" onclick="location.href='@Url.Action("ManagementSection", "ManagementSection")'">
            Exit
        </button>

<file_sep>
@model IEnumerable<DataLayer.Entities.Category>

@foreach (var item in Model)
{

        @Ajax.ActionLink(item.Title, "MenuItems", new { categoryId = item.Id }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "itemsArea", InsertionMode = InsertionMode.Replace }, new { @class = "btn extrasCat", @style = "background-color:" + item.BackgroundColor + ";color:" + item.TextColor + ";" })
        <input type="hidden" value="@item.Id" />

}

<file_sep>/// <reference path="../jquery-3.1.1.min.js" />

$(document).ready(function () {

    var totalAmount = 0;
    $('.tableBody tr').each(function () {
        if (!this.rowIndex) return; // skip first row

        totalAmount = parseFloat(totalAmount) + parseFloat(this.cells[2].innerHTML);

    });
    $('#totalAmount').text(totalAmount.toFixed(2));
    $('#Subtotal').text(totalAmount.toFixed(2));

    $(function () {
        $("#discountDiv").dialog({
            autoOpen: false,
            width: 800,
            position: { my: 'top', at: 'top+20' },
            modal: true,
            buttons: {
                Ok: function () {

                    $('#discountDiv').dialog("close");
                },
                Cancel: function () {

                    $('#discountDiv').dialog("close");
                }
            },
            show: {
                effect: "blind",
                duration: 100
            },
            hide: {
                effect: "explode",
                duration: 100
            }
        });
    });

    $('#discountBtn').on('click', function () {
        $('#discountDiv').load("/Home/Discounts");
        $("#discountDiv").dialog("open");
    });

    $('#fullAmount').on("click", function () {

        $('#paidAmount').text(totalAmount.toFixed(2));
        var balance = parseFloat($('#paidAmount').text()) - parseFloat($('#totalAmount').text());

        $('#balance').text(balance.toFixed(2));
    });

    $('#cancelOrder').on('click', function (evt) {
        if (!confirm("Are you sure to Cancel this Order ?")) {
            evt.preventDefault();
        }
        //else {

        //}
    });

    $('#exit').on('click', function (evt) {
        if (confirm("Are you sure to Leave this Page ?")) {

        }
        else {
            evt.preventDefault();
        }
    });

    $('.CustomfBtn').on("click", function () {
        var amount = $('#paidAmount').text();
        var numb = $(this).find("span").text();
        $('#paidAmount').text(numb);
        var balance = parseFloat($('#paidAmount').text()) - parseFloat($('#totalAmount').text());

        $('#balance').text(balance.toFixed(2));
    });

    $('.CustomPercBtn').on("click", function () {
        var amount = $('#paidAmount').text();
        var numb = $(this).find("span").text();

        var calculated = (numb / 100) * totalAmount;

        $('#paidAmount').text(calculated);
        var balance = parseFloat($('#paidAmount').text()) - parseFloat($('#totalAmount').text());

        $('#balance').text(balance.toFixed(2));
    });

    $('#doublezero').on("click", function () {
        var paidamount = $('#paidAmount').text();
        var numb = $(this).text();

        var newAmount = 0;
        if (parseFloat(paidamount) > 0) {
            var newAmount = paidamount + numb;
            $('#paidAmount').text(newAmount.toFixed(2));
            var balance = parseFloat($('#paidAmount').text()) - parseFloat($('#totalAmount').text());

            $('#balance').text(balance.toFixed(2));
        }

    });

    $('.calculatorBtn').on("click", function () {
        var amount = $('#paidAmount').text();
        var numb = $(this).text();
        var newAmount = amount + numb;
        $('#paidAmount').text(newAmount);
        var balance = parseFloat($('#paidAmount').text()) - parseFloat($('#totalAmount').text());

        $('#balance').text(balance.toFixed(2));
    })

    $('#clearCash').on("click", function (evt) {

        if ($('#balance').text() === "") {
            evt.preventDefault();
            alert("Amount is not Cleared Yet...");
        }
        else {
            var ordersDetails = [];

            $('.tableBody tr').each(function () {
                if (!this.rowIndex) { return; }
                Quantity = this.cells[0].innerHTML;
                productName = this.cells[1].innerHTML;
                amount = this.cells[2].innerHTML;

                var item = { ItemName: productName, ItemQty: parseInt(Quantity), Amount: parseFloat(amount) };

                ordersDetails.push(item);
            });

            var totalpaid = $('#paidAmount').text();
            var totalAmount = $('#totalAmount').text();
            var balance = $('#balance').text();
            var discount = 0;
            var order = {
                OrderTypeName: 'Take Away', TotalAmount: parseFloat(totalAmount), TotalPaid: parseFloat(totalpaid), Discount: parseFloat(discount), Balance: parseFloat(balance), PaymentTypeId: 1
            }

            addOrder(ordersDetails, order);
        }
    });

    $('#print').on('click', function (evt) {

        if ($('#balance').text() === "") {
            evt.preventDefault();
            alert("Amount is not Cleared Yet...");
        }
        else {
            var itemsList = [];

            $('.tableBody tr').each(function () {
                if (!this.rowIndex) return; // skip first row
                Quantity = this.cells[0].innerHTML;
                productName = this.cells[1].innerHTML;
                totalAmount = this.cells[2].innerHTML;

                var item = { ItemName: productName, ItemQty: Quantity, ItemTotalPrice: totalAmount };

                itemsList.push(item);
            });
            var customerName = $('#CustomerName').val();
            var totalAmount1 = $('#totalAmount').text();
            var totalpaid = $('#paidAmount').text();
            var balance = $('#balance').text();
            var model1 = {
                ordersItems: itemsList,
                CustomerName: customerName,
                TotalAmount: parseFloat(totalAmount1),
                totalpaid: parseFloat(totalpaid),
                balance: parseFloat(balance)
            };
            PrintReciept(model1);
        }

        //if ($('#balance').text() == "") {
        //    evt.preventDefault();
        //    alert("Amount is not Paid Yet...");
        //}
        //else {
        //    var prtContent = document.getElementById('operationsArea');
        //    var WinPrint = window.open('', '', 'letf=100,top=100,width=600,height=600');
        //    WinPrint.document.write(prtContent.innerHTML);
        //    WinPrint.document.close();
        //    WinPrint.focus();
        //    WinPrint.print();
        //}
    });

});

function PrintReciept(model1) {

    $.ajax({
        url: '/Home/PrintOrder',
        type: 'POST',
        data: JSON.stringify({ model: model1 }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            alert(data);
        },
        error: function (request, error) {
            alert("request: " + error);
        }
    });
};
function addOrder(ordersDetails, order) {

    $.ajax({
        url: '/Home/ClearCash',
        type: 'POST',
        data: JSON.stringify({ 'ordersDetails': ordersDetails, 'order': order }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            window.location.href = "/Home/TakeAway";
        },
        error: function (request, error) {
            alert("request: " + error);
        }
    });
};
<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Models
{
    public class AddOrderModel
    {
        public Order order { get; set; }
        public OrderDetail orderDetail { get; set; }
    }
}
<file_sep>using DataLayer.DAC;
using ProjectMy.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjectMy.Controllers
{
    public class DeliveryManagementController : Controller
    {
        [HttpGet]
        public ActionResult AssigntoDriver()
        {
            var Deliveries = DAC.GetUnAssignedDeliveries();
            List<DeliveriesViewModel> deliveryorders = new List<DeliveriesViewModel>();
            foreach (var ord in Deliveries)
            {
                var order = DAC.GetOrder(ord.OrderId);
                var customer = DAC.FindCustomerById(order.CustomerId);
                DeliveriesViewModel deliveryOrder = new DeliveriesViewModel()
                {
                    DeliveryId = ord.Id,
                    OrderNo = order.OrderId,
                    Time = order.Date.ToString("HH:mm:ss"),
                    Address = customer.Address1 + " " + customer.Address2,
                    TotalAmount = order.TotalAmount,
                    Name = customer.FirstName + " " + customer.SurName,
                    Telephone = customer.Phone,
                    PostCode = customer.PostCode
                };

                deliveryorders.Add(deliveryOrder);
            }
            return View(deliveryorders);
        }

        [HttpGet]
        public ActionResult SelectDriver()
        {
            var Drivers = DAC.GetAllDriversFromStatff();
            return PartialView("_SelectDriver", Drivers);
        }

        [HttpPost]
        public ActionResult AddtoDriverPayment(int[] DeliveryOrders, int DriverId)
        {
            foreach (var id in DeliveryOrders)
            {
                DAC.AssignDriver(id, DriverId);
            }
            return Json(true, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public ActionResult DriverPayments()
        {
            var result = DAC.GetUnPaidDeliveries();
            List<DriverPaymentViewModel> driverpaymentLsit = new List<DriverPaymentViewModel>();

            foreach (var item in result)
            {
                DriverPaymentViewModel model = new DriverPaymentViewModel()
                {
                    DriverId = item.AssignedDriverId,
                    Name = DAC.GetDriverName(item.AssignedDriverId),
                    Total = DAC.GetOrderTotal(item.OrderId),
                    Paid = 0,
                    Trips = 1
                };

                driverpaymentLsit.Add(model);
            }
            var answer = driverpaymentLsit.GroupBy(m => m.DriverId)
                            .Select(c => new DriverPaymentViewModel
                            {
                                Total = c.Sum(cc => cc.Total),
                                Trips = c.Count(),
                                DriverId = c.First().DriverId,
                                Name = c.First().Name,
                                Balance = c.Sum(cc => cc.Total) - c.First().Paid
                            }).ToList();

            return View(answer);
        }

        [HttpGet]
        public ActionResult ViewDriverPymentDetails(int id)
        {
            var Deliveries = DAC.GetDriverDeliveries(id);
            List<DeliveriesViewModel> deliveryorders = new List<DeliveriesViewModel>();
            foreach (var ord in Deliveries)
            {
                var order = DAC.GetOrder(ord.OrderId);
                var customer = DAC.FindCustomerById(order.CustomerId);
                DeliveriesViewModel deliveryOrder = new DeliveriesViewModel()
                {
                    DeliveryId = ord.Id,
                    OrderNo = order.OrderId,
                    Time = order.Date.ToString("dd/MM/yyyy") + " " + order.Date.ToString("HH:mm:ss"),
                    Address = customer.Address1 + " " + customer.Address2,
                    TotalAmount = order.TotalAmount,
                    Name = customer.FirstName + " " + customer.SurName,
                    Telephone = customer.Phone,
                    PostCode = customer.PostCode,
                    Status = ((Constants.PaymentStatus)order.Status).ToString()
                };

                deliveryorders.Add(deliveryOrder);
            }
            return View(deliveryorders);
        }

        [HttpGet]
        public ActionResult DriverPaymentView()
        {
            return PartialView();
        }

        [HttpGet]
        public ActionResult MakePayment()
        {
            return PartialView("_MakePayment");
        }
    }
}<file_sep>
@{
    Layout = null;
}

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/styles/style.css" rel="stylesheet" />

    <title>Home</title>

            @*45 Minute Delay -*@
            @DateTime.Now.ToString("dd/MM/yyyy")

            Reports

            @DateTime.Now.ToString("HH:mm:ss")

        <button onclick="location.href='@Url.Action("DailySales", "ReportsManagement")'">
            Daily Sales
        </button>

        <button class="largeBtn skyBlueBg" onclick="location.href='@Url.Action("WeeklySales", "ReportsManagement")'">
            Weekly Sales
        </button>

        <button class="largeBtn greenBg" onclick="location.href='@Url.Action("MonthlySales", "ReportsManagement")'">
            Monthly Sales
        </button>

        <button class="largeBtn orangeBg">

        </button>

        <button class="largeBtn orangeBg">

        </button>

        <button class="largeBtn whiteBg">

        </button>

        <button class="largeBtn backBtn" onclick="location.href='@Url.Action("MainMenu", "Home")'">
            Back
        </button>

<file_sep>
@{
    Layout = null;
}

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/styles/style.css" rel="stylesheet" />

    <title>Management Section</title>

            45 Minute Delay - @DateTime.Now.ToString("dd/MM/yyyy")

            Management Section

            @DateTime.Now.ToString("HH:mm:ss")

        <button class="largeBtn whiteBg" onclick="location.href='@Url.Action("DataFiles", "ManagementSection")'">
            Reports
        </button>

        <button class="largeBtn skyBlueBg" onclick="location.href='@Url.Action("DataFiles", "ManagementSection")'">
            Data Files
        </button>

        <button class="largeBtn greenBg">
            Settings
        </button>

        <button class="largeBtn orangeBg">
            Expences
        </button>

        <button class="largeBtn orangeBg">
            Time Delay
        </button>

        <button class="largeBtn whiteBg">
            Stock Control
        </button>

        <button class="largeBtn backBtn" onclick="location.href='@Url.Action("MainMenu", "Home")'">
            Back
        </button>

<file_sep>using DataLayer.DAC;
using DataLayer.Entities;
using ProjectMy.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjectMy.Controllers
{
    public class ManagementSectionController : Controller
    {
        public ActionResult ManagementSection()
        {
            return View();
        }

        public ActionResult DataFiles()
        {
            return View();
        }

        [HttpGet]
        public ActionResult MenuItem()
        {
            return View(new Item());
        }

        public ActionResult MenuItem2(string category = "Pizza")
        {
            ViewBag.name = category;
            return View("MenuItem");
        }

        public ActionResult MealDeal()
        {
            return View();
        }

        public ActionResult Course()
        {
            return View();
        }

        [HttpGet]
        public PartialViewResult MenuItems(int? categoryId = 1)
        {
            List<Item> Items = DAC.GetItemsByCategoryId(categoryId);
            List<ItemViewModel> ViewItems = new List<ItemViewModel>();
            foreach (var item in Items)
            {
                ItemViewModel viewitem = new ItemViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;
                viewitem.FontSize = item.FontSize;

                viewitem.Toppings = item.Toppings;
                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                ViewItems.Add(viewitem);
            }

            return PartialView("_MenuItems", ViewItems);
        }

        [HttpPost]
        public JsonResult AddItem(Item model)
        {
            if (model != null)
            {
                var item = DAC.AddItem(model);

                ItemViewModel viewitem = new ItemViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;
                viewitem.Toppings = item.Toppings;
                viewitem.FontSize = item.FontSize;

                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                return Json(viewitem, JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Please add Information", JsonRequestBehavior.AllowGet);

        }

        [HttpGet]
        public ActionResult DefineCategories()
        {
            return View(DAC.GetAllCategories());
        }

        [HttpPost]
        public ActionResult DefineCategories(Category category)
        {
            if (category != null)
            {
                DAC.AddCategory(category);
                return Json("Category added", JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Please add Information", JsonRequestBehavior.AllowGet);
        }

        [ChildActionOnly]
        public PartialViewResult GetCategories()
        {
            return PartialView("_Categories", DAC.GetAllCategories());
        }

        [HttpPost]
        public JsonResult DeleteItem(int? id)
        {
            if (id != null)
            {
                DAC.DeleteItemById(id);
                return Json("Item Deleted", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult DeleteExtra(int? id)
        {
            if (id != null)
            {
                DAC.DeleteExtraById(id);
                return Json("Item Deleted", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult DeleteSize(int? id)
        {
            if (id != null)
            {
                DAC.DeleteSizeById(id);
                return Json("Item Deleted", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult DeleteCategory(int? id)
        {
            if (id != null)
            {
                DAC.DeleteCategoryItemById(id);
                return Json("Item Deleted", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        public JsonResult DeleteMultipleItemsItem(int[] ids)
        {
            string message = Convert.ToString(ids.Count()) + " Deleted";
            if (ids.Count() > 0)
            {
                DAC.DeleteMultipleItems(ids);
                return Json(message, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("Invalid data passed.", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult EditItem(Item Newitem)
        {
            if (Newitem != null)
            {
                Item item = DAC.UpdateItem(Newitem);

                ItemViewModel viewitem = new ItemViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;
                viewitem.Toppings = item.Toppings;
                viewitem.FontSize = item.FontSize;

                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                return Json(viewitem, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult EditExtra(ExtrasAndTopping extraItem)
        {
            if (extraItem != null)
            {
                DAC.UpdateExtrasItem(extraItem);
                return Json("Item Updated", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult EditSize(Size sizeItem)
        {
            if (sizeItem != null)
            {
                DAC.UpdateSize(sizeItem);
                return Json("Item Updated", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpPost]
        public JsonResult EditCategory(Category category)
        {
            if (category != null)
            {
                DAC.UpdateCategory(category);
                return Json("Item Updated", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("No Value Passed", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpGet]
        public ActionResult Sizes()
        {
            return View();
        }

        [HttpPost]
        public JsonResult Sizes(Size size = null)
        {
            if (size != null)
            {
                var Item = DAC.AddSize(size);
                return Json(Item, JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Operation Failed because no inofrmation added.", JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public PartialViewResult GetCategorySizes(int categoryId = 1)
        {
            return PartialView("_Sizes", DAC.GetSizesByCategoryId(categoryId));
        }

        [ChildActionOnly]
        public PartialViewResult GetSizeCategories()
        {
            return PartialView("_CategoriesSize", DAC.GetAllCategories());
        }

        [HttpGet]
        public ActionResult Prices()
        {
            return View();
        }

        [ChildActionOnly]
        public PartialViewResult GetPriceCategories()
        {
            return PartialView("_PriceCategories", DAC.GetAllCategories());
        }

        [HttpGet]
        public PartialViewResult GetCategoryPrices(int categoryId = 1)
        {
            PriceViewModel prices = new PriceViewModel();
            prices.CategoryName = DAC.GetCategoryById(categoryId).Title;
            prices.Items = DAC.GetItemsByCategoryId(categoryId);
            prices.sizes = DAC.GetSizesByCategoryId(categoryId);
            return PartialView("_CategoryPrices", prices);
        }

        [HttpGet]
        public PartialViewResult DefinePrice(int item, int category)
        {
            return PartialView("_DefinePrice");
        }

        [HttpPost]
        public JsonResult AddPrice()
        {
            return Json("", JsonRequestBehavior.AllowGet);
        }
        [HttpPost]
        public JsonResult UpdatePrices(PriceModel prices)
        {
            if (prices != null)
            {
                Item item = new Item()
                {
                    Id = prices.ItemId,
                    Price1 = prices.price1,
                    Price2 = prices.price2,
                    Price3 = prices.price3
                };
                DAC.UpdatedPrices(item);
                return Json("Updated Successfully", JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Invalid Information Entered", JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public JsonResult UpdateExtrasPrices(PriceModel prices)
        {
            if (prices != null)
            {
                ExtrasAndTopping item = new ExtrasAndTopping()
                {
                    Id = prices.ItemId,
                    Price1 = prices.price1,
                    Price2 = prices.price2,
                    Price3 = prices.price3
                };
                DAC.UpdateExtrasPrices(item);
                return Json("Updated Successfully", JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Invalid Information Entered", JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public ActionResult Extras()
        {
            return View();
        }
        [ChildActionOnly]
        public PartialViewResult CategoryExtras()
        {
            var extras = DAC.GetExtrasByCategoryId(1);
            if (extras != null)
            {
                return PartialView("_CategoryExtras", extras);
            }
            else
            {
                return PartialView("_CategoryExtras", new List<ExtrasAndTopping>());
            }

        }

        [HttpGet]
        public PartialViewResult ExtrasPrices(int cat)
        {
            List<ExtrasAndTopping> extras = new List<ExtrasAndTopping>();
            if (cat == 1)
            {
                extras = DAC.GetAllToppings();
                return PartialView("_ToppingsPrices", extras);
            }
            else
            {
                extras = DAC.GetAllExtras();
                return PartialView("_ExtrasPrices", extras);
            }

        }

        [HttpGet]
        public PartialViewResult CategoryExtras(int categoryId = 1)
        {
            var extras = DAC.GetExtrasByCategoryId(categoryId);
            if (extras != null)
            {
                return PartialView("_CategoryExtras", extras);
            }
            else
            {
                return PartialView("_CategoryExtras", new List<ExtrasAndTopping>());
            }
        }

        [ChildActionOnly]
        public PartialViewResult CategoriesForExtras()
        {
            return PartialView("_CategoriesForExtras", DAC.GetAllCategories());
        }

        [HttpPost]
        public JsonResult AddExrtaItem(ExtrasAndTopping extra)
        {
            if (extra == null)
            {
                return Json("Erro : Invalid Data Added", JsonRequestBehavior.AllowGet);
            }
            else
            {
                var Item = DAC.AddExtra(extra);
                return Json(Item, JsonRequestBehavior.AllowGet);
            }
        }

        [HttpGet]
        public ActionResult CookingInsrtuctions()
        {
            return View();
        }

        public JsonResult DeleteAllItems(int CategoryId = -1)
        {
            var responce = DAC.DeleteAllItemsByCategory(CategoryId);
            if (responce)
            {
                return Json("All Items are Deleted.", JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json("Error : something went wrong.", JsonRequestBehavior.AllowGet);
            }
        }

        [HttpGet]
        public ActionResult CookingInstructions()
        {
            return View(new CookingInstruction());
        }

        [ChildActionOnly]
        public ActionResult CookingInstrItems()
        {
            List<CookingInstruction> Items = DAC.GetAllCookInst();
            List<CookingInstrViewModel> ViewItems = new List<CookingInstrViewModel>();
            foreach (var item in Items)
            {
                CookingInstrViewModel viewitem = new CookingInstrViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;
                viewitem.FontSize = item.FontSize;

                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                ViewItems.Add(viewitem);
            }
            return PartialView("_CookingInstrItems", ViewItems);
        }

        [HttpPost]
        public ActionResult AddInsrtruction(CookingInstruction model)
        {
            if (model != null)
            {
                var item = DAC.AddCookInstr(model);

                CookingInstrViewModel viewitem = new CookingInstrViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;

                viewitem.FontSize = item.FontSize;

                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                return Json(viewitem, JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Please add Information", JsonRequestBehavior.AllowGet);

        }

        [HttpPost]
        public JsonResult UpdateCookingInstr(CookingInstruction model)
        {
            if (model != null)
            {
                var item = DAC.UpdateCookingInstr(model);

                CookingInstrViewModel viewitem = new CookingInstrViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;

                viewitem.FontSize = item.FontSize;

                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                return Json(viewitem, JsonRequestBehavior.AllowGet);
            }
            else
                return Json("Please add Information", JsonRequestBehavior.AllowGet);

        }

        public JsonResult DeleteCookingInstr(int value)
        {
            return Json(DAC.DeleteCookingInstr(value),JsonRequestBehavior.AllowGet);
        }
    }
}<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class TakeAwayItemsModel
    {
        public List<Size> sizes { get; set; }

        public List<Item> items { get; set; }

        public List<ExtrasAndTopping> Extras { get; set; }

    }
}<file_sep>@model IEnumerable<ProjectMy.Models.DailySalesReportViewModel>

            @Html.DisplayNameFor(model => model.Date)

            @Html.DisplayNameFor(model => model.Day)

            @Html.DisplayNameFor(model => model.TotalSale)

    @foreach (var item in Model)
    {

                @Html.DisplayFor(modelItem => item.Date)

                @Html.DisplayFor(modelItem => item.Day)

                @Html.DisplayFor(modelItem => item.TotalSale)

    }

<file_sep>@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Sales Reports";
}

            <button onclick="location.href='@Url.Action("TodaysSale", "ReportsManagement")'">
                Today's Sales
            </button>

            Weekly Sales

            Monthly Sales

<file_sep>
$(document).ready(function () {

    $('#enter').on('click', function () {
        if ($('#searchtext').val() == "") {
            alert('Please enter a value');
        }
        else {

            $('#searchform').submit();
        }
    });

    $('#delivery').on('click', function () {
        $('#customerForm').attr('action','/DeliveryCollection/Delivery');// "@Url.Action("Delivery", "DeliveryCollection")");
        $('#customerForm').submit();
    });

    $('#collection').on('click', function () {
        $('#customerForm').attr('action','/DeliveryCollection/Collection');// "@Url.Action("Collection", "DeliveryCollection")");
        $('#customerForm').submit();
    });

    $('#repeatOrder').on('click', function (evt) {

        if ($('#Id').val() == 0) {
            alert('This Customer does not have any Previous order.')
        }
        else {
            $('#customerForm').attr('action','/DeliveryCollection/RepeatOrder');//"@Url.Action("RepeatOrder", "DeliveryCollection")");
            $('#customerForm').submit();
        }
    });
    $('#exitBtn').on('click', function () {
        window.location = '/Home/MainMenu';
    });

    $('input').on('click', function () {
        $('input').removeClass('inputselected');
        $(this).addClass('inputselected');
    });

    $('.KeyBoardBtn').on('click', function () {
        var text = $('.inputselected').val();
        //var text = $('#searchtext').val();
        var NewValue = text + $(this).text();
        //$('#searchtext').val(NewValue);
        $('.inputselected').val(NewValue);
    });

    $('#space').on('click', function () {
        var text = $('.inputselected').val();

        var NewValue = text + " ";

        $('.inputselected').val(NewValue);
    });

    $('.type').on('click', function () {
        $('.type').removeClass('selectedType');
        $(this).addClass('selectedType');
        var type = $(this).siblings('input').val();
        $('#searchType').val(type);
    });

    $('#deleteBtn').on('click', function () {
        var inputString = $('.inputselected').val();
        var shortenedString = inputString.substr(0, (inputString.length - 1));
        $('.inputselected').val(shortenedString);
    });

});
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class OrderViewModel
    {
        public int OrderId { get; set; }

        public int OrderNo { get; set; }

        public string Date { get; set; }

        public string Name { get; set; }

        public string Telephone { get; set; }

        public string Refund { get; set; }
        [DisplayName("Total Amount")]
        public decimal TotalAmount { get; set; }

        public string Status { get; set; }

    }
}<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class PriceModel
    {
        public int ItemId { get; set; }
        public decimal price1 { get; set; }
        public decimal price2 { get; set; }
        public decimal price3 { get; set; }

    }
}<file_sep>using DataLayer.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Entities
{
    public class Customer //: Person
    {
        [Key]
        public int Id { get; set; }

        [MaxLength(18)]
        [Required]
        [DisplayName("First Name")]
        public string FirstName { get; set; }

        [MaxLength(18)]
        [DisplayName("Sur Name")]
        public string SurName { get; set; }

        [Index(IsUnique = true)]
        [MaxLength(18)]
        [Required]
        public string Phone { get; set; }

        [Index(IsUnique = true)]
        [MaxLength(18)]
        public string Mobile { get; set; }

        public string Email { get; set; }

        [Required]
        public string Address1 { get; set; }

        [Required]
        public string Address2 { get; set; }

        [MaxLength(8)]
        [DisplayName("Post Code")]
        public string PostCode { get; set; }

        //[DisplayName("AZ Sector")]
        //public string AZ_Sector { get; set; }

        public int Distance { get; set; } = 0;

        //[DisplayName("Confidential Comments")]
        //public string ConfidentialComments { get; set; }

        //[DisplayName("Customer Comments")]
        //public string CustomerComments { get; set; }

        [DisplayName("Driver Instructions ")]
        public string DriverInstructions { get; set; }

        //[Index(IsUnique = true)]
        //[DisplayName("Loyalty Card No")]
        //public int LoyaltyCardNo { get; set; } = 0;

        [DisplayName("Loyalty Points")]
        public int LoyaltyPoints { get; set; } = 0;

    }
}
<file_sep>@model IEnumerable<DataLayer.Entities.Size>

    @{ int c = 0; }
    @foreach (var sizes in Model)
    {
        c++;

<button class="sizeBtn">@sizes.Title</button><input class="hidd" type="hidden" value="@c" />

    }

<file_sep>@model IEnumerable<string>
@{
    Layout = null;
}

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />

    <link href="~/Content/styles/loginview.css" rel="stylesheet" />
    <title>Login</title>

                @DateTime.Now.ToString("ddd dd MMM HH:mm")

        @foreach (string name in Model)
        {
            //onclick = "location.href='@Url.Action("TakeAway", "Home")'"
            <button class="loginViewBtn">@name</button>
        }

            Clock in

        <button class="exitBtn">
            Exit options
        </button>

<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class Constants
    {
        public enum OrderType
        {
            TakeAway = 1,
            Delivery = 2,
            Collection = 3
        }

        public enum PaymentStatus
        {
            Unpaid = 0,
            Paid = 1
        }

        public enum PaymentType
        {
            Cash = 1,
            CreditCard = 2,
            Check = 3,
            Voucher = 4
        }
    }
}<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Entities
{
    public class Staff
    {
        [Key]
        public int Id { get; set; }

        [MaxLength(18)]
        [Required]
        public string Name { get; set; }

        [Required]
        public string Address1 { get; set; }

        public string Address2 { get; set; }

        [MaxLength(8)]
        [DisplayName("Post Code")]
        public string PostCode { get; set; }

        [Index(IsUnique = true)]
        [MaxLength(18)]
        [Required]
        [DisplayName("Tel / Mob")]
        public string Contact { get; set; }

        [DisplayName("Date Since")]
        public DateTime DateSince { get; set; }

        [DisplayName("Pay Rate")]
        [Required]
        public string PayRate { get; set; }

        [Required]
        public string Password { get; set; }

        [Required]
        [DisplayName("Confirm Pin")]
        public string ConfirmPin { get; set; }

        public bool IngnorePin { get; set; }

        [Required]
        public bool Driver { get; set; }

    }
}
<file_sep>using DataLayer.DAC;
using DataLayer.Entities;
using ProjectMy.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjectMy.Controllers
{
    public class DeliveryCollectionController : Controller
    {
        public ActionResult Index(string number = null)
        {
            ViewData["number"] = number;
            return View();
        }

        [HttpGet]
        public PartialViewResult GetCustomer(string number = null)
        {
            if (number != null)
            {
                var customer = DAC.FindCustomerByPhone("1", number);
                if (customer != null)
                {
                    return PartialView("_GetCustomer", customer);
                }
                else
                {
                    return PartialView("_GetCustomer", new Customer());
                }
            }
            else
            {
                return PartialView("_GetCustomer", new Customer());
            }
        }

        [HttpGet]
        public PartialViewResult FindCustomer(string type, string value)
        {
            var customer = DAC.FindCustomerByPhone(type, value);
            return PartialView("_GetCustomer", customer);
        }

        [HttpPost]
        public ActionResult Delivery(Customer c)
        {
            if (ModelState.IsValid)
            {
                CustomerViewModel.customer = c;
                CustomerViewModel.OrderType =(int) Constants.OrderType.Delivery;
                return RedirectToAction("TakeAway", "Home");
            }
            else
            {
                return PartialView("_GetCustomer");
            }
        }

        [HttpPost]
        public ActionResult Collection(Customer c)
        {
            if (ModelState.IsValid)
            {
                CustomerViewModel.customer = c;
                CustomerViewModel.OrderType = (int) Constants.OrderType.Collection;
                return RedirectToAction("TakeAway", "Home");
            }
            else
            {
                return PartialView("_GetCustomer");
            }
        }

        [HttpPost]
        public ActionResult RepeatOrder(Customer c)
        {
            if (ModelState.IsValid)
            {
                CustomerViewModel.customer = c;
                List<OrderDetail> OrderDetails = new List<OrderDetail>();
                var orders = DAC.GetCustomerOrders(CustomerViewModel.customer.Id);
                if (orders != null)
                {
                    OrderDetails = DAC.GetOrderDetails(orders.OrderId);
                }
                TempData["orderlist"] = OrderDetails;
                //return View("~/Views/Home/TakeAway.cshtml", OrderDetails);
                return RedirectToAction("TakeAway", "Home");
            }
            else
            {
                return View("Index");
            }

        }

        [HttpGet]
        public ActionResult AwaitCollections()
        {
            return View();
        }

    }
}<file_sep>using DataLayer.Entities;
using DataLayer.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.DAC
{
    public class DAC
    {
        static myContext db = new myContext();

        public static decimal GetItemPrice(int id, int sizeId)
        {
            decimal price = 0;
            if (sizeId == 1)
            {
                price = db.Items.SingleOrDefault(m => m.Id == id).Price1;
            }
            else if (sizeId == 2)
            {
                price = db.Items.SingleOrDefault(m => m.Id == id).Price2;
            }
            else if (sizeId == 3)
            {
                price = db.Items.SingleOrDefault(m => m.Id == id).Price3;
            }

            return price;
        }

        public static decimal GetExtrasPrices(List<int> id, int sizeId)
        {
            decimal price = 0;
            if (sizeId == 1)
            {
                price = db.ExtrasAndToppings.Where(m => id.Contains(m.Id)).Sum(m => m.Price1);
                //price = db.Items.SingleOrDefault(m => m.Id == id).Price1;
            }
            else if (sizeId == 2)
            {
                price = db.ExtrasAndToppings.Where(m => id.Contains(m.Id)).Sum(m => m.Price2);
            }
            else if (sizeId == 3)
            {
                price = db.ExtrasAndToppings.Where(m => id.Contains(m.Id)).Sum(m => m.Price3);
            }

            return price;
        }
        public static Item AddItem(Item item)
        {
            var Newitem = db.Items.Add(item);
            db.SaveChanges();
            return Newitem;
        }

        public static List<Category> GetAllCategories()
        {
            List<Category> Category = new List<Category>();

            using (myContext db1 = new myContext())
            {
                Category = db1.Categories.ToList();
            }
            if (Category != null)
                return Category;
            else
                return new List<Category>();
        }
        public static void AddCategory(Category category)
        {
            db.Categories.Add(category);
            db.SaveChanges();
        }
        public static void DeletePizza(int? id)
        {
            if (id != null)
            {
            }
        }

        public static Category GetCategoryById(int? id)
        {
            var result = db.Categories.FirstOrDefault(m => m.Id == id);
            if (result != null)
            {
                return result;
            }
            else
                return new Category();
        }
        public static string GetCategoryNameById(int id)
        {
            var result = db.Categories.FirstOrDefault(m => m.Id == id).Title;
            if (result != null)
            {
                return result;
            }
            else
                return "";
        }

        public static List<Item> GetItemsByCategoryId(int? id)
        {
            var result = db.Items.Where(m => m.CategoryId == id).ToList();

            if (result != null)
            {
                return result;
            }
            else
                return new List<Item>();
        }

        public static List<Size> GetSizesByCategoryId(int id)
        {
            var result = (from pr in db.Sizes
                          where pr.CategoryId == id
                          orderby pr.Id
                          select pr
                          ).ToList();
            if (result != null)
            {
                return result;
            }
            else
                return new List<Size>();
        }
        public static List<string> GetSizeNameByCatId(int id)
        {
            var result = (from s in db.Sizes
                          where s.CategoryId == id
                          orderby s.Id
                          select s.Title).ToList();
            //db.Size.Where(m => m.CategoryId == id).ToList();
            if (result != null)
            {
                return result;
            }
            else
                return new List<string>();
        }

        public static Size AddSize(Size item)
        {
            var result = db.Sizes.Add(item);
            db.SaveChanges();
            return result;
        }
        public static void DeleteItemById(int? id)
        {
            var item = db.Items.First(m => m.Id == id);
            if (item != null)
            {
                db.Items.Remove(item);
                db.SaveChanges();
            }
        }

        public static void DeleteMultipleItems(int[] ids)
        {
            foreach (var id in ids)
            {
                var item = db.Items.First(m => m.Id == id);
                if (item != null)
                {
                    db.Items.Remove(item);
                }
            }
            db.SaveChanges();
        }

        public static void DeleteSizeById(int? id)
        {
            var item = db.Sizes.First(m => m.Id == id);
            if (item != null)
            {
                db.Sizes.Remove(item);
                db.SaveChanges();
            }
        }

        public static void DeleteExtraById(int? id)
        {
            var item = db.ExtrasAndToppings.First(m => m.Id == id);
            if (item != null)
            {
                db.ExtrasAndToppings.Remove(item);
                db.SaveChanges();
            }
        }

        public static void DeleteCategoryItemById(int? id)
        {
            var item = db.Categories.First(m => m.Id == id);
            if (item != null)
            {
                db.Categories.Remove(item);
                db.SaveChanges();
            }
        }
        public static void UpdatedPrices(Item itemPrices)
        {
            Item Updated = db.Items.Find(itemPrices.Id);
            Updated.Price1 = itemPrices.Price1;
            Updated.Price2 = itemPrices.Price2;
            Updated.Price3 = itemPrices.Price3;

            db.Entry(Updated).State = EntityState.Modified;
            db.SaveChanges();
        }

        public static void UpdateExtrasPrices(ExtrasAndTopping itemPrices)
        {
            ExtrasAndTopping Updated = db.ExtrasAndToppings.Find(itemPrices.Id);
            Updated.Price1 = itemPrices.Price1;
            Updated.Price2 = itemPrices.Price2;
            Updated.Price3 = itemPrices.Price3;

            db.Entry(Updated).State = EntityState.Modified;
            db.SaveChanges();
        }

        public static List<ExtrasAndTopping> GetExtrasByCategoryId(int categoryId)
        {
            var result = db.ExtrasAndToppings.Where(m => m.CategoryId == categoryId).ToList();
            return result;
        }
        public static List<ExtrasAndTopping> GetAllExtras()
        {
            int catId = (from c in db.Categories
                         where c.Title.ToLower().Contains("pizza")
                         select c.Id).Single();
            var result = db.ExtrasAndToppings.Where(m => m.CategoryId != catId).ToList();
            if (result != null)
            {
                return result;
            }
            else
            {
                return new List<ExtrasAndTopping>();
            }
        }

        public static List<ExtrasAndTopping> GetAllToppings()
        {
            int catId = (from c in db.Categories
                         where c.Title.ToLower().Contains("pizza")
                         select c.Id).Single();
            var result = db.ExtrasAndToppings.Where(m => m.CategoryId == catId).ToList();

            if (result != null)
            {
                return result;
            }
            else
            {
                return new List<ExtrasAndTopping>();
            }
        }

        public static ExtrasAndTopping AddExtra(ExtrasAndTopping extra)
        {
            var result = db.ExtrasAndToppings.Add(extra);
            db.SaveChanges();
            return result;
        }

        public static Item UpdateItem(Item UpdatedItem)
        {
            var item = db.Items.FirstOrDefault(m => m.Id == UpdatedItem.Id);

            if (item != null)
            {
                item.Title = UpdatedItem.Title;
                item.BackgroundColor = UpdatedItem.BackgroundColor;
                item.TextColor = UpdatedItem.TextColor;
                item.Toppings = UpdatedItem.Toppings;
                item.IsBold = UpdatedItem.IsBold;
                item.IsItalic = UpdatedItem.IsItalic;
                item.FontSize = UpdatedItem.FontSize;
                item.TextStyle = UpdatedItem.TextStyle;
                db.Entry(item).State = EntityState.Modified;
                db.SaveChanges();
            }
            return item;
        }

        public static void UpdateSize(Size UpdatedItem)
        {
            var item = db.Sizes.FirstOrDefault(m => m.Id == UpdatedItem.Id);

            if (item != null)
            {
                item.Title = UpdatedItem.Title;

                db.Entry(item).State = EntityState.Modified;
                db.SaveChanges();
            }
        }

        public static void UpdateExtrasItem(ExtrasAndTopping UpdatedItem)
        {
            var item = db.ExtrasAndToppings.FirstOrDefault(m => m.Id == UpdatedItem.Id);

            if (item != null)
            {
                item.Title = UpdatedItem.Title;

                db.Entry(item).State = EntityState.Modified;
                db.SaveChanges();
            }
        }

        public static void UpdateCategory(Category UpdatedItem)
        {
            var item = db.Categories.FirstOrDefault(m => m.Id == UpdatedItem.Id);

            if (item != null)
            {
                item.Title = UpdatedItem.Title;
                item.BackgroundColor = UpdatedItem.BackgroundColor;
                item.TextColor = UpdatedItem.TextColor;

                db.Entry(item).State = EntityState.Modified;
                db.SaveChanges();
            }
        }

        #region Customer

        public static int AddOrUpdateCustomer(Customer customer)
        {
            var cust = db.Customers.FirstOrDefault(m => m.Phone == customer.Phone || m.Mobile == customer.Mobile);
            if (cust == null)
            {
                using (myContext db1 = new DataLayer.myContext())
                {
                    var NewCustomer = db1.Customers.Add(customer);
                    db1.SaveChanges();
                    return NewCustomer.Id;
                }
            }
            else
            {
                cust.Address1 = customer.Address1;
                cust.Address2 = customer.Address2;
                cust.FirstName = customer.FirstName;
                cust.SurName = customer.SurName;
                cust.Mobile = customer.Mobile;
                cust.Phone = customer.Phone;
                cust.PostCode = customer.PostCode;
                cust.LoyaltyPoints = customer.LoyaltyPoints;
                cust.Distance = customer.Distance;
                cust.Email = customer.Email;
                cust.DriverInstructions = customer.DriverInstructions;
                db.Entry(cust).State = EntityState.Modified;
                return cust.Id;
            }
        }

        public static Customer FindCustomerByPhone(string type, string value)
        {
            using (myContext db = new myContext())
            {
                var customer = db.Customers.FirstOrDefault(m => m.Phone == value);
                return customer;
            }
        }

        public static Customer FindCustomerById(int Id)
        {
            using (myContext db = new myContext())
            {
                var customer = db.Customers.FirstOrDefault(m => m.Id == Id);
                return customer;
            }
        }
        #endregion

        #region Orders

        public static Order AddOrder(Order NewOrder)
        {
            Order order = db.Orders.Add(NewOrder);
            db.SaveChanges();
            return order;
        }

        public static List<Order> GetAllOrdersDesc()
        {
            using (myContext db1 = new myContext())
            {
                var Orders = db1.Orders.OrderByDescending(m => m.OrderId).ToList();
                return Orders;
            }
        }

        public static void AddOrderDetails(OrderDetail NewOrder)
        {
            var order = db.OrderDetails.Add(NewOrder);
            db.SaveChanges();
        }

        public static Order GetCustomerOrders(int CustomerId)
        {
            using (myContext db1 = new myContext())
            {
                var CustomerOrder = (from order in db1.Orders
                                     where order.CustomerId == CustomerId
                                     orderby order.OrderId descending
                                     select order).FirstOrDefault();// ToList();
                return CustomerOrder;
            }
        }

        public static Order GetOrder(int OrderId)
        {
            using (myContext db1 = new myContext())
            {
                var Order = db1.Orders.FirstOrDefault(order => order.OrderId == OrderId);
                return Order;
            }
        }

        public static List<OrderDetail> GetOrderDetails(int OrderId)
        {
            using (myContext db1 = new myContext())
            {
                var OrderDetails = (from orderdetail in db1.OrderDetails
                                    where orderdetail.OrderId == OrderId
                                    select orderdetail
                                    ).ToList();
                return OrderDetails;
            }
        }
        public static decimal GetOrderTotal(int id)
        {
            return db.Orders.Single(m => m.OrderId == id).TotalAmount;
        }

        public static decimal GetOrderPaymentStatus(int id)
        {
            var order = db.Orders.First(m => m.OrderId == id);
            if (order.Status == 1)
            {
                return order.TotalAmount;
            }
            else
            {
                return 0;
            }
        }

        #endregion

        public static bool DeleteAllItemsByCategory(int catId)
        {
            List<Item> items = new List<Item>();
            using (myContext db1 = new myContext())
            {
                db1.Items.RemoveRange(db1.Items.Where(m => m.CategoryId == catId));
                db1.SaveChanges();
            }
            return true;
            //if (items != null)
            //{
            //    using (myContext db1 = new myContext())
            //    {
            //        db1.Items.RemoveRange(db1.Items.Where(m => m.CategoryId == catId));
            //        db1.SaveChanges();
            //    }
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }

        public static List<Discount> GetAllDiscounts()
        {
            using (myContext db1 = new myContext())
            {
                return db1.Discounts.ToList();
            }
        }

        #region Cooking Instructions

        public static List<CookingInstruction> GetAllCookInst()
        {
            using (myContext db1 = new myContext())
            {
                return db1.CookingInstructions.ToList();
            }
        }

        public static CookingInstruction AddCookInstr(CookingInstruction instr)
        {
            using (myContext db1 = new myContext())
            {
                var newItem = db1.CookingInstructions.Add(instr);
                db1.SaveChanges();
                return newItem;
            }
        }

        public static CookingInstruction UpdateCookingInstr(CookingInstruction UpdatedItem)
        {
            var item = db.CookingInstructions.FirstOrDefault(m => m.Id == UpdatedItem.Id);

            if (item != null)
            {
                item.Title = UpdatedItem.Title;
                item.BackgroundColor = UpdatedItem.BackgroundColor;
                item.TextColor = UpdatedItem.TextColor;
                item.IsBold = UpdatedItem.IsBold;
                item.IsItalic = UpdatedItem.IsItalic;
                item.FontSize = UpdatedItem.FontSize;
                item.TextStyle = UpdatedItem.TextStyle;
                db.Entry(item).State = EntityState.Modified;
                db.SaveChanges();
            }
            return item;
        }

        public static bool DeleteCookingInstr(int? id)
        {
            var item = db.CookingInstructions.First(m => m.Id == id);
            if (item != null)
            {
                db.CookingInstructions.Remove(item);
                db.SaveChanges();
            }
            return true;
        }
        #endregion

        #region Await Collection

        public static List<AwaitOrder> GetCollectionOrders()
        {
            using (myContext db1 = new myContext())
            {
                var orders = db1.AwaitOrders.ToList();
                return orders;
            }
        }

        public static void AddCollectionOrder(int orderId)
        {
            using (myContext db1 = new myContext())
            {
                var awaitOrder = new AwaitOrder() { OrderId = orderId };
                var result = db1.AwaitOrders.Add(awaitOrder);
                db1.SaveChanges();
            }
        }

        public static void RemoveCollectionOrder(int Id)
        {
            using (myContext db1 = new myContext())
            {
                var order = db1.AwaitOrders.First(m => m.Id == Id);
                //db1.AwaitOrders.Remove(order);
                db1.Entry(order).State = EntityState.Deleted;
                db1.SaveChanges();
            }
        }
        public static int GetCollectionCount()
        {
            using (myContext db1 = new myContext())
            {
                var count = db1.AwaitOrders.ToList().Count;
                return count;
            }
        }
        #endregion

        #region Delivery To Despatch

        public static List<DeliverytoDespatch> GetUnAssignedDeliveries()
        {
            using (myContext db1 = new myContext())
            {
                var deliveries = db1.DeliveriestoDespatch.Where(m => m.AssignedDriverId == 0).ToList();
                return deliveries;
            }
        }
        public static int GetUnAssignedDeliveriesCount()
        {
            using (myContext db1 = new myContext())
            {
                var count = db1.DeliveriestoDespatch.Where(m => m.AssignedDriverId == 0).ToList().Count;
                return count;
            }
        }
        public static int GetDriverPaymentsCount()
        {
            var r = (from d in db.DeliveriestoDespatch
                     where d.DriverPaymentStatus == false && d.AssignedDriverId != 0
                     group d by d.AssignedDriverId into driver
                     select new
                     {
                         count = driver.Count()
                     }).ToList();
            return r.Count;
            //return db.DeliveriestoDespatch.GroupBy(d=>d.AssignedDriverId).Where(m => m.DriverPaymentStatus == false && m.AssignedDriverId != 0).Count();
        }
        public static void AddDeliverytoDespatch(int orderId)
        {
            using (myContext db1 = new myContext())
            {
                var deliveryOrder = new DeliverytoDespatch()
                {
                    OrderId = orderId,
                    AssignedDriverId = 0
                };
                var result = db1.DeliveriestoDespatch.Add(deliveryOrder);
                db1.SaveChanges();
            }
        }
        public static void AssignDriver(int DeliveryOrderId, int DriverId)
        {
            var delivery = db.DeliveriestoDespatch.Find(DeliveryOrderId);
            delivery.AssignedDriverId = DriverId;
            db.Entry(delivery).State = EntityState.Modified;
            db.SaveChanges();
        }
        public static List<DeliverytoDespatch> GetUnPaidDeliveries()
        {
            return db.DeliveriestoDespatch.Where(m => m.DriverPaymentStatus == false && m.AssignedDriverId != 0).ToList();
        }

        public static List<DeliverytoDespatch> GetDriverDeliveries(int id)
        {
            return db.DeliveriestoDespatch.Where(d => d.AssignedDriverId == id && d.DriverPaymentStatus == false).ToList();
        }
        #endregion

        #region Statff
        public static List<Staff> GetAllDriversFromStatff()
        {
            using (myContext db1 = new myContext())
            {
                var drivers = db1.Staff.Where(m => m.Driver == true).ToList();
                return drivers;
            }
        }
        public static string GetDriverName(int id)
        {
            return db.Staff.Single(m => m.Id == id && m.Driver == true).Name;
        }
        #endregion

        #region Reporting

        public static List<Order> GetOrders(DateTime from, DateTime to)
        {
            var records = db.Orders.Where(o => o.Date >= from && o.Date <= to).ToList();
            return records;
        }

        //public static decimal WeeklySale()
        //{
        //    DateTime date = DateTime.Now.Date;
        //    var amount = db.Orders.Where(o => o.Date == date).Select(od => od.TotalAmount - od.Discount).Sum();
        //    return amount;
        //}

        //public static decimal MonthlySale(DateTime date)
        //{
        //    var amount = (from o in db.Orders
        //                  where o.Date.Month == date.Month && o.Date.Year == date.Year
        //                  select (o.TotalAmount - o.Discount)
        //                    ).Sum();
        //    return amount;
        //}

        #endregion
    }

    public class ReportModel
    {
        public DateTime date { get; set; }
        public decimal SalesAmount { get; set; }
    }
}
<file_sep>using DataLayer.DAC;
using ProjectMy.Models;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjectMy.Controllers
{
    public class ReportsManagementController : Controller
    {
        [HttpGet]
        public ActionResult Home()
        {
            return View();
        }

        public ActionResult SalesReport()
        {
            return View();
        }

        [HttpGet]
        public ActionResult DailySales()
        {
            return View();
        }

        [HttpGet]
        public ActionResult WeeklySales()
        {
            return View();
        }

        [HttpGet]
        public ActionResult MonthlySales()
        {
            return View();
        }

        [HttpPost]
        public ActionResult DailySales(DateTime From, DateTime To)
        {
            var result = DAC.GetOrders(From, To);
            var amount = from o in result
                         group o by o.Date into grp
                         select new DailySalesReportViewModel() { Date = grp.Key.Date.ToString("dd/MM/yyyy"), TotalSale = grp.Sum(g => g.TotalAmount) / 2, Day = grp.Key.ToString("dddd") };

            return PartialView("_DailySaleReport", amount);
        }

        [HttpPost]
        public ActionResult WeeklySales(DateTime From, DateTime To)
        {
            var result = DAC.GetOrders(From, To);
            var weekGroups = result.Select(p => new
            {
                Project = p,
                Year = p.Date.Year,
                Week = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear
                                            (p.Date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)
            })
                            .GroupBy(x => new { x.Year, x.Week })
                            .Select((g, i) => new
                            {
                                WeekGroup = g,
                                WeekNum = i + 1,
                                Year = g.Key.Year,
                                CalendarWeek = g.Key.Week
                            });

            //foreach (var projGroup in weekGroups)
            //{
            //    Console.WriteLine("Week " + projGroup.WeekNum);
            //    foreach (var proj in projGroup.WeekGroup)
            //        Console.WriteLine("{0} {1} {2}",
            //            proj.Project.Name,
            //            proj.Project.DateStart.ToString("d"),
            //            proj.Project.ID);
            //}
            return Json(weekGroups, JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public ActionResult MonthlySales(DateTime From, DateTime To)
        {
            var result = DAC.GetOrders(From, To);
            var amount = from o in result
                         group o by o.Date.ToString("MMMM") into grp
                         select new MonthlySalesViewModel() { MonthName = grp.Key, TotalSale = grp.Sum(g => g.TotalAmount) / 2 };

            return PartialView("_MonthlySaleReport", amount);
        }
    }
}<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Entities
{
    public class Order
    {
        [Key]
        public int OrderId { get; set; }

        public DateTime Date { get; set; }

        public decimal TotalAmount { get; set; }

        public decimal TotalPaid { get; set; }

        public decimal Discount { get; set; }

        public string DiscountReason { get; set; }

        public decimal Balance { get; set; }

        public int OrderType { get; set; }

        public int Status { get; set; }

        public int PaymentTypeId { get; set; }

        public int CustomerId { get; set; }

    }
}
<file_sep>@model IEnumerable<ProjectMy.Models.DriverPaymentViewModel>

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Driver Payments";
}

        Driver Payments

                    @Html.DisplayNameFor(model => model.Name)

                    @Html.DisplayNameFor(model => model.Trips)

                    @Html.DisplayNameFor(model => model.Total)

                    @Html.DisplayNameFor(model => model.Paid)

                    @Html.DisplayNameFor(model => model.Balance)

                @foreach (var item in Model)
            {

                        <input type="hidden" value="@item.DriverId" />

                            @Html.DisplayFor(modelItem => item.Name)

                            @Html.DisplayFor(modelItem => item.Trips)

                            @Html.DisplayFor(modelItem => item.Total)

                            @Html.DisplayFor(modelItem => item.Paid)

                            @Html.DisplayFor(modelItem => item.Balance)

                }

<button class="customBttn1 greenBg" id="viewdetails">View Details</button>

 <button class="customBttn1 redBg" onclick="location.href='@Url.Action("MainMenu", "Home")'">Back</button>

<file_sep>@model ProjectMy.Models.DefinePriceViewModel

All form fields are required.

    <form>
        <fieldset>
            @for (int i = 0; i < Model.sizes.Count; i++)
            {

                    @Model.sizes[i].Title
                    @if(Model.prices.Count>=i)
                    {
                    <input type="text" name="name" id="name" value="@Model.prices[i].Amount" class="text ui-widget-content ui-corner-all">
                    }
                    else
                    {
                        <input type="text" name="name" id="name" value="" class="text ui-widget-content ui-corner-all">
                    }

            }
            <input type="submit" tabindex="-1" style="position:absolute; top:-1000px">
        </fieldset>
    </form>

<file_sep>/// <reference path="../jquery-3.1.1.min.js" />

$(document).ready(function () {

    var isFree = 0;
    var finalName = "";
    var FinalPrice = 0.00;

    $(function () {
        $("#dialog").dialog({
            autoOpen: false,
            height: 600,
            width: 750,
            modal: true,
            buttons: {
                "Add Selected Toppings": function () {

                    if (isFree === 0) {
                        AddOrderItem();
                    }
                    else if (isFree === 1 || isFree === 2) {
                        AddPizzas();
                    }
                    $(this).dialog("close");
                    //clearSelections
                },
                Cancel: function () {
                    clearSelections();
                    $(this).dialog("close");
                }
            },
            show: {
                effect: "blind",
                duration: 100
            },
            hide: {
                effect: "explode",
                duration: 100
            }
        });
        $("#sizesDialog").dialog({
            autoOpen: false,
            height: 350,
            width: 350,
            modal: true,
            buttons: {
                "Ok": function () {
                    //GetSetToppingsPrice();
                    $(this).dialog("close");
                },
                Cancel: function () {
                    //clearSelections();
                    $(this).dialog("close");
                }
            },
            show: {
                effect: "blind",
                duration: 100
            },
            hide: {
                effect: "explode",
                duration: 100
            }
        });
        //$("#toppings").on("click", function () {
        //    $("#dialog").dialog("open");
        //});
    });
    $(function () {
        $("#dialog-message").dialog({
            autoOpen: false,
            modal: true,
            buttons: {
                Ok: function () {
                    $(this).dialog("close");
                }
            }
        });
    });
    $(".customBttncat").on("click", function (e) {
        var catId = $(this).siblings('input').val();
        $.ajax({
            async: false,
            url: '/Home/TakeAwayItems',
            type: 'GET',
            data: { categoryId: catId },
            traditional: true,
            success: function (data) {
                $('#TakeAwayitemsArea').html(data);
            },
            error: function (request, error) {
                alert("request:" + error);
            }

        });

        $.ajax({
            async: false,
            url: '/Home/GetSizes',
            type: 'GET',
            data: { categoryId: catId },
            traditional: true,
            success: function (data) {
                $('#sizesDialog').html(data);
            },
            error: function (request, error) {
                alert("request:" + error);
            }

        });
        $.ajax({
            async: false,
            url: '/Home/GetExtras',
            type: 'GET',
            data: { categoryId: catId },
            traditional: true,
            success: function (data) {
                $('#dialog').html(data);
            },
            error: function (request, error) {
                alert("request:" + error);
            }

        });

    });

    $('#canelOrder').on("click", function (evt) {
        if ($('.table tbody').find('tr').length > 0) {
            if (confirm('Are you sure to Cancel Order?')) {
                $('.table tbody').empty();
                $('#totalAmount').text(0);
            }
            else {
                evt.preventDefault();
            }
        }
        else {
            alert('Order is already empty.');
        }

    });
    $(document).on("click", '.singleitem', function () {

        $('.singleitem').removeClass("selected");
        $(this).addClass("selected");
        var catId = $(this).siblings('input').val();

        var sizecount = $('.sizeBtn').length;
        var extrasCount = $('.Extraitem').length;

        if (sizecount === 0 && extrasCount === 0) {
            var name = $('.selected').text();
            name = $('.selected').text();
            var itemID = $('.selected').attr('id');
            var size = 1;
            GetItemPrice(name, itemID, size);
            $('.selected').removeClass('selected');
        }

        else {
            $("#sizesDialog").dialog("open");
        }

    });

    $(document).on("click", '.pizzItem', function () {
        isFree++;

        $('.singleitem').removeClass("selected");
        $('.pizzItem').removeClass("selected");

        $(this).addClass("selected");
        var catId = $(this).siblings('input').val();
        if (isFree === 1) {
            $("#sizesDialog").dialog("open");
        }

        if (isFree === 2) {
            $("#dialog").dialog("open");
        }

    });

    $(document).on("click", '.sizeBtn', function () {
        $('.sizeBtn').removeClass("SizeSelected");
        $(this).addClass("SizeSelected");

        var extrasCount = $('.Extraitem').length;

        if (extrasCount === 0) {
            var name = $('.selected').text();

            name = name + "-" + $('.SizeSelected').text();

            var itemId = $('.selected').attr('id');
            var size = $(".SizeSelected").siblings('input').val();
            var price = 0;
            $.ajax({
                async: false,
                url: '/Home/GetItemPrice',
                type: 'GET',
                data: { itemID: itemId, sizeId: size },
                dataType: "json",
                traditional: true,
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    price = parseFloat(price) + parseFloat(data);

                },
                error: function (request, error) {
                    alert("request:" + error);
                }

            });
            var item = $('
1	' + name + '	' + price + '
');
            $('.tableBody').append(item);
            var totalAmount = $('#totalAmount').text();
            var newTotal = parseFloat(totalAmount) + parseFloat(price);

            $('#totalAmount').text('');
            $('#totalAmount').text(newTotal.toFixed(2));
            $('.singleitem').removeClass("selected");
            $('.sizeBtn').removeClass("SizeSelected");
            $('#sizesDialog').dialog("close");
        }
        else {
            $('#sizesDialog').dialog("close");
            $("#dialog").dialog("open");
        }
        //var name = $('.selected').text();
        //if (name.length > 2) {
        //    name = name + "-" + $('.SizeSelected').text();
        //    var itemID = $('.selected').attr('id');
        //    var size = $(this).siblings('input').val();
        //    //GetItemPrice(name, itemID, size);
        //}
    });

    $('#orderCmplt').on("click", function (evt) {

        var itemsList = [];

        $('.tableBody tr').each(function () {
            if (!this.rowIndex) { return };

            Quantity = this.cells[0].innerHTML;
            productName = this.cells[1].innerHTML;
            totalAmount = this.cells[2].innerHTML;

            var item = { ItemName: productName, ItemQty: Quantity, Amount: parseFloat(totalAmount) };

            itemsList.push(item);
        });
        var c = 0;
        $(".tableBody tr").each(function () {
            if (!this.rowIndex) { return };

            Quantity = parseInt(this.cells[0].innerHTML);
            productName = String(this.cells[1].innerHTML);
            var newchara = productName.replace("\"", "inches");
            newchara = newchara.replace("\"", "inches");

            totalAmount = parseFloat(this.cells[2].innerHTML);

            $("#formtable").append('
<input type="hidden" name="[' + c + '].ItemQty" value="' + Quantity + '"/>	<input type="hidden" name="[' + c + '].ItemName" value="' + newchara + '"/>	<input type="hidden" name="[' + c + '].Amount" value="' + totalAmount.toFixed(2) + '"/>
');
            c++;

        });

        if (itemsList.length === 0) {
            alert("Please Select at least 1 item to place an order.");
            evt.preventDefault();
        }
        else {
            $('#formPost').submit();
        }
        //addItem(itemsList);
    });

    $(document).on("click", '#plus', function () {
        var price = $('.rowSelected').find('#price').text();
        var qty = $('.rowSelected').find('#qty').text();
        var amountToAdd = parseFloat(price) / qty;
        var newPrice = parseFloat(price) + amountToAdd;

        var qty = $('.rowSelected').find('#qty').text();
        var newQty = parseInt(qty) + 1;
        $('.rowSelected').find('#qty').text(newQty);
        $('.rowSelected').find('#price').text(newPrice.toFixed(2));

        var total = $('#totalAmount').text();
        var NewTotal = parseFloat(total) + parseFloat(amountToAdd);
        $('#totalAmount').text(NewTotal.toFixed(2));
    });

    $(document).on("click", '#minus', function (evt) {

        var qty = $('.rowSelected').find('#qty').text();
        var newQty = parseInt(qty) - 1;
        var price = $('.rowSelected').find('#price').text();
        var amountToMinus = parseFloat(price) / qty;
        var newPrice = parseFloat(price) - amountToMinus;
        if (newQty === 0) {

            if (confirm("Are you sure to Delete this Item ?")) {
                $('.rowSelected').remove();
            }
            else {
                evt.preventDefault();
            }
        }
        else {
            $('.rowSelected').find('#price').text(newPrice.toFixed(2));
            $('.rowSelected').find('#qty').text(newQty);
        }
        var total = $('#totalAmount').text();
        var NewTotal = parseFloat(total) - parseFloat(amountToMinus);
        if (!(NewTotal < 0)) {
            $('#totalAmount').text(NewTotal.toFixed(2));
        }

        $(this).removeClass('rowSelected');

    });

    $(document).on("click", "#row1", function () {
        $('.rowSelected').removeClass("rowSelected");
        $(this).toggleClass("rowSelected");
    });
    $(document).on("click", '.Extraitem', function () {
        $(this).toggleClass("selectedTopping");
    });
    function AddPizzas() {

        var name = $('.selected').text();
        name = name + "-" + $('.SizeSelected').text() + " ";
        var itemId = $('.selected').attr('id');
        var size = $(".SizeSelected").siblings('input').val();
        var price = 0;
        $.ajax({
            async: false,
            url: '/Home/GetItemPrice',
            type: 'GET',
            data: { itemID: itemId, sizeId: size },
            dataType: "json",
            traditional: true,
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                price = parseFloat(price) + parseFloat(data);
            },
            error: function (request, error) {
                alert("request:" + error);
            }

        });

        var ids = [];
        $('.selectedTopping').each(function () {
            name = name + $(this).text() + " , ";
            var eId = $(this).siblings('input').val();
            ids.push(eId);
            $(this).removeClass('selectedTopping');
        });
        if (ids.length > 0) {
            //name = name + "  +  ";
            $.ajax({
                async: false,
                url: '/Home/GetExtrasPrices',
                type: 'GET',
                data: { toppingIds: ids, sizeId: size },
                dataType: "json",
                traditional: true,
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    price = parseFloat(price.toFixed(2)) + parseFloat(data.toFixed(2));
                    if (isFree === 1) {
                        FirstPrice = price;
                        finalName = finalName + name;
                        price = 0.00;
                        name = "";
                        $('#dialog-message').dialog("open");
                    }
                    else if (isFree === 2) {
                        var totalAmount = $('#totalAmount').text();
                        var newTotal = 0.00;
                        var newName = finalName + " + " + name;
                        var item = "";
                        if (price > FirstPrice) {

                            item = $('
1	' + newName + '	' + price.toFixed(2) + '
');
                            newTotal = parseFloat(totalAmount) + parseFloat(price);
                        }
                        else if (price === FirstPrice) {

                            item = $('
1	' + newName + '	' + price.toFixed(2) + '
');
                            newTotal = parseFloat(totalAmount) + parseFloat(price);
                        }
                        else {
                            item = $('
1	' + newName + '	' + FirstPrice.toFixed(2) + '
');
                            newTotal = parseFloat(totalAmount) + parseFloat(FirstPrice);
                        }

                        $('.tableBody').append(item);
                        isFree = 0;
                        finalName = "";
                        FinalPrice = 0.00;
                        $('#totalAmount').text('');
                        $('#totalAmount').text(newTotal.toFixed(2));
                    }
                },
                error: function (request, error) {
                    alert("request:" + error);
                }
            });
        }
        else {
            if (isFree === 1) {
                FirstPrice = price;
                finalName = finalName + name;
                $('#dialog-message').dialog("open");
            }
            else if (isFree === 2) {
                var totalAmount = $('#totalAmount').text();
                var newTotal = 0.00;
                var newName = finalName + " + " + name;
                var item = "";
                if (price > FirstPrice) {
                    item = $('
1	' + newName + '	' + price.toFixed(2) + '
');
                    newTotal = parseFloat(totalAmount) + parseFloat(price);
                }
                else if (price === FirstPrice) {

                    item = $('
1	' + newName + '	' + price.toFixed(2) + '
');
                    newTotal = parseFloat(totalAmount) + parseFloat(price);
                }
                else {
                    item = $('
1	' + newName + '	' + FirstPrice.toFixed(2) + '
');
                    newTotal = parseFloat(totalAmount) + parseFloat(FirstPrice);
                }
                isFree = 0;
                finalName = "";
                FinalPrice = 0.00;

                $('.tableBody').append(item);

                $('#totalAmount').text('');
                $('#totalAmount').text(newTotal.toFixed(2));
            }
        }

        if (isFree === 1) {
            $('#dialog-message').dialog("open");
            $('.singleitem').removeClass("selected");
            $('.Extraitem').removeClass('selectedTopping');
        }
        else {

            $('.singleitem').removeClass("selected");
            $('.sizeBtn').removeClass("SizeSelected");
            $('.Extraitem').removeClass('selectedTopping');
        }
    }
});
function GetSetToppingsPrice() {
    var name = "Toppings - ";
    var ids = [];
    $('.selectedTopping').each(function () {
        name = name + $(this).text() + " , ";
        var eId = $(this).siblings('input').val();
        ids.push(eId);
        $(this).removeClass('selectedTopping');
    });
    var size = $(".SizeSelected").siblings('input').val();

    //GetItemPrice(name, itemID, size);

    //$.get('/Home/GetExtrasPrices/?' + "toppingIds=" + ids + "&sizeId=" + size, function (data) {
    //$.get('/Home/GetExtrasPrices', {toppingIds : ids , sizeId:size}, function (data) {
    //

    //})
    $.ajax({

        url: '/Home/GetExtrasPrices',
        type: 'GET',
        data: { toppingIds: ids, sizeId: size },
        dataType: "json",
        traditional: true,
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            var item = $('
1	' + name + '	' + data.toFixed(2) + '
');
            $('.tableBody').append(item);
            var totalAmount = $('#totalAmount').text();
            var newTotal = parseFloat(totalAmount) + parseFloat(data);

            $('#totalAmount').text('');
            $('#totalAmount').text(newTotal.toFixed(2));
        },
        error: function (request, error) {
            alert("request:" + error);
        }
    });

}

//function addItem(orders) {
//    $.ajax({

//        url: '/Home/CompleteOrder',
//        type: 'POST',
//        data: JSON.stringify(orders),
//        dataType: "json",
//        contentType: "application/json; charset=utf-8",
//        success: function () {
//            window.location.href = "/Home/OrderComplete";
//        },
//        error: function (request, error) {
//            alert("request: " + json.stringify(request));
//        }
//    });
//};
function GetItemPrice(name, itemId, size) {
    $.get('/Home/GetItemPrice/?' + "itemID=" + itemId + "&sizeId=" + size, function (data) {

        var item = $('
1	' + name + '	' + data.toFixed(2) + '
');
        $('.tableBody').append(item);
        var totalAmount = $('#totalAmount').text();
        var newTotal = parseFloat(totalAmount) + parseFloat(data);

        $('#totalAmount').text('');
        $('#totalAmount').text(newTotal.toFixed(2));
        $('.selected').removeClass('selected');
    })

};

function AddOrderItem() {

    var name = $('.selected').text();
    name = name + "-" + $('.SizeSelected').text() + " ";
    var itemId = $('.selected').attr('id');
    var size = $(".SizeSelected").siblings('input').val();
    var price = 0;
    $.ajax({
        async: false,
        url: '/Home/GetItemPrice',
        type: 'GET',
        data: { itemID: itemId, sizeId: size },
        dataType: "json",
        traditional: true,
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            price = parseFloat(price) + parseFloat(data);
        },
        error: function (request, error) {
            alert("request:" + error);
        }

    });

    var ids = [];
    $('.selectedTopping').each(function () {
        name = name + $(this).text() + " , ";
        var eId = $(this).siblings('input').val();
        ids.push(eId);
        $(this).removeClass('selectedTopping');
    });
    if (ids.length > 0) {
        //name = name + "  +  ";
        $.ajax({
            async: false,
            url: '/Home/GetExtrasPrices',
            type: 'GET',
            data: { toppingIds: ids, sizeId: size },
            dataType: "json",
            traditional: true,
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                price = parseFloat(price.toFixed(2)) + parseFloat(data.toFixed(2));
                var item = $('
1	' + name + '	' + price.toFixed(2) + '
');
                $('.tableBody').append(item);
                var totalAmount = $('#totalAmount').text();
                var newTotal = parseFloat(totalAmount) + parseFloat(price);

                $('#totalAmount').text('');
                $('#totalAmount').text(newTotal.toFixed(2));
            },
            error: function (request, error) {
                alert("request:" + error);
            }
        });
    }
    else {
        var item = $('
1	' + name + '	' + price.toFixed(2) + '
');
        $('.tableBody').append(item);
        var totalAmount = $('#totalAmount').text();
        var newTotal = parseFloat(totalAmount) + parseFloat(price);

        $('#totalAmount').text('');
        $('#totalAmount').text(newTotal.toFixed(2));
    }
    $('.selected').removeClass('selected');
    $(".SizeSelected").removeClass('SizeSelected');

}

function clearSelections() {
    $('.singleitem').removeClass("selected");
    $('.sizeBtn').removeClass("SizeSelected");
    $('.Extraitem').removeClass('selectedTopping');
}

<file_sep>@model DataLayer.Entities.Customer

@using (Html.BeginForm("", "", FormMethod.Post, new { @id = "customerForm" }))
{
    @Html.AntiForgeryToken()

        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.Phone, htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.Phone, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Phone, "", new { @class = "text-danger", })

                    @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.SurName, htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.SurName, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.SurName, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.Address1, htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.Address1, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Address1, "", new { @class = "text-danger" })

                    @Html.Label(" ", htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.Address2, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Address1, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.PostCode, htmlAttributes: new { @class = "control-label col-md-2", @style = "padding-top: 0px !important" })

                        @Html.EditorFor(model => model.PostCode, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.PostCode, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.Mobile, htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.Mobile, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Mobile, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" })

                        @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.DriverInstructions, htmlAttributes: new { @class = "control-label col-md-2", @style = "padding-top: 0px !important" })

                        @Html.EditorFor(model => model.DriverInstructions, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.DriverInstructions, "", new { @class = "text-danger" })

                            @Html.LabelFor(model => model.Distance, htmlAttributes: new { @class = "control-label col-md-4" })

                                @Html.EditorFor(model => model.Distance, new { htmlAttributes = new { @class = "form-control" } })
                                @Html.ValidationMessageFor(model => model.Distance, "", new { @class = "text-danger" })

                    @Html.HiddenFor(model => model.Id)

                            @Html.LabelFor(model => model.LoyaltyPoints, htmlAttributes: new { @class = "control-label col-md-4", @style = "padding-top: 0px !important" })

                                @Html.EditorFor(model => model.LoyaltyPoints, new { htmlAttributes = new { @class = "form-control" } })
                                @Html.ValidationMessageFor(model => model.LoyaltyPoints, "", new { @class = "text-danger" })

        @*

                    @Html.LabelFor(model => model.AZ_Sector, htmlAttributes: new { @class = "control-label col-md-4" })

                        @Html.EditorFor(model => model.AZ_Sector, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.AZ_Sector, "", new { @class = "text-danger" })

*@

        @*

                @Html.LabelFor(model => model.ConfidentialComments, htmlAttributes: new { @class = "control-label col-md-2", @style = "padding-top: 0px !important" })

                    @Html.EditorFor(model => model.ConfidentialComments, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.ConfidentialComments, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.CustomerComments, htmlAttributes: new { @class = "control-label col-md-2", @style = "padding-top: 0px !important" })

                    @Html.EditorFor(model => model.CustomerComments, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.CustomerComments, "", new { @class = "text-danger" })

*@

        @*

            @*

                        @Html.LabelFor(model => model.LoyaltyCardNo, htmlAttributes: new { @class = "control-label col-md-4", @style = "padding-top: 0px !important" })

                            @Html.EditorFor(model => model.LoyaltyCardNo, new { htmlAttributes = new { @class = "form-control" } })
                            @Html.ValidationMessageFor(model => model.LoyaltyCardNo, "", new { @class = "text-danger" })

*@

}

<file_sep>@model IEnumerable<DataLayer.Entities.Staff>

                @foreach (var driver in Model)
                {

                        <button class="customBttn1 driver">@driver.Name</button>
                        <input type="hidden" value="@driver.Id" />
                        @*//Html.ActionLink(cat.Title, "TakeAway", new { categoryId = cat.Id }, new { @class = "btn landingBtns", @style = "background-color:" + cat.BackgroundColor + ";color:" + cat.TextColor + ";" })*@

                }

<file_sep>@model IEnumerable<DataLayer.Entities.Category>

@foreach (var item in Model)
{

        @*@Ajax.ActionLink(item.Title, "TakeAwayItems", new { categoryId = item.Id }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "TakeAwayitemsArea", InsertionMode = InsertionMode.Replace }, new { @class = "ajaxcustomBttn", @style = "background-color:" + item.BackgroundColor + ";color:" + item.TextColor })
            <input type="hidden" value="@item.Id" />*@

        <button class="customBttncat" style="background-color:@item.BackgroundColor;color:@item.TextColor">@item.Title</button><input class="hidd" type="hidden" value="@item.Id" />

}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class DeliveriesViewModel
    {
        public int DeliveryId { get; set; }

        public int OrderNo { get; set; }

        public string Time { get; set; }

        public string Name { get; set; }

        public string Address { get; set; }

        [DisplayName("Post Code")]
        public string PostCode { get; set; }

        public string Telephone { get; set; }

        [DisplayName("Total Amount")]
        public decimal TotalAmount { get; set; }

        public string Status { get; set; }
    }
}<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class ExtrasPriceViewModel
    {
        public string CategoryName { get; set; }
        public List<Size> sizes { get; set; }
        public List<ExtrasAndTopping> Items { get; set; }
    }
}<file_sep>/// <reference path="../jquery-3.1.1.min.js" />

$(document).ready(function () {

    function rgbToHex(rgb) {
        var a = rgb.split("(")[1].split(")")[0].split(",");
        return "#" + a.map(function (x) {
            x = parseInt(x).toString(16);
            return (x.length === 1) ? "0" + x : x;
        }).join("");
    }

    $(document).on("click", '.singleSizeitem', function () {
        $('.singleSizeitem').removeClass("selected");

        $(this).addClass("selected");

        var TitleText = $(this).text();
        if ($('#text').length > 0) {
            $('#text').val(TitleText);
        }

    });
    $(document).on('click', "#deleteAll", function (evt) {

        if ($('.DeptSelected').length === 0) {
            alert('Please Select any Category.');
            evt.preventDefault();
        }

        else if (confirm("You are attemting to Delete All Items , OK ? ")) {
            if (confirm("Are you sure to Delete All Items ? ")) {

            }
            else {
                evt.preventDefault();
            }
        }
        else {
            evt.preventDefault();
        }
    });

    $(document).on("click", '.singleitem', function () {
        $("#myForm")[0].reset();
        $(this).toggleClass("selected");

        if ($('.selected').length === 0) {
            //$("#myForm")[0].reset();
            $('#editItem').attr('disabled', true);
            return
        }
        else {
            $('#editItem').attr('disabled', false);
        }
        if ($('#text').length > 0) {
            var bgColor = $(this).css('backgroundColor');
            var txtColor = $(this).css('Color');

            var IsBold = $(this).css('font-weight');

            var IsItalic = $(this).css('font-style');

            if (IsBold === "normal") {
                $('#isBold').prop('checked', false);
            }
            else if (IsBold === "400" || IsBold === "bold") {
                $('#isBold').prop('checked', true);
            }

            if (IsItalic === "italic") {
                $('#isitalic').prop('checked', true);
            }
            else if (IsItalic === "none") {
                $('#isitalic').prop('checked', false);
            }
            var ItemId = $(this).siblings('input').attr("id");
            $('#ItemId').val(ItemId);

            $('#btncolor').val(rgbToHex(bgColor));
            $('#textcolor').val(rgbToHex(txtColor));

            var TitleText = $(this).text();
            var TextStyle = $(this).css('font-family');
            var fontsize = $(this).css('font-size');
            var topping = $(this).siblings('.topppings').text();
            $('#text').val(TitleText);
            $('#toppings').val(topping);
            $('#fontstyle').val(TextStyle);
            $('#fontsize').val(fontsize);
        }

    });

    $(document).on("click", '.singleCookingItem', function () {
        $("#myForm")[0].reset();
        $(this).toggleClass("selected");

        if ($('.selected').length === 0) {
            //$("#myForm")[0].reset();
            $('#UpdateCookInstrItem').attr('disabled', true);
            return
        }
        else {
            $('#UpdateCookInstrItem').attr('disabled', false);
        }
        if ($('#text').length > 0) {
            var bgColor = $(this).css('backgroundColor');
            var txtColor = $(this).css('Color');

            var IsBold = $(this).css('font-weight');

            var IsItalic = $(this).css('font-style');

            if (IsBold === "normal") {
                $('#isBold').prop('checked', false);
            }
            else if (IsBold === "400" || IsBold === "bold") {
                $('#isBold').prop('checked', true);
            }

            if (IsItalic === "italic") {
                $('#isitalic').prop('checked', true);
            }
            else if (IsItalic === "none") {
                $('#isitalic').prop('checked', false);
            }
            var ItemId = $(this).siblings('input').val();
            $('#InstrId').val(ItemId);

            $('#btncolor').val(rgbToHex(bgColor));
            $('#textcolor').val(rgbToHex(txtColor));

            var TitleText = $(this).text();
            var TextStyle = $(this).css('font-family');
            var fontsize = $(this).css('font-size');
            //var topping = $(this).siblings('.topppings').text();
            $('#text').val(TitleText);
            //$('#toppings').val(topping);
            $('#fontstyle').val(TextStyle);
            $('#fontsize').val(fontsize);
        }

    });

    $(document).on("click", '.singleCatitem', function () {
        //$("#myForm")[0].reset();
        $(this).toggleClass("selected");

        if ($('.selected').length === 0) {
            $('#editCategory').attr('disabled', true);
            return
        }
        else {
            $('#editCategory').attr('disabled', false);
        }
        if ($('#text').length > 0) {
            var bgColor = $(this).css('backgroundColor');
            var txtColor = $(this).css('Color');

            var IsBold = $(this).css('font-weight');

            var IsItalic = $(this).css('font-style');

            if (IsBold === "normal") {
                $('#isBold').prop('checked', false);
            }
            else if (IsBold === "400" || IsBold === "bold") {
                $('#isBold').prop('checked', true);
            }

            if (IsItalic === "italic") {
                $('#isitalic').prop('checked', true);
            }
            else if (IsItalic === "none") {
                $('#isitalic').prop('checked', false);
            }
            var ItemId = $(this).siblings('input').attr("id");
            $('#ItemId').val(ItemId);

            $('#btncolor').val(rgbToHex(bgColor));
            $('#textcolor').val(rgbToHex(txtColor));

            var TitleText = $(this).text();

            $('#text').val(TitleText);

        }

    });
    //$(document).on('click', '.extrasCat', function () {
    //    var category = $(this).text;
    //    if (category == "Pizza") {
    //        $('#toppingsRow').removeAttr("style");
    //        $('#toppingslableRow').css("display", "block");
    //    }
    //    else {
    //        $('#toppingsRow').fadeOut();
    //        $('#toppingslableRow').fadeOut();
    //    }

    //});

    $('.customBttn').on("click", function () {
        $('.customBttn').removeClass("DeptSelected");
        $(this).addClass("DeptSelected");
        var dept = $('.DeptSelected').html();

        $('.title').text(dept);
    });

    $('.extrasCat').on("click", function () {

        $("#categoryId").val($(this).siblings('input').val());
        $('.extrasCat').removeClass("DeptSelected");
        $(this).addClass("DeptSelected");
        var dept = $('.DeptSelected').text();
        var CateId = $(this).siblings('input[type=hidden]').val();
        $('#deleteAllCatId').val(CateId);
        $('.title').text(dept);
    });

    $(document).on("click", '#addItem', function (evt) {

        if ($(".DeptSelected").length == 0) {
            evt.preventDefault();
            alert("Please Select a Category.");
        }

        else if ($('#text').val() == "" && $('#toppings').val() == "") {
            evt.preventDefault();
            alert("enter information");
        }
        else if ($('.singleitem').length > 30) {
            evt.preventDefault();
            alert('Sorry ! you can not add more Items (max=30).');
        }
    });

    $(document).on("click", '#addCookInstrItem', function (evt) {

        if ($('#text').val() == "") {
            evt.preventDefault();
            alert("enter information");
        }
    });

    $(document).on("click", '#addExtraItem', function (evt) {

        if ($(".DeptSelected").length === 0) {
            evt.preventDefault();
            alert("Please Select a Category.");
        }
        else {
            var TitleText = $('#text').val();
            var categoryId = $(".DeptSelected").siblings('input').val();

            if (TitleText !== "") {

                var item = { Title: TitleText, Price1: 0.00, Price2: 0.00, Price3: 0.00, CategoryId: categoryId };
                addExtraItem(item);

                $('#text').val("");

            }
            else {
                alert("enter information");
            }
        }

    });

    $('#addCategory').on("click", function (evt) {

        var textColor = $('#textcolor').val();
        var bgColor = $('#btncolor').val();

        var isBold = $('#isBold').is(':checked');
        var isItalic = $('#isitalic').is(':checked');

        var TitleText = $('#text').val();

        var textStyle = $('#fontstyle').val();
        var positionNumb = parseInt($(".singleitem").length) + 1;

        if (TitleText !== "" && bgColor !== "") {
            var category = { Title: TitleText, BackgroundColor: bgColor, TextColor: textColor, PositionNumber: positionNumb };
            addCategory(category);
            location.reload(true);
        }
        else {
            alert("enter information");
        }

    });

    $('#addSize').on("click", function (evt) {

        if ($(".DeptSelected").length === 0) {
            alert('Select Departement .');
        }
        else {
            var textColor = $('#textcolor').val();
            var bgColor = $('#btncolor').val();
            var TitleText = $('#text').val();

            var textStyle = $('#fontstyle').val();
            var categoryId = $(".DeptSelected").siblings('input').val();
            if (TitleText !== "") {

                var size = { Title: TitleText, CategoryId: categoryId };
                addSize(size);
            }
            else {
                alert("Enter Title");
            }
        }
    });

    $('#deleteItem').on("click", function (evt) {

        if ($(".selected").length === 0) {
            evt.preventDefault();
            alert("Please Select button(s) to Delete Item.");
        }
        else if ($(".selected").length === 1) {
            var id = $(".selected").siblings("input").attr("id");

            if ($(".selected").text() === "") {
                alert("Please Select a valid Item.");
            }
            else if (confirm("Are you sure to delete this item ?")) {
                DeleteItem(id);
            }

            else {
                evt.preventDefault();
            }
        }
        else if ($(".selected").length > 1) {

            var itemsIds = [];

            $('.selected').each(function () {
                var Id = $(this).siblings("input").attr("id");

                itemsIds.push(Id);
            });
            var count = itemsIds.length;
            if (confirm("Are you sure to delete " + count + " item ?")) {
                DeleteMultipleItemsItem(itemsIds);
            }

            else {
                evt.preventDefault();
            }
        }
    });
    $('#deleteCategory').on("click", function (evt) {
        if ($(".selected").length === 0) {
            evt.preventDefault();
            alert("Please Select a button to Delete Item.");
        }
        else {
            var id = $(".selected").siblings("input").attr("id");
            if ($(".selected").text() === "") {
                alert("Please Select a valid Item.");
            }
            else if (confirm("Are you sure to delete this item ?")) {
                DeleteCategory(id);
            }

            else {
                evt.preventDefault();
            }

        }
    });

    $('#deleteSize').on("click", function (evt) {
        if ($(".selected").length === 0) {
            evt.preventDefault();
            alert("Please Select a button to Delete Item.");
        }
        else {
            var id = $(".selected").siblings("input").attr("id");
            if ($(".selected").text() === "") {
                alert("Please Select a valid Item.");
            }
            else if (confirm("Are you sure to delete this item ?")) {
                DeleteSize(id);
            }

            else {
                evt.preventDefault();
            }

        }
    });

    $('#deleteExtrasItem').on("click", function (evt) {
        if ($(".selectedTopping").length === 0) {
            evt.preventDefault();
            alert("Please Select a button to Delete Item.");
        }
        else {
            var id = $(".selectedTopping").siblings("input").attr("id");
            if ($(".selectedTopping").text() === "") {
                alert("Please Select a valid Item.");
            }
            else if (confirm("Are you sure to delete this item ?")) {
                DeleteExtra(id);
            }

            else {
                evt.preventDefault();
            }

        }
    });

    $('#deleteCookInstrItem').on("click", function (evt) {
        if ($(".selected").length === 0) {
            evt.preventDefault();
            alert("Please Select a button to Delete Item.");
        }
        else {
            var id = $(".selected").siblings("input").val();
            alert(id);
            if (confirm("Are you sure to delete this item ?")) {
                DeleteCookingInstr(parseInt(id));
            }

            else {
                evt.preventDefault();
            }

        }
    });

    $(document).on("click", '#editItem', function (evt) {

        if ($('.selected').length > 1) {
            evt.preventDefault();
            alert('You have selected more than 1 item , Please unselect other items.');
        }
        else {
            var ItemId = $('.selected').siblings('input').attr("id");
            var NewbgColor = $('#btncolor').val();
            var NewTitleText = $('#text').val();
            if (NewTitleText !== "" && NewbgColor !== "") {
                if (confirm('Are you sure to update settings ?')) {
                    $.post("/ManagementSection/EditItem", $("#myForm").serialize(), function (data) {
                        $('.selected').css({
                            "background-color": data.BackgroundColor,
                            'color': data.TextColor,
                            'font-family': data.TextStyle,
                            'font-style': data.fontStyle,
                            'font-weight': data.fontWeight,
                            'font-size': data.FontSize

                        });

                        $('.selected').text(data.Title);
                        $("#myForm")[0].reset();
                        $('.selected').removeClass("selected");
                    });
                }
                else {
                    evt.preventDefault();
                }
            }
            else {
                alert('Some Information missing.');
            }
        }
    });

    $(document).on("click", '#UpdateCookInstrItem', function (evt) {

        if ($('.selected').length > 1) {
            evt.preventDefault();
            alert('You have selected more than 1 item , Please unselect other items.');
        }
        else {
            // var ItemId = $('.selected').siblings('input').attr("id");
            var NewbgColor = $('#btncolor').val();
            var NewTitleText = $('#text').val();
            if (NewTitleText !== "" && NewbgColor !== "") {
                if (confirm('Are you sure to update settings ?')) {
                    $.post("/ManagementSection/UpdateCookingInstr", $("#myForm").serialize(), function (data) {
                        $('.selected').css({
                            "background-color": data.BackgroundColor,
                            'color': data.TextColor,
                            'font-family': data.TextStyle,
                            'font-style': data.fontStyle,
                            'font-weight': data.fontWeight,
                            'font-size': data.FontSize

                        });

                        $('.selected').text(data.Title);
                        $("#myForm")[0].reset();
                        $('.selected').removeClass("selected");
                    });
                }
                else {
                    evt.preventDefault();
                }
            }
            else {
                alert('Some Information missing.');
            }
        }
    });

    $(document).on("click", '#editSize', function (evt) {

        //getting Updated Values
        var ItemId = $('.selected').siblings('input').attr("id");

        var NewTitleText = $('#text').val();

        if ($(".selected").length === 0) {
            evt.preventDefault();
            alert("Please Select a button .");
        }

        else if (confirm("Are you sure to Update Settings ?")) {
            var textColor = $('#textcolor').val();
            var bgColor = $('#btncolor').val();
            var TitleText = $('#text').val();

            var textStyle = $('#fontstyle').val();

            if (TitleText !== "") {

                var size = { Id: ItemId, Title: TitleText };
                EditSize(size);
                $(".selected").text(NewTitleText);

                $('.singleitem').removeClass("selected");
            }
            else {
                alert("enter information");
            }
        }

    });

    $(document).on("click", '#editCategory', function (evt) {

        if ($('.selected').text() === "") {
            alert("Select a valid Button.");
        }
        else {

            //getting Updated Values
            var ItemId = $('.selected').siblings('input').attr("id");
            var NewtextColor = $('#textcolor').val();
            var NewbgColor = $('#btncolor').val();

            var NewTitleText = $('#text').val();

            var NewtextStyle = $('#fontstyle').val();

            if (NewTitleText !== "" && NewbgColor !== "") {

                var item = { Id: ItemId, Title: NewTitleText, BackgroundColor: NewbgColor, TextColor: NewtextColor };
                if (confirm("Are you sure to Update Settings ?")) {
                    EditCategory(item);
                    var textColor = $('#textcolor').val("");
                    var bgColor = $('#btncolor').val("");

                    var TitleText = $('#text').val("");

                    var textStyle = $('#fontstyle').val("");

                    $(".selected").css({
                        "background-color": NewbgColor,
                        "color": NewtextColor
                    });

                    $(".selected").text(NewTitleText);

                    $('.singleitem').removeClass("selected");
                }
                else {
                    evt.preventDefault();
                }

            }

            else {
                alert("Please enter information");
            }
        }
    });
    $(document).on("click", "#EditExtrasItem", function (evt) {

        //getting Updated Values

        if ($(".selectedTopping").text() === "") {
            evt.preventDefault();
            alert("Please Select a valid button .");
        }

        else if (confirm("Are you sure to Update Settings ?")) {

            var ItemId = $('.selectedTopping').siblings('input').attr("id");

            var NewTitleText = $('#text').val();

            //var textColor = $('#textcolor').val();
            //var bgColor = $('#btncolor').val();
            //var TitleText = $('#text').val();

            //var textStyle = $('#fontstyle').val();

            if (NewTitleText !== "") {

                var extraItem = { Id: ItemId, Title: NewTitleText };
                EditExtra(extraItem);
                $(".selectedTopping").text(NewTitleText);

                $('.Extraitems').removeClass("selected");
            }
            else {
                alert("enter information");
            }
        }

    });

});

function addItem(data1) {
    $.ajax({

        url: '/ManagementSection/AddItem',
        type: 'POST',
        data: JSON.stringify({
            model: data1
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $(".selected").css({
                "background-color": data.BackgroundColor,
                "color": data.TextColor
            });
            $(".selected").text(data.Title);
            $(".selected").siblings("input").attr("id", data.Id);
            alert('Data: ' + "Item Added");
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });
}

function NewItem(data) {
    var $html = '
<button class="singleitem" style="background-color:' + data.BackgroundColor + ';color:' + data.TextColor + ';font-family:' + data.TextStyle + ';font-style:' + data.fontStyle + ';font-weight:' + data.fontWeight + ';font-size:' + data.FontSize + '; " >' + data.Title + '</button><input type="hidden" id="' + data.Id + '" value="' + data.PositionNumber + '" />
' + data.Toppings + '

';
    $('#itemRow').append($html);
    $("#myForm")[0].reset();
};

function NewCookingInstrItem(data) {
    var $html = '
<button class="singleCookingItem" style="background-color:' + data.BackgroundColor + ';color:' + data.TextColor + ';font-family:' + data.TextStyle + ';font-style:' + data.fontStyle + ';font-weight:' + data.fontWeight + ';font-size:' + data.FontSize + ';" >' + data.Title + ' </button><input type="hidden" value="' + data.Id + '" />
';
    $('#CookInstrItemRow').append($html);
    $("#myForm")[0].reset();
};

function DeleteAllSuccess(data) {
    $('#itemRow div').each(function () {
        $(this).hide();
    });
    alert(data);
}
function DeleteCookingInstr(id) {

    $.ajax({

        url: '/ManagementSection/DeleteCookingInstr',
        type: 'POST',
        data: JSON.stringify({
            value: id
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            if (data) {
                $(".selected").closest("div").hide();
            }
            else {

                alert("error : smething went wrong.");
            }
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function DeleteExtra(value) {
    $.ajax({

        url: '/ManagementSection/DeleteExtra',
        type: 'POST',
        data: JSON.stringify({
            id: value
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $(".selectedTopping").closest("div").hide();
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function DeleteItem(value) {
    $.ajax({

        url: '/ManagementSection/DeleteItem',
        type: 'POST',
        data: JSON.stringify({
            id: value
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $(".selected").closest("div").hide();
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });
}
function DeleteMultipleItemsItem(Ids) {
    $.ajax({

        url: '/ManagementSection/DeleteMultipleItemsItem',
        type: 'POST',
        data: JSON.stringify({
            ids: Ids
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {

            $('.selected').each(function () {
                $(this).closest("div").hide();
            });
            alert(data);
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function DeleteCategory(value) {
    $.ajax({

        url: '/ManagementSection/DeleteCategory',
        type: 'POST',
        data: JSON.stringify({
            id: value
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $(".selected").closest("div").hide();
            $(".selected").removeClass(".selected");
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function EditSize(value) {
    $.ajax({

        url: '/ManagementSection/EditSize',
        type: 'POST',
        data: JSON.stringify({
            sizeItem: value
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            //$(".selected").closest("div").hide();
            alert(data);
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function EditExtra(value) {
    $.ajax({

        url: '/ManagementSection/EditExtra',
        type: 'POST',
        data: JSON.stringify({
            extraItem: value
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            //$(".selectedTopping").closest("div").hide();
            alert(data);
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

//function EditItem(value) {

//    $.ajax({
//        url: '/ManagementSection/EditItem',
//        type: 'POST',
//        data: JSON.stringify({
//            item: value
//        }),
//        dataType: "json",
//        contentType: "application/json; charset=utf-8",
//        success: function (data) {
//            alert(data);
//        },
//        error: function (request, error) {
//            alert("Request: " + JSON.stringify(request));
//        }
//    });
//}

function EditCategory(value) {
    $.ajax({

        url: '/ManagementSection/EditCategory',
        type: 'POST',
        data: JSON.stringify({
            category: value
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            //$(".selected").closest("div").hide();
            //$(".selected").removeClass(".selected");
            alert(data);
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function addExtraItem(data1) {
    $.ajax({

        url: '/ManagementSection/AddExrtaItem',
        type: 'POST',
        data: JSON.stringify({
            extra: data1
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {

            var html = '
<button class="Extraitem" style="background-color:hotpink;color:white">' + data.Title + ' </button><input type="hidden" id="' + data.Id + '" value="' + data.Id + '" />
'
            $('#extrasDiv').append(html);
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });
}

function addCategory(category) {
    $.ajax({
        async: false,
        url: '/ManagementSection/DefineCategories',
        type: 'POST',
        data: JSON.stringify({
            category: category
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $(".selected").css({
                "background-color": data.BackgroundColor,
                "color": data.TextColor
            });
            $(".selected").text(data.Title);
            $(".selected").siblings("input").attr("id", data.Id);
            alert('Data: ' + "Item Added");
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}

function addSize(item) {
    $.ajax({

        url: '/ManagementSection/Sizes',
        type: 'POST',
        data: JSON.stringify({
            size: item
        }),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $(".selected").text(data.Title);
            $(".selected").siblings("input").attr("id", data.Id);
            var html = '
<button class="singleSizeitem" style="background-color:aqua;color:black">' + data.Title + '</button><input id="' + data.Id + '" type="hidden" value="" />
'
            $('#sizeDiv').append(html);
        },
        error: function (request, error) {
            alert("Request: " + JSON.stringify(request));
        }
    });

}
<file_sep>
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Sale Reports";
}
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/styles/style.css" rel="stylesheet" />

            45 Minute Delay - @DateTime.Now.ToString("dd/MM/yyyy")

            Sales Reports

            @DateTime.Now.ToString("HH:mm:ss")

        <button class="largeBtn whiteBg" onclick="location.href='@Url.Action("DailySales", "ReportsManagement")'">
            Daily Sales Report
        </button>

        <button class="largeBtn skyBlueBg">
            Weekly Sales Report
        </button>

        <button class="largeBtn whiteBg" onclick="location.href='@Url.Action("MonthlySales", "ReportsManagement")'">
            Monthly Sales Report
        </button>

 <button class="btn customBttn1 redBg" style="height:48px !important;" onclick="location.href='@Url.Action("ManagementSection", "ManagementSection")'">Back</button>

<file_sep>@model IEnumerable<ProjectMy.Models.MonthlySalesViewModel>

            @Html.DisplayNameFor(model => model.MonthName)

            @Html.DisplayNameFor(model => model.TotalSale)

    @foreach (var item in Model)
    {

                @Html.DisplayFor(modelItem => item.MonthName)

                @Html.DisplayFor(modelItem => item.TotalSale)

    }

<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class OrderDetailViewModel
    {
        public bool OrderDetailsId { get; set; }

        public string ItemName { get; set; }

        public decimal ItemQty { get; set; }

        public decimal ItemTotalPrice { get; set; }
    }
}<file_sep>@model IEnumerable<DataLayer.Entities.Category>
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "TakeAyway Home";
}

                @DateTime.Now.ToString("dd/MM/yyyy")

                @DateTime.Now.ToString("HH:mm:ss")

                    @foreach (var cat in Model)
            {

                            @Html.ActionLink(@cat.Title, "TakeAway", new { categoryId = cat.Id }, new { @class = "btn landingBtns", @style = "background-color:" + cat.BackgroundColor + ";color:" + cat.TextColor + ";" })

                    }

 <button class="btn customBttn1 redBg" style="height:48px !important;" onclick="location.href='@Url.Action("MainMenu", "Home")'">Back</button>

<file_sep>
@model IEnumerable<ProjectMy.Models.DeliveriesViewModel>

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Driver Order Details";
}

        Driver Payments

                    @Html.DisplayNameFor(model => model.OrderNo)

                    @*@Html.DisplayNameFor(model => model.Time)*@
                    @Html.DisplayName("Date & Time")

                    @Html.DisplayNameFor(model => model.Name)

                    @Html.DisplayNameFor(model => model.Address)

                    @Html.DisplayNameFor(model => model.PostCode)

                    @Html.DisplayNameFor(model => model.TotalAmount)

                    @Html.DisplayNameFor(model => model.Status)

                @*	*@

                @foreach (var item in Model)
                {

                        <input type="hidden" value="@item.DeliveryId" />

                            @Html.DisplayFor(modelItem => item.OrderNo)

                            @Html.DisplayFor(modelItem => item.Time)

                            @Html.DisplayFor(modelItem => item.Name)

                            @Html.DisplayFor(modelItem => item.Address)

                            @Html.DisplayFor(modelItem => item.PostCode)

                            @Html.DisplayFor(modelItem => item.TotalAmount)

                            @Html.DisplayFor(modelItem => item.Status)

                        @*
                                @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
                                @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
                                @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
                            	*@

                }

<button class="customBttn1 skyBlueBg" id="selectall">Back to Driver List</button>

 <button class="customBttn1 skyBlueBg" id="showmap">Select All Single Method</button>

<button class="customBttn1 skyBlueBg" id="pay">Pay</button>

 <button class="customBttn1 redBg" onclick="location.href='@Url.Action("MainMenu", "Home")'">Back</button>

            Selected Orders are moved to Payment by Driver Section .

<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class DailySalesReportViewModel
    {
        public string Date { get; set; }
        public string Day { get; set; }

        [Display(Name = "Total Sale")]
        public decimal TotalSale { get; set; }
    }
}<file_sep>@model DataLayer.Entities.Item
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Menu Item";
}

                @{
                    Html.RenderAction("MenuItems");
                }

Pizza

                @using (Ajax.BeginForm("AddItem", new { val = 1 }, new AjaxOptions { HttpMethod = "POST", OnSuccess = "NewItem" }, new { id = "myForm" }))
                {
                    @Html.HiddenFor(m => m.CategoryId, new { id = "categoryId" })
                    @Html.HiddenFor(m => m.Id, new { id = "ItemId" })

                            Text

                            @Html.TextBoxFor(m => m.Title, new { id = "text", @style = "width: 84%;" })
                            @*<input type="text" id="text" style="width: 84%;" />*@

                            Toppings

                            @Html.TextAreaFor(m => m.Toppings, new { id = "toppings" })
                            @*<textarea id="toppings"></textarea>*@

                    <fieldset>
                        <legend>Fonts</legend>

Size

                                        @*
<button class="btn btn-success customBtn" value="">+</button>

<button class="btn btn-danger customBtn" value="">-</button>
*@
                                        @Html.DropDownListFor(m => m.FontSize, new List<SelectListItem>
                                    {
                                       new SelectListItem{  Text="22px" , Value="22px" },
                                    new SelectListItem{  Text="14px" , Value="14px" },
                                    new SelectListItem{  Text="16px" , Value="16px" },
                                    new SelectListItem{  Text="18px" , Value="18px" },
                                    new SelectListItem{  Text="20px" , Value="20px" },
                                    new SelectListItem{  Text="24px" , Value="24px" },
                                    new SelectListItem{  Text="26px" , Value="26px" },
                                    new SelectListItem{  Text="0px" , Value="0px" },
                                    }, new { id = "fontsize" })

                                            Style

                                                @Html.DropDownListFor(m => m.TextStyle, new List<SelectListItem>
                                    {
                                    new SelectListItem{  Text="Times New Roman" , Value="Times-New-Roman" },
                                    new SelectListItem{ Text="Verdana", Value = "Verdana" },
                                    new SelectListItem{ Text="Comic-Sans-MS", Value = "Comic-Sans-MS" },
                                    new SelectListItem{ Text="WildWest", Value = "WildWest" },
                                    new SelectListItem{ Text="Bedrock", Value = "Bedrock" },
                                    new SelectListItem{ Text="Arial", Value = "Arial" },
                                    new SelectListItem{ Text="Courier", Value = "Courier" },
                                    new SelectListItem{ Text="Tahoma", Value = "Tahoma" },
                                    new SelectListItem{ Text="Comic-Sans-MS", Value = "Comic-Sans-MS" },
                                    new SelectListItem{ Text="sans-serif", Value = "sans-serif" },
                                    }, new { id = "fontstyle" })
                                                @*<select id="fontstyle">
                <option value="Times-New-Roman">Times New Roman</option>
                <option value="Verdana">Verdana</option>
                <option value="Comic-Sans-MS">Comic Sans MS</option>
                <option value="WildWest">WildWest</option>
                <option value="Bedrock">Bedrock</option>
                <option value="Arial"> Arial</option>
                <option value="Courier"> Courier </option>
                <option value="Tahoma"> Tahoma</option>
                <option value="Times New Roman">Times New Roman</option>
                <option value="sans-serif">sans-serif</option>
            </select>*@

@Html.CheckBoxFor(m => m.IsBold, new { id = "isBold" })Bold  @*<input type="checkbox" id="isBold" />Bold*@

@Html.CheckBoxFor(m => m.IsItalic, new { id = "isitalic" })italic  @*<input type="checkbox" id="isitalic" />italic*@

Text color

                                    @*  @Html.TextBoxFor(m => m.TextColor, new { id = "textcolor", type = "color", @class = "colorfields" })*@
                                    <input id="textcolor" type="color" class="colorfields" value="#ffffff" name="TextColor" />

Button color

                                    @*  @Html.TextBoxFor(m => m.BackgroundColor, new { id = "btncolor", type = "color", @class = "colorfields" })*@
                                    <input id="btncolor" type="color" name="BackgroundColor" class="colorfields" value="#ffffff" />

                            @*

                                        <input type="checkbox" />Vatable

                                        VAT Rate

*@

                    </fieldset>

                    <fieldset>
                        <legend>Menu Buttons</legend>

                                <button class="menuBtn btn-success" id="addItem" type="submit">Add Item</button>

                                <button class="menuBtn btn-danger" id="deleteItem" type="button">Delete Item</button>

                                <button class="menuBtn btn-info" id="editItem" type="button" disabled>Update Item</button>

                    </fieldset>
                }

                        @using (Ajax.BeginForm("DeleteAllItems", new AjaxOptions { HttpMethod = "POST", OnSuccess = "DeleteAllSuccess" }))
                        {
                            @Html.Hidden("CategoryId", null, new { id = "deleteAllCatId" })
                            <button class="menuBtn btn-danger" id="deleteAll" type="submit">Delete All </button>
                        }

<button type="button" class="sizeVerBtn greenBg" onclick="location.href='@Url.Action("Sizes","ManagementSection")'">Sizes()</button>

<button type="button" class="sizeVerBtn pinkBg">Verieties()</button>

<button type="button" class="sizeVerBtn pinkBg" onclick="location.href='@Url.Action("Extras","ManagementSection")'">Extras</button>

                @{ Html.RenderAction("GetCategories"); }

<button type="button" class="customBttn2 skyBlueBg">Meal Deals</button>

<button type="button" class="customBttn2 skyBlueBg" id="cookingInstr">Cooking Instructions</button>

<button type="button" class="customBttn2 skyBlueBg">Freebies</button>

<button type="button" class="customBttn2 skyBlueBg">Special Pizza</button>

<button type="button" class="customBttn2 greenBg" onclick="location.href='@Url.Action("Prices", "ManagementSection" )'">Prices</button>

<button type="button" class="customBttn2 redBg" onclick="location.href='@Url.Action("DataFiles", "ManagementSection" )'">Back</button>

<button type="button" class="customBttn2 redBg" onclick="location.href='@Url.Action("MainMenu", "Home" )'">Exit</button>

<file_sep>using DataLayer.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Entities
{
    public class MealDeal
    {
        [Key]
        public int Id { get; set; }

        public string Title { get; set; }
        public string BackgroundColor { get; set; }
        public string TextStyle { get; set; }
        public string TextColor { get; set; }
        public bool IsBold { get; set; }
        public bool IsItalic { get; set; }
        [MaxLength(5)]
        public string FontSize { get; set; }

        public int CategoryId { get; set; }

    }
}
<file_sep>using DataLayer.DAC;
using ProjectMy.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjectMy.Controllers
{
    public class OrderManagementController : Controller
    {
        [HttpGet]
        public ActionResult AwaitCollections()
        {
            var CollectionOrders = DAC.GetCollectionOrders();
            List<AwaitOrderModel> awaitorders = new List<AwaitOrderModel>();
            foreach (var ord in CollectionOrders)
            {
                var order = DAC.GetOrder(ord.OrderId);
                var customer = DAC.FindCustomerById(order.CustomerId);
                AwaitOrderModel collectionOrder = new AwaitOrderModel()
                {
                    AwaitOrderId = ord.Id,
                    OrderNo = order.OrderId,
                    Date = order.Date.ToString("dd/MM/yyyy"),
                    Status = ((Constants.PaymentType)order.Status).ToString(),
                    TotalAmount = order.TotalAmount,
                    Collect = order.Date.ToString("HH:mm:ss"),
                    Name = customer.FirstName + " " + customer.SurName,
                    Telephone = customer.Phone
                };

                awaitorders.Add(collectionOrder);
            }
            return View(awaitorders);
        }

        [HttpGet]
        public ActionResult EditRecords()
        {
            var AllOrders = DAC.GetAllOrdersDesc();
            List<OrderViewModel> OrdersList = new List<OrderViewModel>();
            foreach (var order in AllOrders)
            {
                var customer = DAC.FindCustomerById(order.CustomerId);
                OrderViewModel listItem = new OrderViewModel()
                {
                    OrderId = order.OrderId,
                    OrderNo = order.OrderId,
                    Date = order.Date.ToString("dd/MM/yyyy"),
                    Status = ((Constants.PaymentType)order.Status).ToString(),
                    TotalAmount = order.TotalAmount,
                };
                if (customer != null)
                {
                    listItem.Name = customer.FirstName + " " + customer.SurName;
                    listItem.Telephone = customer.Phone;
                }
                OrdersList.Add(listItem);
            }
            return View(OrdersList);
        }
        [HttpPost]
        public ActionResult RemoveAwaitOrder(int id)
        {
            DAC.RemoveCollectionOrder(id);
            return Json(true, JsonRequestBehavior.AllowGet);
        }
    }
}<file_sep>namespace DataLayer.Migrations
{
    using Entities;
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<DataLayer.myContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
            AutomaticMigrationDataLossAllowed = true;

        }

        //protected override void Seed(DataLayer.myContext context)
        //{
        //    Item item = new Item();
        //    item.BackgroundColor = "black";
        //    item.FontSize = 15;
        //    item.TextColor = "white";
        //    item.TextStyle = "verdana";
        //    item.Title = "Test";
        //    item.IsBold = true;
        //    item.IsItalic = true;
        //    item.Toppings = "Test";
        //    item.Price1 = 1;
        //    item.Price2 = 2;
        //    item.Price3 = 3;
        //    item.CategoryId = 1;

        //    Category category = new Category()
        //    {
        //        Title = "Pizza",
        //        BackgroundColor = "green",
        //        TextColor = "white",
        //    };

        //    context.Categories.AddOrUpdate(category);
        //    context.Items.AddOrUpdate(item);
        //}
    }
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Models
{
    public class Properties
    {
        public string Title { get; set; }
        public string BackgroundColor { get; set; }
        public string TextStyle { get; set; }
        public string TextColor { get; set; }
        public bool IsBold { get; set; }
        public bool IsItalic { get; set; }
        [MaxLength(5)]
        public string FontSize { get; set; }
        public int PositionNumber { get; set; }
    }
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Entities
{
    public class Discount
    {
        [Key]
        public int Id { get; set; }
        public string Title { get; set; }

        public string BackgroundColor { get; set; }

        public string TextColor { get; set; }

        [MaxLength(5)]
        public string FontSize { get; set; }

    }
}
<file_sep>@model IEnumerable<DataLayer.Entities.ExtrasAndTopping>

Toppings

            Items
            10"
            12"
            14"

            Actions

        @foreach (var item in Model)
        {
            using (Html.BeginForm("UpdatePrices", "ManagementSection", FormMethod.Post, new { @class = "form1", @id = item.Id }))
            {

                    @item.Title <input type="hidden" name="ItemId" value="@item.Id" class="fields" />

                        <input name="price1" type="text" readonly value="@item.Price1" class="fields" />

                    <input name="price2" type="text" readonly value="@item.Price2" class="fields" />

                    <input type="text" name="price3" readonly value="@item.Price3" class="fields" />

                    <button type="button" class="btn bttn btn-info">Edit Price</button> <input type="submit" disabled class="btn btn-success btnExtrasSubmit" value="Update Price" id="@item.Id" />

            }
        }

<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class CookingInstrViewModel
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string BackgroundColor { get; set; }
        public string TextStyle { get; set; }
        public string TextColor { get; set; }
        public string fontWeight { get; set; }
        public string fontStyle { get; set; }
        public string FontSize { get; set; }

    }
}<file_sep>@model IEnumerable<ProjectMy.Models.ItemViewModel>

    @foreach (var item in Model)
    {
        var name = DataLayer.DAC.DAC.GetCategoryNameById(item.CategoryId);
        if (name.ToLower().StartsWith("pizza") && name.ToLower().EndsWith("pizza"))
        {

                <button class="pizzItem" id="@item.Id" style="font-style:@item.fontStyle;font-weight:@item.fontWeight;font-family:@item.TextStyle; background-color:@item.BackgroundColor;color:@item.TextColor;font-size:@item.FontSize;">@item.Title</button>
                <input type="hidden" value="@item.PositionNumber" />
                <input type="hidden" value="@item.Id" class="itemId" />

        }
        else
        {

                <button class="singleitem" id="@item.Id" style="font-style:@item.fontStyle;font-weight:@item.fontWeight;font-family:@item.TextStyle; background-color:@item.BackgroundColor;color:@item.TextColor;font-size:@item.FontSize;">@item.Title</button>
                <input type="hidden" value="@item.PositionNumber" />
                <input type="hidden" value="@item.Id" class="itemId" />

        }
    }

<file_sep>using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Web;

namespace ProjectMy.Models
{
    public class PrintModel
    {
        public List<OrderDetailViewModel> ordersItems { get; set; }
        public string CustomerName { get; set; }
        public float TotalAmount { get; set; }
        public float totalpaid { get; set; }
        public float balance { get; set; }

        public PrintModel()
        {

        }

        public PrintModel(List<OrderDetailViewModel> orders, string CustomerName = "Test", int totalpaid = 0, int balance = 0)
        {
            this.balance = balance;
            this.CustomerName = CustomerName;
            this.ordersItems = orders;
            this.totalpaid = totalpaid;
        }

        public void PrintReceiptForTransaction()
        {

            PrintDocument recordDoc = new PrintDocument();

            recordDoc.DocumentName = "Customer Receipt";
            recordDoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage); // function below
            recordDoc.PrintController = new StandardPrintController(); // hides status dialog popup

            PrinterSettings ps = new PrinterSettings();
            //ps.PrinterName = "EPSON TM-T20II Receipt";
            recordDoc.PrinterSettings = ps;
            recordDoc.Print();

            recordDoc.Dispose();

        }

        private void pdoc_PrintPage(object sender, PrintPageEventArgs e)
        {
            const int FIRST_COL_PAD = 20;
            const int SECOND_COL_PAD = 7;
            const int THIRD_COL_PAD = 20;

            Graphics graphics = e.Graphics;
            Font font = new Font("Courier New", 10);
            float fontHeight = font.GetHeight();
            int startX = 50;
            int startY = 55;
            int Offset = 40;
            graphics.DrawString("Welcome to Resturant", new Font("Courier New", 14),
                                new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;
            graphics.DrawString("Reciept No:" + 123,
                     new Font("Courier New", 14),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;
            graphics.DrawString("Date :" + DateTime.Now,
                     new Font("Courier New", 12),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;
            String underLine = "------------------------------------------";
            graphics.DrawString(underLine, new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);

            Offset = Offset + 20;
            //String Source = "Ashar";
            graphics.DrawString("QTY" + "   Item                Price" , new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);

            Offset = Offset + 20;
            String underLine1= "------------------------------------------";
            graphics.DrawString(underLine1, new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            foreach (var item in this.ordersItems)
            {
                Offset = Offset + 20;
                StringBuilder sb = new StringBuilder();
                sb.Append(item.ItemQty.ToString().PadRight(5));
                //int maxLength = 30;
                //var length = item.ItemName.Length;
                //float numbofLines = length / maxLength;
                //if(numbofLines>1)
                //{
                //    for (int i=1;i<=numbofLines;i++)
                //    {
                //        if ((length / maxLength * i) >= 1)
                //        {
                //            sb.AppendLine(item.ItemName.Substring(maxLength * (i - 1), maxLength * i));
                //        }

                //        else {
                //            sb.AppendLine(item.ItemName.Substring(maxLength * (i - 1), length));
                //        }
                //    }

                //}
                sb.Append(item.ItemName.PadRight(10));
                sb.Append(item.ItemTotalPrice.ToString().PadLeft(15));
                graphics.DrawString( sb.ToString() , new Font("Courier New", 10),
                         new SolidBrush(Color.Black), startX, startY + Offset);
            }

            Offset = Offset + 20;
            underLine = "------------------------------------------";
            graphics.DrawString(underLine, new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;

            graphics.DrawString("Total    " + this.TotalAmount, new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;

            graphics.DrawString("Sub Total    " + this.TotalAmount, new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;

            graphics.DrawString("Total Paid   " + this.totalpaid, new Font("Courier New", 10),
                     new SolidBrush(Color.Black), startX, startY + Offset);
            Offset = Offset + 20;

            graphics.DrawString("Balance " + this.balance, new Font("Courier New", 10),
                                 new SolidBrush(Color.Black), startX, startY + Offset);
        }

    }
}<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class CustomerViewModel
    {
        public static Customer customer { get; set; }
        public static int OrderType { get; set; }
        static CustomerViewModel() {
            customer = null;
            OrderType = 0;
        }
    }
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class DriverPaymentViewModel
    {
        public int DriverId { get; set; }
        public string Name { get; set; }
        public int Trips { get; set; }
        public decimal Total { get; set; }
        public decimal Paid { get; set; }
        public decimal Balance { get; set; }
    }
}<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class MonthlySalesViewModel
    {
        [Display(Name ="Month Name")]
        public string MonthName { get; set; }

        [Display(Name ="Total sale")]
        public decimal TotalSale { get; set; }
    }
}<file_sep>
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Monthly Sales";
}

<link href="~/Content/styles/reports.css" rel="stylesheet" />

            @DateTime.Now.ToString("dd/MM/yyyy")

            Monthly Sale Report

            @DateTime.Now.ToString("HH:mm:ss")

            @using (Ajax.BeginForm("MonthlySales", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "ReportPreview", InsertionMode = InsertionMode.Replace }))
            {

                        @Html.Label("From", htmlAttributes: new { @class = "control-label col-md-2" })

                            <input type="text" class="form-control" name="From" id="from" />

                        @Html.Label("To", htmlAttributes: new { @class = "control-label col-md-2" })

                            <input type="text" class="form-control" name="To" id="to" />

                <input type="submit" value="Submit" class="btn btn-success" />
            }

 <button class="btn customBttn1 redBg" style="height:48px !important;" onclick="location.href='@Url.Action("SalesReport", "ReportsManagement")'">Back</button>

<file_sep>using DataLayer.DAC;
using DataLayer.Entities;
using DataLayer.Models;
using ProjectMy.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProjectMy.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        DAC data = new DAC();
        public ActionResult MainMenu()
        {
            return View();
        }

        public ActionResult Login()
        {
            List<String> names = new List<string>()
            {
                "Admin",
                "Houshang",
                "David",
                "Paula",
                "Lean",
                "Ezima"
            };
            return View(names);
        }

        [HttpGet]
        public ActionResult TakeAway(int categoryId = 1)
        {
            if (CustomerViewModel.OrderType == 0)
            {
                CustomerViewModel.OrderType = (int)Constants.OrderType.TakeAway;
            }
            ViewData["CategoryID"] = categoryId;
            var orderdetails = (List<OrderDetail>)TempData["orderlist"];
            RepeatOrderViewModel list = new RepeatOrderViewModel()
            {
                OrderDetails = new List<OrderDetail>(),
                Total = 0
            };
            if (orderdetails != null)
            {
                RepeatOrderViewModel order = new RepeatOrderViewModel();
                order.OrderDetails = orderdetails;
                order.Total = orderdetails.Sum(m => m.Amount);
                ViewData["OrderDetailsList"] = order;
            }
            else
            {
                ViewData["OrderDetailsList"] = list;
            }

            return View();
        }

        public PartialViewResult ItemsView(string deptName = "Pizza")
        {
            return PartialView("_ItemsView");
        }

        [HttpPost]
        public JsonResult CompleteOrder(List<OrderDetail> orders)
        {
            TempData["ordersList"] = orders;
            return Json("ok", JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public ActionResult OrderComplete(List<OrderDetail> orders)
        {
            if (CustomerViewModel.customer != null)
            {
                ViewData["CustomerName"] = CustomerViewModel.customer.FirstName;
                ViewData["CustomerAddress"] = CustomerViewModel.customer.Address1;
            }
            TempData["orderlist"] = orders;
            return View(orders);
        }

        [HttpPost]
        public JsonResult PrintOrder(PrintModel model)
        {
            model.PrintReceiptForTransaction();
            return Json("Order Printed", JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public JsonResult ClearCash(List<OrderDetail> ordersDetails, Order order)
        {
            order.OrderType = CustomerViewModel.OrderType;
            int NewCustomerId = 0;
            order.Date = DateTime.Now;
            order.Status = (int)Constants.PaymentStatus.Paid;
            if (CustomerViewModel.customer != null)
            {
                NewCustomerId = DAC.AddOrUpdateCustomer(CustomerViewModel.customer);
                var NewOrder = DAC.AddOrder(order);
                NewOrder.CustomerId = NewCustomerId;

                if (CustomerViewModel.OrderType == (int)Constants.OrderType.Collection)
                {
                    DAC.AddCollectionOrder(NewOrder.OrderId);
                }
                if (CustomerViewModel.OrderType == (int)Constants.OrderType.Delivery)
                {
                    DAC.AddDeliverytoDespatch(NewOrder.OrderId);
                }

                foreach (var item in ordersDetails)
                {
                    item.OrderId = NewOrder.OrderId;
                    DAC.AddOrderDetails(item);
                }
                CustomerViewModel.customer = null;
                CustomerViewModel.OrderType = 0;
                return Json("Order Completed", JsonRequestBehavior.AllowGet);
            }

            else
            {
                var NewOrder1 = DAC.AddOrder(order);
                foreach (var item in ordersDetails)
                {
                    item.OrderId = NewOrder1.OrderId;
                    DAC.AddOrderDetails(item);
                }
                CustomerViewModel.customer = null;
                CustomerViewModel.OrderType = 0;

                return Json("Order Completed", JsonRequestBehavior.AllowGet);
            }

        }

        [ChildActionOnly]
        public PartialViewResult GetCategories()
        {
            return PartialView("_Categories", DAC.GetAllCategories());
        }

        [HttpGet]
        public PartialViewResult TakeAwayItems(int categoryId = 1)
        {
            List<Item> Items = DAC.GetItemsByCategoryId(categoryId);
            List<ItemViewModel> ViewItems = new List<ItemViewModel>();
            foreach (var item in Items)
            {
                ItemViewModel viewitem = new ItemViewModel();
                viewitem.BackgroundColor = item.BackgroundColor;
                viewitem.TextColor = item.TextColor;
                viewitem.TextStyle = item.TextStyle;
                viewitem.Id = item.Id;
                viewitem.Title = item.Title;
                viewitem.CategoryId = item.CategoryId;
                viewitem.FontSize = item.FontSize;
                viewitem.Toppings = item.Toppings;
                if (item.IsBold)
                {
                    viewitem.fontWeight = "Bold";
                }
                else
                {
                    viewitem.fontWeight = "normal";
                }
                if (item.IsItalic)
                {
                    viewitem.fontStyle = "italic";
                }
                else
                {
                    viewitem.fontStyle = "normal";
                }

                ViewItems.Add(viewitem);
            }

            return PartialView("_TakeAwayItems", ViewItems);

            //List<Item> model = new List<Item>();
            //model = DAC.GetItemsByCategoryId(categoryId);

            //return PartialView("_TakeAwayItems", model);
        }
        [HttpGet]
        public JsonResult GetItemPrice(int itemID, int sizeId)
        {
            decimal price = DAC.GetItemPrice(itemID, sizeId);
            return Json(price, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public JsonResult GetExtrasPrices(List<int> toppingIds, int sizeId = 0)
        {
            decimal price = DAC.GetExtrasPrices(toppingIds, sizeId);
            return Json(price, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public PartialViewResult GetSizes(int categoryId)
        {
            return PartialView("_GetSizes", DAC.GetSizesByCategoryId(categoryId));
        }

        [HttpGet]
        public PartialViewResult GetExtras(int categoryId)
        {
            return PartialView("_GetExtras", DAC.GetExtrasByCategoryId(categoryId));
        }

        [ChildActionOnly]
        public PartialViewResult GetSizesPartial(int categoryId)
        {
            return PartialView("_GetSizes", DAC.GetSizesByCategoryId(categoryId));
        }

        [ChildActionOnly]
        public PartialViewResult GetExtrasPartial(int categoryId)
        {
            return PartialView("_GetExtras", DAC.GetExtrasByCategoryId(categoryId));
        }

        [HttpGet]
        public ActionResult TakeAwayHome()
        {
            var result = DAC.GetAllCategories();
            if (result != null)
            {
                return View(result);
            }
            else
            {
                return View(new List<Category>());
            }
        }

        [HttpGet]
        public ActionResult Discounts()
        {
            var list = new List<Discount>();
            list = DAC.GetAllDiscounts();
            return PartialView("_Discounts", list);
        }

    }
}<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class RepeatOrderViewModel
    {
        public List<OrderDetail> OrderDetails { get; set; }
        public decimal Total { get; set; }
    }

}<file_sep>using DataLayer.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer
{
    public class myContext : DbContext
    {
        public myContext() : base("POSdb")
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<myContext, DataLayer.Migrations.Configuration>("POSdb"));

        }

        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderDetail> OrderDetails { get; set; }
        public DbSet<Category> Categories { get; set; }
        public DbSet<Item> Items { get; set; }
        public DbSet<Size> Sizes { get; set; }
        public DbSet<ExtrasAndTopping> ExtrasAndToppings { get; set; }
        public DbSet<Customer> Customers { get; set; }
        public DbSet<PaymentType> PaymentTypes { get; set; }
        public DbSet<Discount> Discounts { get; set; }
        public DbSet<CookingInstruction> CookingInstructions { get; set; }
        public DbSet<AwaitOrder> AwaitOrders { get; set; }
        public DbSet<Staff> Staff { get; set; }
        public DbSet<DeliverytoDespatch> DeliveriestoDespatch { get; set; }
        public DbSet<MealDeal> MealDeals { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Size>().ToTable("Size");
            modelBuilder.Entity<Item>().ToTable("Item");
            modelBuilder.Entity<ExtrasAndTopping>().ToTable("ExtrasAndTopping");
            modelBuilder.Entity<Category>().ToTable("Category");
            modelBuilder.Entity<OrderDetail>().ToTable("OrderDetail");
            modelBuilder.Entity<Order>().ToTable("Order");
            modelBuilder.Entity<Customer>().ToTable("Customer");
            modelBuilder.Entity<PaymentType>().ToTable("PaymentType");
            modelBuilder.Entity<Discount>().ToTable("Discount");
            modelBuilder.Entity<CookingInstruction>().ToTable("CookingInstruction");
            modelBuilder.Entity<Staff>().ToTable("Staff");
            modelBuilder.Entity<DeliverytoDespatch>().ToTable("DeliverytoDespatch");
            modelBuilder.Entity<AwaitOrder>().ToTable("AwaitOrder");

            base.OnModelCreating(modelBuilder);
        }
    }
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;

namespace ProjectMy.Models
{
    public class AwaitOrderModel
    {
        public int AwaitOrderId { get; set; }

        public int OrderNo { get; set; }

        public string Date { get; set; }

        public string Name { get; set; }

        public string Telephone { get; set; }

        [DisplayName("Total Amount")]
        public decimal TotalAmount { get; set; }

        public string Status { get; set; }

        public string Collect { get; set; }

    }
}

languages: HTML+Razor C# JavaScript

repo_language: HTML+Razor