예제 #1
0
 public void Product_01(string MHId, string TransactionId, Product_01Doc aProduct_01Doc)
 {
     this.Invoke("Product_01", new object[] {
         MHId,
         TransactionId,
         aProduct_01Doc
     });
     return;
 }
예제 #2
0
        public ArrayList InternalProcess(System.String MapiOutId)
        {
            ArrayList aProduct_01DocList = new ArrayList();

            IDataReader r = db.ExecuteReader(
                "select" +
                " MAPI_OUT_PRODUCT_01.OPERATIONALCODE" +
                ",MAPI_OUT_PRODUCT_01.PRODUCTNUMBER" +
                ",MAPI_OUT_PRODUCT_01.BARCODE" +
                ",MAPI_OUT_PRODUCT_01.PRODUCTDESCRIPTION1" +
                ",MAPI_OUT_PRODUCT_01.HANDLINGUNITIDENTITY" +
                ",MAPI_OUT_PRODUCT_01.BESTBEFORDATEFLAG" +
                ",MAPI_OUT_PRODUCT_01.NUMBEROFBASEPACKAGES" +
                ",MAPI_OUT_PRODUCT_01.BATCHTYPE" +
                " from   MAPI_OUT_PRODUCT_01" +
                " where  MAPI_OUT_PRODUCT_01.MAPI_OUT_ID = '" + MapiOutId + "'");

            while (r.Read())
            {
                Product_01Doc aProduct_01Doc = new Product_01Doc();

                aProduct_01Doc.OPCODE = "1";

                if (r.IsDBNull(0))
                {
                    aProduct_01Doc.OperationalCode = null;
                }
                else
                {
                    aProduct_01Doc.OperationalCode = r.GetString(0);
                }

                if (r.IsDBNull(1))
                {
                    aProduct_01Doc.ProductNumber = null;
                }
                else
                {
                    aProduct_01Doc.ProductNumber = r.GetString(1);
                }

                if (r.IsDBNull(2))
                {
                    aProduct_01Doc.BarCode = null;
                }
                else
                {
                    aProduct_01Doc.BarCode = r.GetString(2);
                }

                if (r.IsDBNull(3))
                {
                    aProduct_01Doc.ProductDescription1 = null;
                }
                else
                {
                    aProduct_01Doc.ProductDescription1 = r.GetString(3);
                }

                if (r.IsDBNull(4))
                {
                    aProduct_01Doc.HandlingUnitIdentity = null;
                }
                else
                {
                    aProduct_01Doc.HandlingUnitIdentity = r.GetString(4);
                }

                if (r.IsDBNull(5))
                {
                    aProduct_01Doc.BestBeforDateFlag = null;
                }
                else
                {
                    aProduct_01Doc.BestBeforDateFlag = r.GetString(5);
                }

                if (r.IsDBNull(6))
                {
                    aProduct_01Doc.NumberOfBasePackageS = null;
                }
                else
                {
                    aProduct_01Doc.NumberOfBasePackageS = Convert.ToDouble(r.GetDecimal(6));
                }

                if (r.IsDBNull(7))
                {
                    aProduct_01Doc.BatchType = null;
                }
                else
                {
                    aProduct_01Doc.BatchType = r.GetString(7);
                }

                aProduct_01DocList.Add(aProduct_01Doc);
            }

            r.Close();


            return(aProduct_01DocList);
        }
예제 #3
0
 public System.IAsyncResult BeginProduct_01(string MHId, string TransactionId, Product_01Doc aProduct_01Doc, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("Product_01", new object[] {
         MHId,
         TransactionId,
         aProduct_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);
        }