Exemplo n.º 1
0
        private void FixupProducer(Contractor previousValue)
        {
            if (previousValue != null && previousValue.MaterialFromProducer.Contains(this))
            {
                previousValue.MaterialFromProducer.Remove(this);
            }

            if (Producer != null)
            {
                if (!Producer.MaterialFromProducer.Contains(this))
                {
                    Producer.MaterialFromProducer.Add(this);
                }
                if (Producer_Id != Producer.Id)
                {
                    Producer_Id = Producer.Id;
                }
            }
            else if (!_settingFK)
            {
                Producer_Id = null;
            }
        }
Exemplo n.º 2
0
        public static Contractor GetEntity(this ContractorPrimitive primitive)
        {
            Contractor result = new Contractor();

                result.Id = primitive.Id;

                result.InternalName = primitive.InternalName;

                result.Name = primitive.Name;

                result.ZIPCode = primitive.ZIPCode;

                result.City = primitive.City;

                result.Street = primitive.Street;

                result.HouseNo = primitive.HouseNo;

                result.Deleted = primitive.Deleted;

                result.Phone = primitive.Phone;

                result.Deactivated = primitive.Deactivated;

                return result;
        }
Exemplo n.º 3
0
        private void FixupDeliverer(Contractor previousValue)
        {
            if (previousValue != null && previousValue.MaterialFromDeliverer.Contains(this))
            {
                previousValue.MaterialFromDeliverer.Remove(this);
            }

            if (Deliverer != null)
            {
                if (!Deliverer.MaterialFromDeliverer.Contains(this))
                {
                    Deliverer.MaterialFromDeliverer.Add(this);
                }
                if (Deliverer_Id != Deliverer.Id)
                {
                    Deliverer_Id = Deliverer.Id;
                }
            }
            else if (!_settingFK)
            {
                Deliverer_Id = null;
            }
        }