コード例 #1
0
        private void UpdateDMS_SalePriceAdjustment(StoreQty2DMSSV bpObj)
        {
            string opath = "1=1 and SalePriceAdjustment.PriceList.Code = @Code and SalePriceAdjustment.Org=@Org  @AddSuptOpath ";

            if (bpObj.SupItems != null &&
                bpObj.SupItems.Count > 0
                )
            {
                string ids = bpObj.SupItems.GetOpathFromList();

                opath = opath.Replace("@AddSuptOpath"
                                      , string.Format(" and ID in ({0})", ids)
                                      );
            }
            else
            {
                // 不选,就不同步
                opath = opath.Replace("@AddSuptOpath"
                                      , " and 1=0 "
                                      );
            }

            string priceListCode = HBHCommon.GetPartPriceListCode();

            if (priceListCode.IsNotNullOrWhiteSpace())
            {
                SalePriceAdjustLine.EntityList lst = SalePriceAdjustLine.Finder.FindAll(opath
                                                                                        , new OqlParam(priceListCode)
                                                                                        , new OqlParam(Context.LoginOrg.ID)
                                                                                        );

                if (lst != null &&
                    lst.Count > 0
                    )
                {
                    List <List <SalePriceAdjustLine> > pageList = PageList <SalePriceAdjustLine>(lst);

                    if (pageList != null &&
                        pageList.Count > 0
                        )
                    {
                        foreach (List <SalePriceAdjustLine> page in pageList)
                        {
                            //PubExtend.BatchSend2DMS_Async(lst, 2);
                            PubExtend.BatchSend2DMS_Async(page, 2);
                        }
                    }
                }
            }
        }
コード例 #2
0
        private void UpdateDMS_Customer(StoreQty2DMSSV bpObj)
        {
            string opath = "1=1 @AddSuptOpath ";

            if (bpObj.SupItems != null &&
                bpObj.SupItems.Count > 0
                )
            {
                string ids = bpObj.SupItems.GetOpathFromList();

                opath = opath.Replace("@AddSuptOpath"
                                      , string.Format(" and ID in ({0})", ids)
                                      );
            }
            else
            {
                opath = opath.Replace("@AddSuptOpath"
                                      , string.Empty
                                      );
            }

            Customer.EntityList lst = Customer.Finder.FindAll(opath, new OqlParam(Context.LoginOrg.ID));

            if (lst != null &&
                lst.Count > 0
                )
            {
                List <List <Customer> > pageList = PageList <Customer>(lst);

                if (pageList != null &&
                    pageList.Count > 0
                    )
                {
                    foreach (List <Customer> page in pageList)
                    {
                        //PubExtend.BatchSend2DMS_Async(lst, 2);
                        PubExtend.BatchSend2DMS_Async(page, 2);
                    }
                }
            }
        }