public JsonNetResult UpdateWebsitePhoneNumbers(CustomerSite customersite) { var testa = Exigo.GetCustomerSite(Identity.Current.CustomerID); Exigo.UpdateCustomerSite(new CustomerSite { CustomerID = Identity.Current.CustomerID, PrimaryPhone = customersite.PrimaryPhone, SecondaryPhone = customersite.SecondaryPhone }); var testb = Exigo.GetCustomerSite(Identity.Current.CustomerID); var html = string.Format(@" " + Resources.Common.Primary + @": <strong>{0}</strong><br /> " + Resources.Common.Secondary + @": <strong>{1}</strong> ", customersite.PrimaryPhone, customersite.SecondaryPhone); return(new JsonNetResult(new { success = true, action = "UpdateWebsitePhoneNumbers", html = html })); }
public ActionResult EnrollmentRedirect() { var url = GlobalSettings.ReplicatedSites.EnrollmentUrl; var customerSite = Exigo.GetCustomerSite(Identity.Current.CustomerID); if (customerSite != null) { url = GlobalSettings.ReplicatedSites.GetEnrollmentUrl(customerSite.WebAlias); } return(Redirect(url)); }
public ActionResult CustomEnrollmentRedirect(int enroller, int sponsor) { var webAlias = GlobalSettings.ReplicatedSites.DefaultWebAlias; var customerSite = Exigo.GetCustomerSite(enroller); if (!GlobalSettings.Globalization.HideForLive) { if (customerSite != null && customerSite.WebAlias.IsNotNullOrEmpty()) { webAlias = customerSite.WebAlias; } var url = GlobalSettings.ReplicatedSites.FormattedBaseUrl.FormatWith(webAlias) + "/backofficeenrollmentlanding?ownerID=" + Identity.Current.CustomerID + "&enroller=" + enroller + "&sponsor=" + sponsor; return(Redirect(url)); } else { var url = GlobalSettings.Company.BaseReplicatedeUrl + "/backofficeenrollmentlanding?ownerID=" + Identity.Current.CustomerID + "&enroller=" + enroller + "&sponsor=" + sponsor; return(Redirect(url)); } }
private static BookingReward CreateBookingReward(int customerId, int partyId, int bookingsRewardOwnerId) { var bookingReward = new BookingReward(); if (partyId == 0) { return(bookingReward); } //Get Party Details of Party that we earned booking rewards from. var party = Exigo.GetCustomer(partyId); var customerSite = Exigo.GetCustomerSite(partyId); //Get Point Account Value Earned for Booking Rewards - CustomerPointAccounts - PointAccountID 3 var bookingsRewardsCash = Exigo.GetCustomerPointAccount(partyId, PointAccounts.BookingsRewardsCash); bookingReward.PartyName = party.FirstName; bookingReward.WebAlias = customerSite.WebAlias; bookingReward.BookingRewardOwner = bookingsRewardOwnerId; bookingReward.CustomerID = party.CustomerID; //This will be the Field 3, Field 4, Field 5, Field 6 from the ExtendedDetails bookingReward.Balance = (bookingsRewardsCash != null) ? bookingsRewardsCash.Balance : 0; bookingReward.PointAccountID = PointAccounts.BookingsRewardsCash; return(bookingReward); }
public ActionResult Index() { var model = new AccountOverviewViewModel(); var customer = Exigo.GetCustomer(Identity.Current.CustomerID); model.Enroller = customer.Enroller; model.Sponsor = customer.Sponsor; var website = Exigo.GetCustomerSite(Identity.Current.CustomerID); var socialNetworksResponse = Exigo.WebService().GetCustomerSocialNetworks(new GetCustomerSocialNetworksRequest() { CustomerID = Identity.Current.CustomerID }); // Social NetWorks foreach (var network in socialNetworksResponse.CustomerSocialNetwork) { switch (network.SocialNetworkID) { case (int)SocialNetworks.Facebook: model.FacebookUrl = network.Url; break; case (int)SocialNetworks.Twitter: model.TwitterUrl = network.Url; break; case (int)SocialNetworks.YouTube: model.YouTubeUrl = network.Url; break; case (int)SocialNetworks.Blog: model.BlogUrl = network.Url; break; } } //Basic Info model.CustomerID = customer.CustomerID; model.FirstName = customer.FirstName; model.LastName = customer.LastName; model.Email = customer.Email; model.WebAlias = website.WebAlias; model.LoginName = customer.LoginName; model.LanguageID = customer.LanguageID; model.CreatedDate = customer.CreatedDate; // Team Placement var currentPeriod = Exigo.GetCurrentPeriod(PeriodTypes.Default); var placementOptions = new List <SelectListItem>(); var volumes = Exigo.GetCustomerVolumes(new GetCustomerVolumesRequest() { CustomerID = Identity.Current.CustomerID, PeriodID = currentPeriod.PeriodID, PeriodTypeID = PeriodTypes.Default }); var canSeeTeamOne = (volumes.Volume50 > 0); var canSeeTeamTwo = (volumes.Volume51 > 0); var canSeeTeamThree = (volumes.Volume52 > 0); var canSeeTeamFour = (volumes.Volume53 > 0); var canSeeTeamFive = (volumes.Volume54 > 0); model.TeamPlacementPreferenceID = customer.Field1; // Only show available teams. If none available, default to team one if (canSeeTeamOne || (canSeeTeamOne == false && canSeeTeamTwo == false && canSeeTeamThree == false && canSeeTeamFour == false && canSeeTeamFive == false)) { placementOptions.Add(new SelectListItem { Text = Resources.Common.Team + " 1", Value = "1" }); } if (canSeeTeamTwo) { placementOptions.Add(new SelectListItem { Text = Resources.Common.Team + " 2", Value = "2" }); } if (canSeeTeamThree) { placementOptions.Add(new SelectListItem { Text = Resources.Common.Team + " 3", Value = "3" }); } if (canSeeTeamFour) { placementOptions.Add(new SelectListItem { Text = Resources.Common.Team + " 4", Value = "4" }); } if (canSeeTeamFive) { placementOptions.Add(new SelectListItem { Text = Resources.Common.Team + " 5", Value = "5" }); } model.TeamPlacementPreferenceOptions = placementOptions; // Set the description for the user's team to be displayed if (model.TeamPlacementPreferenceID != "") { model.TeamPlacementPreference = Resources.Common.Team + " " + model.TeamPlacementPreferenceID; } // If somehow the customer does not have a value in thier Field1, default the description to the first available option else { var firstAvailableTeamNumber = placementOptions.OrderBy(c => c.Value).FirstOrDefault().Value; model.TeamPlacementPreference = Resources.Common.Team + " " + firstAvailableTeamNumber; } // Tax ID - Added try catch around this because it fails from time to time and kills the entire page - Mike M. try { var request = new Common.Api.ExigoWebService.GetCustomReportRequest(); request.ReportID = 3; request.Parameters = new List <ParameterRequest> { new ParameterRequest { ParameterName = "CustomerID", Value = Identity.Current.CustomerID } }.ToArray(); var taxIDResponse = Exigo.WebService().GetCustomReport(request); var taxId = taxIDResponse.ReportData.Tables[0].Rows[0][0].ToString(); model.TaxIDIsSet = (taxId != ""); model.MaskedTaxID = taxId; } catch (Exception ex) { } // Contact model.PrimaryPhone = customer.PrimaryPhone; model.SecondaryPhone = customer.SecondaryPhone; model.MobilePhone = customer.MobilePhone; model.Fax = customer.Fax; model.Addresses = customer.Addresses; // Customer Site model.CustomerSite.FirstName = website.FirstName; model.CustomerSite.LastName = website.LastName; model.CustomerSite.Email = website.Email; model.CustomerSite.PrimaryPhone = website.PrimaryPhone; model.CustomerSite.SecondaryPhone = website.SecondaryPhone; model.CustomerSite.Fax = website.Fax; model.CustomerSite.Notes1 = website.Notes1; model.CustomerSite.Notes2 = website.Notes2; model.CustomerSite.Notes3 = website.Notes3; model.CustomerSite.Notes4 = website.Notes4; model.CustomerSite.Address.Address1 = website.Address.Address1; model.CustomerSite.Address.Address2 = website.Address.Address2; model.CustomerSite.Address.Country = website.Address.Country; model.CustomerSite.Address.City = website.Address.City; model.CustomerSite.Address.State = website.Address.State; model.CustomerSite.Address.Zip = website.Address.Zip; // Opt in model.IsOptedIn = customer.IsOptedIn; // Annual Membership model.Membership = Exigo.GetCustomerAutoOrders(new GetCustomerAutoOrdersRequest { CustomerID = Identity.Current.CustomerID, IncludeDetails = true, IncludePaymentMethods = true, IncludeInactiveAutoOrders = true }).Where(v => v.Details.Any(d => d.ItemCode == "IAANNUALRENEWAL")).FirstOrDefault(); model.ActiveMembership = model.Membership != null ? "Scheduled" + @model.Membership.NextRunDate : "No Renewal Scheduled"; // Get the available languages model.Languages = Exigo.GetLanguages(); return(View(model)); }
public Event GetEventDetails(int eventId) { Customer eventCustomer = Exigo.GetCustomerByIDandType(eventId, CustomerTypes.Party); //using (var context = Exigo.Sql()) //{ // var sql = string.Format("exec GetCustomerByIDandType {0}, {1}", eventId, CustomerTypes.Party); // eventCustomer = context.Query<Customer>(sql).FirstOrDefault(); //} //if (null == eventCustomer) //{ // throw new ApplicationException("The provided event ID does not exist."); //} var eventCustomerSiteResponse = Exigo.GetCustomerSite(eventId); var eventCustomerEx = Exigo.GetCustomerExtendedDetails(eventId, (int)CustomerExtendedGroup.PartyDetails).FirstOrDefault(); var creator = new Customer(); int creatorCustomerId = 0; if (int.TryParse(eventCustomerEx.Field5, out creatorCustomerId)) { creator = Exigo.GetCustomerByIDandType(creatorCustomerId, CustomerTypes.IndependentStyleAmbassador); creator.WebAlias = Exigo.GetCustomerWebAlias(creator.CustomerID); } var host = new Customer(); int hostCustomerId = 0; if (int.TryParse(eventCustomerEx.Field6, out hostCustomerId)) { host = Exigo.GetCustomer(hostCustomerId); } // Retrieve the party sales total var salesTotal = GetPointAccountBalance(eventId, PointAccounts.PartySalesTotal); // Retieve the Host' rewards point accounts var pointAccounts = GetHostRewardPointAccounts(eventId); //var bookingRewards = GetBookingRewards(); //int bookingRewardsOwnerId = 0; //int.TryParse(eventCustomerEx.Field7, out bookingRewardsOwnerId); // Create Missing Host Specials //CreateMissngHostSpecials(eventCustomerEx); var @event = new Event() { Id = eventCustomer.CustomerID, Name = eventCustomer.FirstName, Location = eventCustomer.MainAddress, Creator = creator, Host = host, TotalSales = salesTotal, EventPointAccounts = null != pointAccounts?pointAccounts.ToArray() : null, //EventBookingRewards = bookingRewards, //BookingRewardsOwnerId = bookingRewardsOwnerId, WebAlias = eventCustomerSiteResponse.WebAlias, StartDate = Convert.ToDateTime(eventCustomerEx.Field1), ActualDate = Convert.ToDateTime(eventCustomerEx.Field2), EventStatus = eventCustomer.CustomerStatusID == 0 ? "Close" : Convert.ToDateTime(eventCustomerEx.Field4) < DateTime.Now ? "Close" : "Open", CloseDate = Convert.ToDateTime(eventCustomerEx.Field3), LockoutDate = Convert.ToDateTime(eventCustomerEx.Field4), DeletedEvents = eventCustomer.CustomerStatusID == 0?true:false, //HostSpecialReward = (HostSpecialDiscount)eventCustomerEx, }; if ((@event.LockoutDate - @event.CloseDate).TotalDays <= 2.00) { @event.LockoutDate = @event.CloseDate.AddDays(7); } return(@event); }