public ActionResult SalesInvoiceFoodMenu(SalesInvoiceModel purchaseModel, string Cancel)
        {
            purchaseModel.CustomerList = _iDropDownService.GetCustomerList();
            purchaseModel.StoreList    = _iDropDownService.GetStoreList();
            purchaseModel.EmployeeList = _iDropDownService.GetEmployeeList();
            string purchaseMessage = string.Empty;

            if (!ModelState.IsValid)
            {
                string errorString = this.ValidationPurchaseInvoice(purchaseModel);
                if (!string.IsNullOrEmpty(errorString))
                {
                    return(Json(new { error = true, message = errorString, status = 201 }));
                }
            }

            if (purchaseModel.SalesInvoiceDetails != null)
            {
                if (purchaseModel.SalesInvoiceDetails.Count > 0)
                {
                    purchaseModel.InventoryType = 1;
                    if (purchaseModel.Id > 0)
                    {
                        int result = _iSalesInvoiceService.UpdatePurchaseInvoiceFoodMenu(purchaseModel);
                        if (result > 0)
                        {
                            purchaseMessage = _locService.GetLocalizedHtmlString("EditSuccss");
                        }
                    }
                    else
                    {
                        purchaseModel.ReferenceNo = _iSalesInvoiceService.ReferenceNumberFoodMenu().ToString();

                        int result = _iSalesInvoiceService.InsertPurchaseInvoiceFoodMenu(purchaseModel);
                        if (result > 0)
                        {
                            purchaseMessage = _locService.GetLocalizedHtmlString("SaveSuccess") + " Reference No is: " + result.ToString();
                        }
                    }
                }
                else
                {
                    purchaseMessage = _locService.GetLocalizedHtmlString("ValidPurchaseInvoiceDetails");
                    return(Json(new { error = true, message = purchaseMessage, status = 201 }));
                }
            }
            else
            {
                purchaseMessage = _locService.GetLocalizedHtmlString("ValidPurchaseInvoiceDetails");
                return(RedirectToAction("SalesInvoice", "SalesInvoiceFoodMenu"));
            }
            return(Json(new { error = false, message = purchaseMessage, status = 200 }));
        }