public override bool IsApplicable(DataRow destination, DataTable assortment)
        {
            var status = ProducerSynonymResolver.GetStatus(destination);

            if ((status & FormMask.NameForm) != FormMask.NameForm)
            {
                return(false);
            }

            if ((status & FormMask.FirmForm) == FormMask.FirmForm)
            {
                return(false);
            }

            if (destination["UEPriorProductId"] is DBNull)
            {
                return(false);
            }

            if (!Name.Equals(destination["UEFirmCr"].ToString(), StringComparison.CurrentCultureIgnoreCase))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
 public Updater(uint priceId, uint childPriceId, uint priceItemId, PriceProcessorWcfHelper remotePriceProcessor, ProducerSynonymResolver _resolver)
 {
     this.priceId          = priceId;
     this.childPriceId     = childPriceId;
     this.priceItemId      = priceItemId;
     _remotePriceProcessor = remotePriceProcessor;
     resolver = _resolver;
 }
Beispiel #3
0
        public virtual bool IsApplicable(DataRow destination, DataTable assortment)
        {
            var status = ProducerSynonymResolver.GetStatus(destination);

            if ((status & FormMask.NameForm) != FormMask.NameForm)
            {
                return(false);
            }

            if ((status & FormMask.FirmForm) == FormMask.FirmForm)
            {
                return(false);
            }

            if (destination["UEPriorProductId"] is DBNull)
            {
                return(false);
            }

            if (!Name.Equals(destination["UEFirmCr"].ToString(), StringComparison.CurrentCultureIgnoreCase))
            {
                return(false);
            }

            var catalogId = Convert.ToUInt32(destination["UEPriorCatalogId"]);

            if (this is Exclude)
            {
                return(((Exclude)this).CatalogId == catalogId);
            }

            //если это фармацевтика то не нужно делать проверки по ассортименту
            if (!Convert.ToBoolean(destination["pharmacie"]))
            {
                return(true);
            }

            if (assortment == null)
            {
                return(false);
            }

            return(assortment.Rows.Cast <DataRow>().Any(r => Convert.ToUInt32(r["CatalogId"]) == catalogId &&
                                                        Convert.ToUInt32(r["ProducerId"]) == ProducerId));
        }
Beispiel #4
0
        public virtual void Apply(DataRow row)
        {
            if (row["UEProducerSynonymId"] is DBNull)
            {
                row["UEProducerSynonymId"] = Id;
            }

            row["UEStatus"] = (int)(ProducerSynonymResolver.GetStatus(row) | FormMask.FirmForm);
            if (ProducerId == 0)
            {
                row["UEPriorProducerId"] = DBNull.Value;
            }
            else
            {
                row["UEPriorProducerId"] = ProducerId;
            }
            row["SynonymObject"] = this;
        }