Example #1
0
        private void AddPendingItems(string parentId, string wwpParentId, string consignmentNo)
        {
            //insert into pending items
            var pendingConsole = new Adapters.Oal.dbo_event_pending_console
            {
                id          = GenerateId(20),
                event_id    = parentId,
                event_class = "pos.oal.DeliveryEventNew",
                console_no  = consignmentNo,
                version     = 0,
                date_field  = DateTime.Now
            };

            m_deliEventPendingConsoleRows.Add(pendingConsole);

            var pendingWwp = new Adapters.Oal.dbo_event_pending_console
            {
                id          = GenerateId(20),
                event_id    = wwpParentId,
                event_class = "pos.oal.WwpEventNewLog",
                console_no  = consignmentNo,
                version     = 0,
                date_field  = DateTime.Now
            };

            m_deliEventPendingConsoleRows.Add(pendingWwp);
        }
Example #2
0
        private async Task <IEnumerable <Adapters.Oal.dbo_event_pending_console> > SearchEventPendingAsync(string consoleNo)
        {
            var pendingAdapter = new Adapters.Oal.dbo_event_pending_consoleAdapter();
            var query          = $"SELECT [id], [event_class], [event_id] FROM [dbo].[event_pending_console] WHERE console_no = '{consoleNo}'";

            var list = new List <Adapters.Oal.dbo_event_pending_console>();

            using (var conn = new SqlConnection(pendingAdapter.ConnectionString))
                using (var cmd = new SqlCommand(query, conn))
                {
                    await conn.OpenAsync();

                    using (var reader = await cmd.ExecuteReaderAsync())
                    {
                        while (await reader.ReadAsync())
                        {
                            var item = new Adapters.Oal.dbo_event_pending_console
                            {
                                id          = reader["id"].ReadNullableString(),
                                event_class = reader["event_class"].ReadNullableString(),
                                event_id    = reader["event_id"].ReadNullableString()
                            };
                            list.Add(item);
                        }
                    }
                }
            return(list);
        }
Example #3
0
        private Adapters.Oal.dbo_event_pending_console GetPendingConsoleRow(string parentId, string consignmentNo)
        {
            var pendingConsole = new Adapters.Oal.dbo_event_pending_console
            {
                id          = GenerateId(20),
                event_id    = parentId,
                event_class = "pos.oal.DeliveryConsoleEventNew",
                console_no  = consignmentNo,
                version     = 0,
                date_field  = DateTime.Now
            };

            return(pendingConsole);
        }
        private void AddPendingItems(string parentId, string wwpParentId, string consignmentNo)
        {
            //insert into pending items
            var pendingConsole = new Adapters.Oal.dbo_event_pending_console();

            pendingConsole.id          = GenerateId(20);
            pendingConsole.event_id    = parentId;
            pendingConsole.event_class = "pos.oal.HipEventNew";
            pendingConsole.console_no  = consignmentNo;
            pendingConsole.version     = 0;
            pendingConsole.date_field  = DateTime.Now;
            m_hipEventPendingConsoleRows.Add(pendingConsole);

            var pendingWwp = new Adapters.Oal.dbo_event_pending_console();

            pendingWwp.id          = GenerateId(20);
            pendingWwp.event_id    = wwpParentId;
            pendingWwp.event_class = "pos.oal.WwpEventNewLog";
            pendingWwp.console_no  = consignmentNo;
            pendingWwp.version     = 0;
            pendingWwp.date_field  = DateTime.Now;
            m_hipEventPendingConsoleRows.Add(pendingWwp);
        }
Example #5
0
        private async Task ProcessEventPendingItem(Norms.Domain.Norm norm, Adapters.Oal.dbo_event_pending_console pending)
        {
            var itemList = norm.AllConsignmentNotes.Split(new[] { ',', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            var ok       = false;

            switch (pending.event_class)
            {
            case "pos.oal.DeliveryEventNew":
                await ProcessDeliveryPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.SopEventNew":
                await ProcessSopPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.SipEventNew":
                await ProcessSipPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.HipEventNew":
                await ProcessHipPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.HopEventNew":
                await ProcessHopPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.StatusEventNew":
                await ProcessStatPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.VasnEventNew":
                await ProcessVasnPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.NormalConsoleEventNew":
                //ProcessNormPendingItem(item.console_no, item.event_id);
                break;

            case "pos.oal.MissortEventNew":
                await ProcessMissPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.WwpEventNewLog":
                await ProcessWwpPendingItem(pending.event_id, itemList);

                ok = true;
                break;

            case "pos.oal.IpsImport":
                await ProcessIpsPendingItem(pending.event_id, itemList);

                ok = true;
                break;
            }

            if (ok)
            {
                var pendingAdapter = new Adapters.Oal.dbo_event_pending_consoleAdapter();
                await pendingAdapter.DeleteAsync(pending.id);
            }
        }