Ejemplo n.º 1
0
        public Party UpdateParty(ExigoService.CreatePartyRequest request)
        {
            if (request.PartyID == 0)
            {
                return(null);
            }

            // Create the party
            var context = ExigoDAL.WebService();


            var eventStartDate = new DateTime(request.EventStartDate.Year, request.EventStartDate.Month, request.EventStartDate.Day, request.EventStartTime.Hour, request.EventStartTime.Minute, 0);
            var eventEndDate   = new DateTime(request.EventEndDate.Year, request.EventEndDate.Month, request.EventEndDate.Day, request.EventEndTime.Hour, request.EventEndTime.Minute, 0);

            var apirequest = new Common.Api.ExigoWebService.UpdatePartyRequest(request);

            apirequest.StartDate  = eventStartDate;
            apirequest.EventStart = eventStartDate;
            apirequest.CloseDate  = eventEndDate;
            apirequest.EventEnd   = eventEndDate;

            // Update the Party
            context.UpdateParty(apirequest);

            var partyID = request.PartyID;
            var party   = GetParties(new ExigoService.GetPartiesRequest {
                CustomerID = request.CustomerID, PartyID = partyID, IncludeHostessDetails = true
            }).FirstOrDefault();


            // Return the party
            return(party);
        }
        public UpdatePartyRequest(ExigoService.CreatePartyRequest party)
        {
            var model = new UpdatePartyRequest();

            if (party == null)
            {
                return;
            }

            PartyType       = 1;
            PartyStatusType = 1;
            HostID          = party.HostID;
            DistributorID   = party.CustomerID;

            PartyID = party.PartyID;

            if (party.ParentPartyID > 0)
            {
                BookingPartyID = party.ParentPartyID;
            }

            var createdDate    = DateTime.Today;
            var partyStartDate = new DateTime(party.EventStartDate.Year, party.EventStartDate.Month, party.EventStartDate.Day, party.EventStartTime.Hour, party.EventStartTime.Minute, party.EventStartTime.Second);

            StartDate  = createdDate;
            EventStart = partyStartDate;

            // Some logic to ensure that the end date is set to 30 days after the
            if (party.EventEndDate < partyStartDate)
            {
                party.EventEndDate = partyStartDate.AddDays(GlobalSettings.Parties.PartyOpenDays);
            }

            var endDate = new DateTime(party.EventEndDate.Year, party.EventEndDate.Month, party.EventEndDate.Day, party.EventEndTime.Hour, party.EventEndTime.Minute, party.EventEndTime.Second);

            CloseDate   = endDate;
            EventEnd    = endDate;
            Description = (party.Description.IsNullOrEmpty()) ? " " : party.Description;
            LanguageID  = 0;

            // Sales Goal
            Field1 = party.SalesGoal.ToString();


            Address = new PartyAddress
            {
                Address1 = party.Address1,
                Address2 = party.Address2,
                City     = party.City,
                State    = party.State,
                Zip      = party.Zip,
                Country  = party.Country
            };
        }
        public UpdatePartyRequest(ExigoService.Party party)
        {
            var model = new UpdatePartyRequest();

            if (party == null)
            {
                return;
            }

            PartyType       = party.PartyType;
            PartyStatusType = party.PartyStatusType;
            HostID          = party.HostID;
            DistributorID   = party.CustomerID;
            StartDate       = Convert.ToDateTime(party.StartDate);
            CloseDate       = party.CloseDate;
            Description     = party.Description;
            EventStart      = party.EventStart;
            EventEnd        = party.EventEnd;
            LanguageID      = Convert.ToInt32(party.LanguageID);
            Information     = party.Information;

            Address = (PartyAddress)party.Address;
        }