Beispiel #1
0
        public void ProcessUpdate()
        {
            Console.WriteLine("===== syncDataAgent =====");
            var agentDao = new AgentDataNewDao();
            var list     = agentDao.GetListAgentUpdate();

            if (list == null)
            {
                return;
            }

            for (var i = 0; i < list.Count; i++)
            {
                var data    = list[i];
                var payeeid = int.Parse(data.PayeeID,
                                        NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite); // returns 100

                var logDao   = new LogAgentDataNewDao();
                var logAgent = logDao.FindById(payeeid);

                if (logAgent != null && data.UpdatedDate != null &&
                    logAgent.CREATEDDATE != null &&
                    data.UpdatedDate > logAgent.CREATEDDATE)
                {
                    Console.WriteLine("AgentDataUpdateSyncService || payeeid : " + payeeid);

                    UpdateAgent(data, logAgent.IDPROFILE);
                }
            }
        }
Beispiel #2
0
        public void ProcessDelete()
        {
            var agentDAO = new AgentDataNewDao();
            var list     = agentDAO.GetListAgentDelete();

            if (list == null)
            {
                return;
            }

            for (var i = 0; i < list.Count; i++)
            {
                var data    = list[i];
                var payeeid = int.Parse(data.PayeeID,
                                        NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite); // returns 100

                var logDao   = new LogAgentDataNewDao();
                var logAgent = logDao.FindById(payeeid);
                if (logAgent != null &&
                    data.DeletedDate != null &&
                    logAgent.IDPROFILE != null)
                {
                    DeleteData((int)logAgent.IDPROFILE);
                }
            }
        }
        public void ProcessData()
        {
            AgentDataNewDao     dao  = new AgentDataNewDao();
            List <AgentDataNew> list = dao.GetListAgentNew();

            if (list == null)
            {
                return;
            }

            Console.WriteLine("data.PayeeID : " + list.Count);
            // var data = list[0];
            // Console.WriteLine("data.PayeeID : "+data.PayeeID);
            // var payeeid = int.Parse(data.PayeeID,
            // NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite);
            // var logDao = new LogAgentDataNewDao();
            // var logAgent = logDao.FindById(payeeid);
            // Console.WriteLine("logAgent : "+logAgent);
            // if (logAgent == null)
            //     ProcessData(data);

            foreach (var data in list)
            {
                // Console.WriteLine("data.PayeeID : "+data.PayeeID);
                var payeeid = int.Parse(data.PayeeID,
                                        NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite); // returns 100

                var logDao   = new LogAgentDataNewDao();
                var logAgent = logDao.FindById(payeeid);

                if (logAgent == null)
                {
                    ProcessData(data);
                }
            }
        }