Beispiel #1
0
 /// <remarks/>
 public void receiveAsync(stockDTO[] dtos, object userState) {
     if ((this.receiveOperationCompleted == null)) {
         this.receiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreceiveOperationCompleted);
     }
     this.InvokeAsync("receive", new object[] {
                 dtos}, this.receiveOperationCompleted, userState);
 }
Beispiel #2
0
        // 库存同步接口(同步)
        /// <summary>
        /// 库存同步接口(同步)
        /// </summary>
        /// <param name="service"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static stockDTO[] Do(this PI07ImplService service, stockDTO[] param)
        {
            service.Url = PubHelper.GetAddress(service.Url);

            string entityName = "库存同步接口";
            long svID = -1;
            if (IsLog)
            {
                svID = ProxyLogger.CreateTransferSV(entityName
                    //, EntitySerialization.EntitySerial(bpObj)
                    , Newtonsoft.Json.JsonConvert.SerializeObject(param)
                    , service.GetType().FullName,Newtonsoft.Json.JsonConvert.SerializeObject(service));
            }

            try
            {
                var result = service.receive(param);

                //service.receiveCompleted += new DMS_PI07.receiveCompletedEventHandler(service_receiveCompleted);
                //service.receiveAsync(param, svID);

                if (svID > 0)
                {
                    if (result != null
                        && result.Length > 0
                        )
                    {
                        //string resultXml = EntitySerialization.EntitySerial(result);
                        string resultXml = Newtonsoft.Json.JsonConvert.SerializeObject(result);

                        bool flag = result[0] != null ? result[0].flag == 1 : false;
                        string msg = result[0] != null ? result[0].errMsg : string.Empty;
                        ProxyLogger.UpdateTransferSV(svID, resultXml, flag, msg, string.Empty, string.Empty);
                    }
                    else
                    {
                        ProxyLogger.UpdateTransferSV(svID, string.Empty, false, Const_ResultNullMessage, string.Empty, string.Empty);
                    }
                }

            }
            catch (Exception ex)
            {
                if (svID > 0)
                {
                    ProxyLogger.UpdateTransferSV(svID, string.Empty, false, ex.Message, string.Empty, ex.StackTrace);
                }

                throw ex;
            }

            return null;
        }
Beispiel #3
0
 /// <remarks/>
 public void receiveAsync(stockDTO[] dtos) {
     this.receiveAsync(dtos, null);
 }