Пример #1
0
        public void Validation(SalesAreaGroup salesAreaGroup, List <Multipart> multiparts,
                               List <CampaignTarget> campaignTargets, DateTime campaignStartDateTime, DateTime campaignEndDateTime)
        {
            IValidation validation = new RequiredFieldValidation()
            {
                Field = new List <ValidationInfo>()
                {
                    new ValidationInfo()
                    {
                        FieldName = "SalesArea Group", FieldToValidate = salesAreaGroup
                    },
                    new ValidationInfo()
                    {
                        FieldName = "Multiparts", FieldToValidate = multiparts
                    },
                    new ValidationInfo()
                    {
                        FieldName = "Campaign Targets", FieldToValidate = campaignTargets
                    }
                }
            };

            validation.Execute();
            salesAreaGroup.Validation(salesAreaGroup.GroupName, salesAreaGroup.SalesAreas);
            if (multiparts != null && multiparts.Any())
            {
                multiparts.ForEach(l => l.Validation(l.Lengths));
            }

            if (campaignTargets != null && campaignTargets.Any())
            {
                campaignTargets.ForEach(c => c.Validation(c.StrikeWeights, campaignStartDateTime, campaignEndDateTime));
            }
        }
Пример #2
0
        public object Clone()
        {
            SalesAreaGroup salesAreaGroup = (SalesAreaGroup)MemberwiseClone();

            salesAreaGroup.GroupName = GroupName;

            if (SalesAreas != null)
            {
                salesAreaGroup.SalesAreas = new List <string>();
                SalesAreas.ForEach(sa => salesAreaGroup.SalesAreas.Add((string)sa.Clone()));
            }

            return(salesAreaGroup);
        }
Пример #3
0
        public object Clone()
        {
            SalesAreaCampaignTarget salesAreaCampaignTarget = (SalesAreaCampaignTarget)MemberwiseClone();

            if (SalesAreaGroup != null)
            {
                salesAreaCampaignTarget.SalesAreaGroup = new SalesAreaGroup();
                salesAreaCampaignTarget.SalesAreaGroup = (SalesAreaGroup)SalesAreaGroup.Clone();
            }
            if (Multiparts != null)
            {
                salesAreaCampaignTarget.Multiparts = new List <Multipart>();
                Multiparts.ForEach(mp => salesAreaCampaignTarget.Multiparts.Add((Multipart)mp.Clone()));
            }
            if (CampaignTargets != null)
            {
                salesAreaCampaignTarget.CampaignTargets = new List <CampaignTarget>();
                CampaignTargets.ForEach(ct => salesAreaCampaignTarget.CampaignTargets.Add((CampaignTarget)ct.Clone()));
            }

            return(salesAreaCampaignTarget);
        }