public GetDefaultAmenitiesCommand(CommunityType communityType)
 {
     base.StoredProcedureName = CommonStoredProcedures.SpGetCommunityAmenityType;
     this.ParameterName       = "@CommunityClassId";
     this.SpParameter         = new int?(communityType);
     base.CacheKey            = CachedBaseCommand <List <Amenity> > .GetCacheKey(new string[] { base.StoredProcedureName, "admin", this.ParameterName, this.SpParameter.ToString() });
 }
Exemplo n.º 2
0
        public List <Amenity> GetDefaultAmenities(CommunityType communityType)
        {
            GetDefaultAmenitiesCommand getDefaultAmenitiesCommand = new GetDefaultAmenitiesCommand(communityType);

            getDefaultAmenitiesCommand.Execute();
            return(getDefaultAmenitiesCommand.CommandResult);
        }
        private void CreateCommunityMember(UserType userType, MemberType memberType, CommunityType communityType)
        {
            var member = new CommunityMember();

            member.Id             = Guid.NewGuid();
            member.Role           = CommunityMember.MembershipRole.Member;
            member.CommunityGroup = CommunityGroups[communityType];
            member.User           = Users[userType];

            PooledBook pooledBook;

            foreach (var ownedBook in Users[userType].OwnedBooks)
            {
                pooledBook = new PooledBook
                {
                    Id              = Guid.NewGuid(),
                    OwnedBook       = ownedBook,
                    CommunityMember = member
                };
                member.PooledBooks.Add(pooledBook);
                PooledBooks.Add(pooledBook);
            }
            CommunityMembers.Add(memberType, member);
            Users[userType].Memberships.Add(member);
            CommunityGroups[communityType].CommunityMembers.Add(member);
        }
Exemplo n.º 4
0
        public List <KeyValuePair <int, string> > GetEmailTypes(CommunityType communityType)
        {
            GetEmailTypesCommand getEmailTypesCommand = new GetEmailTypesCommand(communityType);

            getEmailTypesCommand.Execute();
            return(getEmailTypesCommand.CommandResult);
        }
 public static ContactVm GetContactVm(CommunityType communityType)
 {
     return(new ContactVm()
     {
         ContactTypes = MSLivingChoices.Bcs.Admin.Components.ItemTypeBc.Instance.GetContactTypes(communityType).ToSelectListItemList()
     });
 }
Exemplo n.º 6
0
        WhenICallTheAddCommunityTypePostApiEndpointToAddACommunityTypeItChecksIfExistsPullsItemEditsItAndDeletesIt()
        {
            HttpResponseMessage response;

            _addItem = Add(_addItem, out response);

            Assert.IsNotNull(response);
            ScenarioContext.Current[AddItemKey] = response;
        }
        public static Task <string> GetOnAirProgramsDataAsync(
            NiconicoVitaContext context, CommunityType type, Range range)
        {
            range.CheckMaximumLength(149, "range");

            var sb = new StringBuilder(NiconicoUrls.LiveVideoComingSoonListUrl);

            sb.Append('&');
            sb.Append(range.ToFromLimitString());
            sb.Append("&pt=");
            sb.Append(type.ToCommunityTypeString());
            return(context.GetClient().GetStringWithoutHttpRequestExceptionAsync(sb.ToString()));
        }
        public static string ToCommunityTypeString(this CommunityType value)
        {
            switch (value)
            {
            case CommunityType.Official:
                return("official");

            case CommunityType.Community:
                return("community");

            case CommunityType.Channel:
                return("channel");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 9
0
        public void ThenTheAddResultShouldBeACommunityTypeIdCheckExistsGetByIdEditAndDeleteWithHttpResponseReturns()
        {
            //did we get a good result
            Assert.IsTrue(_addItem != null && _addItem.Id > 0);

            //set the returned AddID to current Get
            _addedIdValue  = _addItem.Id;
            _getIdValue    = _addedIdValue;
            _existsIdValue = _getIdValue;

            //check that the item exists
            var itemReturned = Exists(_existsIdValue);

            Assert.IsTrue(itemReturned);

            //use the value used in exists check
            _getIdValue = _addItem.Id;
            Assert.IsTrue(_getIdValue == _addedIdValue);

            //pull the item by Id
            var resultGet = GetById <CommunityType>(_getIdValue);

            Assert.IsNotNull(resultGet);
            _getIdValue = resultGet.Id;
            Assert.IsTrue(_getIdValue == _addedIdValue);

            //Now, let's Edit the newly added item
            _editIdValue = _getIdValue;
            _editItem    = resultGet;
            Assert.IsTrue(_editIdValue == _addedIdValue);

            //do an update
            var updateResponse = Update(_editIdValue, _editItem);

            Assert.IsNotNull(updateResponse);

            //pass the item just updated
            _deletedIdValue = _editIdValue;
            Assert.IsTrue(_deletedIdValue == _addedIdValue);

            //delete this same item
            var deleteResponse = Delete(_deletedIdValue);

            Assert.IsNotNull(deleteResponse);
        }
Exemplo n.º 10
0
        public void GivenTheFollowingCommunityTypeAddInput(Table table)
        {
            Assert.IsNotNull(table);
            foreach (var row in table.Rows)
            {
                _code  = row["Code"];
                _label = row["Label"];

                break;
            }
            Assert.IsNotNull(_code);
            Assert.IsNotNull(_label);

            _addItem = new CommunityType
            {
                Code      = _code,
                Label     = _label,
                CreatedOn = DateTime.UtcNow
            };
        }
Exemplo n.º 11
0
        public static PhoneListVm Repopulate(this PhoneListVm model, CommunityType type)
        {
            if (model == null)
            {
                return(AdminViewModelsProvider.GetPhoneList(type));
            }
            if (model.AdditionalPhones == null || !model.AdditionalPhones.Any <PhoneVm>())
            {
                model.AdditionalPhones = new List <PhoneVm>()
                {
                    new PhoneVm()
                };
            }
            List <SelectListItem> phoneTypes = MSLivingChoices.Bcs.Admin.Components.ItemTypeBc.Instance.GetPhoneTypes(type).ToSelectListItemList();

            foreach (PhoneVm additionalPhone in model.AdditionalPhones)
            {
                additionalPhone.PhoneTypes = phoneTypes;
            }
            return(model);
        }
Exemplo n.º 12
0
        public static EmailListVm Repopulate(this EmailListVm model, CommunityType type)
        {
            if (model == null)
            {
                return(AdminViewModelsProvider.GetEmailListVm(type));
            }
            if (model.AdditionalEmails == null || !model.AdditionalEmails.Any <EmailVm>())
            {
                model.AdditionalEmails = new List <EmailVm>()
                {
                    new EmailVm()
                };
            }
            List <SelectListItem> emailTypes = MSLivingChoices.Bcs.Admin.Components.ItemTypeBc.Instance.GetEmailTypes(type).ToSelectListItemList();

            foreach (EmailVm additionalEmail in model.AdditionalEmails)
            {
                additionalEmail.EmailTypes = emailTypes;
            }
            return(model);
        }
Exemplo n.º 13
0
 internal static EmailListVm MapToEmailListVm(this List <Email> emails, CommunityType communityType)
 {
     return(emails.MapToEmailListVm(ItemTypeBc.Instance.GetEmailTypes(communityType)));
 }
Exemplo n.º 14
0
 public List <KeyValuePair <int, string> > GetEmailTypes(CommunityType communityType)
 {
     return(this._itemTypeDac.GetEmailTypes(communityType));
 }
Exemplo n.º 15
0
 private void modularityCoefficientToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.ovCluster;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
Exemplo n.º 16
0
 private void newOverlappingDensityMatrixToolStripMenuItem_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.ovDensity;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
Exemplo n.º 17
0
 private void overlappingCommunityAffiliationMatrixToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.ovAffil;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
Exemplo n.º 18
0
 private void newOverlappingCommunityCharacteristicsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _comForm.ShowDialog();
     if (_comForm.SVC.Count + _comForm.DVC.Count /*+ _comForm.attrMatrix.Count*/ >= 0)
     {
         communityType = CommunityType.ovChar;
         SetNewDisplayMatrix("Community");
         LoadData();
         SetChecked();
     }
 }
Exemplo n.º 19
0
        public static List <ContactVm> Repopulate(this IEnumerable <ContactVm> contacts, CommunityType type)
        {
            List <ContactVm> result;

            if (contacts == null || !contacts.Any <ContactVm>())
            {
                result = new List <ContactVm>()
                {
                    AdminViewModelsProvider.GetContactVm(type)
                };
            }
            else
            {
                result = contacts.ToList <ContactVm>();
                List <SelectListItem> contactTypes = MSLivingChoices.Bcs.Admin.Components.ItemTypeBc.Instance.GetContactTypes(type).ToSelectListItemList();
                foreach (ContactVm contactVm in result)
                {
                    contactVm.ContactTypes = contactTypes;
                }
            }
            return(result);
        }
Exemplo n.º 20
0
 private void relativeDensityToolStripMenuItem6_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.ovRelativeDensity;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
 public static EmailListVm GetEmailListVm(CommunityType communityType)
 {
     return(((List <Entities.Admin.Email>)null).MapToEmailListVm(communityType));
 }
Exemplo n.º 22
0
 public void SaveDefaultCommunityAmenities(CommunityType communityType, List <Amenity> amenities)
 {
     this._itemTypeDac.SaveDefaultCommunityAmenities(communityType, amenities);
 }
 public static PhoneListVm GetPhoneList(CommunityType communityType)
 {
     return(((List <Entities.Admin.Phone>)null).MapToPhoneListVm(communityType));
 }
Exemplo n.º 24
0
 public SaveDefaultAmenities(CommunityType communityType, List <Amenity> amenities) : this(amenities, new CommunityType?(communityType), null)
 {
 }
 public static PhoneListVm GetPhoneList(CommunityType communityType)
 {
     return(null.MapToPhoneListVm(communityType));
 }
Exemplo n.º 26
0
 private void communityCohesionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.Cohesion;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
Exemplo n.º 27
0
 public void SaveDefaultCommunityAmenities(CommunityType communityType, List <Amenity> amenities)
 {
     (new SaveDefaultAmenities(communityType, amenities)).Execute();
 }
 public static EmailListVm GetEmailListVm(CommunityType communityType)
 {
     return(null.MapToEmailListVm(communityType));
 }
Exemplo n.º 29
0
 private void separationCoefficientToolStripMenuItem_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.Separation;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
Exemplo n.º 30
0
 public List <Amenity> GetDefaultAmenities(CommunityType communityType)
 {
     return(this._amenityDac.GetDefaultAmenities(communityType));
 }
Exemplo n.º 31
0
 private void communityCoefficientsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     communityType = CommunityType.newCoefficients;
     SetNewDisplayMatrix("Community");
     LoadData();
     SetChecked();
 }
Exemplo n.º 32
0
 internal static PhoneListVm MapToPhoneListVm(this List <Phone> phones, CommunityType communityType)
 {
     return(phones.MapToPhoneListVm(ItemTypeBc.Instance.GetPhoneTypes(communityType)));
 }
 public static Task <ProgramsResponse> GetOnAirProgramsAsync(
     NiconicoVitaContext context, CommunityType type, Range range)
 {
     return(GetOnAirProgramsDataAsync(context, type, range)
            .ContinueWith(prevTask => ParseOnAirProgramsData(prevTask.Result)));
 }