public List<InventoryStockReport> GetSaleReport(List<InventoryStockReport> aInventoryStockReports, DateTime fromdate, DateTime todate)
        {
            InventoryKitchenStockReportDAO aInventoryStockReportDao = new InventoryKitchenStockReportDAO();
            List<InventoryStockReport> aList=new List<InventoryStockReport>();
            aList = aInventoryStockReportDao.GetSaleReport(fromdate, todate);

            foreach (InventoryStockReport report in aInventoryStockReports)
            {
                report.BalancePrice = report.BalanceQty*report.UnitPrice;
                foreach (InventoryStockReport stockReport in aList)
                {
                    if(stockReport.Date==report.Date && stockReport.ItemId==report.ItemId)
                    {
                        report.SaleQty = stockReport.SaleQty;
                        report.Price = stockReport.Price;
                    }
                }
            }
             List<InventoryStockReport> aList2=new List<InventoryStockReport>();
            foreach (InventoryStockReport stockReport in aList)
            {
                int flag = 0;
                foreach (InventoryStockReport report in aInventoryStockReports)
                {
                    if (stockReport.Date == report.Date && stockReport.ItemId == report.ItemId)
                    {
                        flag = 1;
                    }
                }
                if (flag == 0)
                {
                    InventoryItem aInventoryItem = aInventoryItemBll.GetInventoryItem(stockReport.ItemId);
                    stockReport.ItemName = aInventoryItem.ItemName;
                    stockReport.CategoryName = aInventoryItem.CategoryName;

                    aList2.Add(stockReport);
                }
            }
            aInventoryStockReports.AddRange(aList2);
            return aInventoryStockReports;
        }
        public List<InventoryStockReport> GetInventoryKitchenStockReportBetweenDate(DateTime fromdate, DateTime todate)
        {
            List<InventoryStockReport> aInventoryStockReports = new List<InventoryStockReport>();
            List<InventoryStockReport> aInventoryStockReports1 = new List<InventoryStockReport>();
            InventoryKitchenStockReportDAO aInventoryStockReportDao = new InventoryKitchenStockReportDAO();
            aInventoryStockReports = aInventoryStockReportDao.GetInventoryKitchenStockReportBetweenDate(fromdate, todate);

            if (todate >= DateTime.Today)
            {
                DateTime todate1 = DateTime.Today.AddDays(1);
                DateTime fromdate1 = DateTime.Today;
                todate1 = todate.AddSeconds(-1);
                aInventoryStockReports1 = GetTodayReport(fromdate1,todate1);
                foreach (InventoryStockReport report in aInventoryStockReports1)
                {
                    aInventoryStockReports.Add(report);
                }
            }
            aInventoryStockReports = GetSaleReport(aInventoryStockReports,fromdate,todate);
            return aInventoryStockReports;
        }
 public void CheckInsertOrNotForKitchen()
 {
     InventoryKitchenStockReportDAO aInventoryKitchenStockReportDao = new InventoryKitchenStockReportDAO();
     bool check = aInventoryKitchenStockReportDao.CheckInsertOrNotForKitchen();
     if (check) InsertInventoryKitchenStock();
 }
 public void InsertInventoryKitchenStock()
 {
     List<InventoryStockReport> aInventoryStockReports = new List<InventoryStockReport>();
     DateTime todate = DateTime.Today;
     DateTime fromdate = todate.AddDays(-1);
     todate = todate.AddSeconds(-1);
     aInventoryStockReports = GetTodayReport(fromdate,todate);
     InventoryKitchenStockReportDAO aInventoryKitchenStockReportDao = new InventoryKitchenStockReportDAO();
     aInventoryKitchenStockReportDao.InsertInventoryKitchenStock(aInventoryStockReports);
 }