Exemple #1
0
        public AdvisorDetail Create(string email, int advisorId, string name, string description)
        {
            var advisor = AdvisorBusiness.GetWithOwner(advisorId, email);

            if (advisor == null)
            {
                throw new ArgumentException("Invalid advisor.");
            }

            var advisorDetail = SetNew(advisor.Id, name, description, true);

            Data.Insert(advisorDetail);
            return(advisorDetail);
        }
Exemple #2
0
        public AdvisorDetail Disable(string email, int advisorId)
        {
            var advisor = AdvisorBusiness.GetWithOwner(advisorId, email);

            if (advisor == null)
            {
                throw new ArgumentException("Invalid advisor.");
            }

            var oldDetail     = GetByAdvisor(advisor.Id);
            var advisorDetail = SetNew(advisor.Id, oldDetail.Name, oldDetail.Description, false);

            Data.Insert(advisorDetail);
            return(advisorDetail);
        }