Пример #1
0
 public void StatusUpdate_01(string MHId, string TransactionId, StatusUpdate_01Doc aStatusUpdate_01Doc)
 {
     this.Invoke("StatusUpdate_01", new object[] {
         MHId,
         TransactionId,
         aStatusUpdate_01Doc
     });
     return;
 }
Пример #2
0
        public ArrayList InternalProcess(System.String MapiOutId)
        {
            ArrayList aStatusUpdate_01DocList = new ArrayList();

            IDataReader r = db.ExecuteReader(
                "select" +
                " MAPI_OUT_STAT_UPD_01.ITEMLOADIDENTITY" +
                ",MAPI_OUT_STAT_UPD_01.FIFODATE" +
                ",MAPI_OUT_STAT_UPD_01.HOLDCODE" +
                " from   MAPI_OUT_STAT_UPD_01" +
                " where  MAPI_OUT_STAT_UPD_01.MAPI_OUT_ID = '" + MapiOutId + "'");

            while (r.Read())
            {
                StatusUpdate_01Doc aStatusUpdate_01Doc = new StatusUpdate_01Doc();

                aStatusUpdate_01Doc.OPCODE = "1";

                if (r.IsDBNull(0))
                {
                    aStatusUpdate_01Doc.ItemLoadIdentity = null;
                }
                else
                {
                    aStatusUpdate_01Doc.ItemLoadIdentity = r.GetString(0);
                }

                if (r.IsDBNull(1))
                {
                    aStatusUpdate_01Doc.FifoDate = null;
                }
                else
                {
                    aStatusUpdate_01Doc.FifoDate = DateTime.SpecifyKind(r.GetDateTime(1), DateTimeKind.Local);
                }

                if (r.IsDBNull(2))
                {
                    aStatusUpdate_01Doc.HoldCode = null;
                }
                else
                {
                    aStatusUpdate_01Doc.HoldCode = r.GetString(2);
                }

                aStatusUpdate_01DocList.Add(aStatusUpdate_01Doc);
            }

            r.Close();


            return(aStatusUpdate_01DocList);
        }
Пример #3
0
 public System.IAsyncResult BeginStatusUpdate_01(string MHId, string TransactionId, StatusUpdate_01Doc aStatusUpdate_01Doc, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("StatusUpdate_01", new object[] {
         MHId,
         TransactionId,
         aStatusUpdate_01Doc
     }, callback, asyncState));
 }
Пример #4
0
        private string HandleMessageType(MAPI_OUT transfer)
        {
            string error = "";

            try
            {
                Tracing.TraceEvent(TraceEventType.Verbose, 0, String.Format(" use Url = {0}", transfer.URL));

                if (String.IsNullOrEmpty(transfer.URL))
                {
                    return("unknown url for " + transfer.MHID + " - " + transfer.MSG_ID);
                }

                sender.Url = transfer.URL;

                switch (transfer.MSG_ID)
                {
                case "MOVM_IN_01":
                {
                    MovementIn_01Select handler = new MovementIn_01Select(this.db);
                    MovementIn_01Doc    message = handler.Process(transfer.MAPI_OUT_ID);

                    if (message == null)
                    {
                        error = string.Format("{0} obj missing.", transfer.MSG_ID);
                    }
                    else
                    {
                        sender.MovementIn_01(transfer.MHID, transfer.MAPI_OUT_ID, message);
                    }

                    break;
                }

                case "MOVM_OUT_01":
                {
                    MovementOut_01Select handler = new MovementOut_01Select(this.db);
                    MovementOut_01Doc    message = handler.Process(transfer.MAPI_OUT_ID);

                    if (message == null)
                    {
                        error = string.Format("{0} obj missing.", transfer.MSG_ID);
                    }
                    else
                    {
                        sender.MovementOut_01(transfer.MHID, transfer.MAPI_OUT_ID, message);
                    }

                    break;
                }

                case "PRODUCT_01":
                {
                    Product_01Select handler = new Product_01Select(this.db);
                    Product_01Doc    message = handler.Process(transfer.MAPI_OUT_ID);

                    if (message == null)
                    {
                        error = string.Format("{0} obj missing.", transfer.MSG_ID);
                    }
                    else
                    {
                        sender.Product_01(transfer.MHID, transfer.MAPI_OUT_ID, message);
                    }

                    break;
                }

                case "STAT_UPD_01":
                {
                    StatusUpdate_01Select handler = new StatusUpdate_01Select(this.db);
                    StatusUpdate_01Doc    message = handler.Process(transfer.MAPI_OUT_ID);

                    if (message == null)
                    {
                        error = string.Format("{0} obj missing.", transfer.MSG_ID);
                    }
                    else
                    {
                        sender.StatusUpdate_01(transfer.MHID, transfer.MAPI_OUT_ID, message);
                    }

                    break;
                }

                default:

                    error = string.Format("transfer type {0} not found", transfer.MSG_ID);
                    break;
                }  // switch (transfer.MSG_ID)
            }
            catch (UriFormatException e)
            {
                error = "The format of the URI is invalid. URL: " + transfer.URL + ", MAPI_OUT_ID: " + transfer.MAPI_OUT_ID + Environment.NewLine +
                        e.Message + Environment.NewLine +
                        e.StackTrace;
            }
            catch (InvalidOperationException e)
            {
                error = "Failed to reach " + sender.Url + " for " + transfer.MSG_ID + Environment.NewLine +
                        e.Message + Environment.NewLine +
                        e.StackTrace;
            }
            catch (System.Web.Services.Protocols.SoapException e)
            {
                error = "Interface mismatch. URL: " + sender.Url + ", MSG_ID: " + transfer.MSG_ID + ", MAPI_OUT_ID: " + transfer.MAPI_OUT_ID + Environment.NewLine +
                        e.Message + Environment.NewLine +
                        e.StackTrace;
            }
            catch (Exception e)
            {
                error = "Unexpected error. URL: " + sender.Url + ", MSG_ID: " + transfer.MSG_ID + ", MAPI_OUT_ID: " + transfer.MAPI_OUT_ID + Environment.NewLine +
                        e.Message + Environment.NewLine +
                        e.StackTrace;
            }

            return(error);
        }