예제 #1
0
        private void Interface_StockByCustomer(DateTime lastupdate)
        {
            List <StockByCustomer> lstStkCust;

            try
            {
                //eventLog1.WriteEntry("Get Stock By Customer", EventLogEntryType.Information);
                //get data from oracle database
                using (QueryBLL oraQuery = new QueryBLL())
                {
                    lstStkCust = oraQuery.GetStockByCustomer();
                }

                // Insert data to SQLite database
                if (lstStkCust != null)
                {
                    //eventLog1.WriteEntry("SQLite Stock By Customer", EventLogEntryType.Information);
                    using (InterfaceBLL infBll = new InterfaceBLL())
                    {
                        infBll.InsertStockByCustomer(lstStkCust, lastupdate);

                        infBll.DeleteStockByCustomer();

                        infBll.UpdateStockByCustomer();
                    }
                }
            }
            catch (Exception ex)
            {
                eventLog1.WriteEntry(ex.Message, EventLogEntryType.Error);
            }
        }