Пример #1
0
    public void reloadView()
    {
        curParty       = PartyControl.Instance.curParty;
        partyName.text = curParty.partyName;

        playerList = curParty.userList;
        for (int i = 0; i < 4; i++)
        {
            if (i > playerList.Count - 1)
            {
                SlotUI slot = playerSlotList[i];
                slot.disableUI();
                slot.playerName.text = "";
            }
            else if (playerList[i] != null)
            {
                SlotUI     slot   = playerSlotList[i];
                PlayerInfo player = (PlayerInfo)playerList[i];
                Debug.Log(player.id + " " + Websocket.Instance.curPlayer.id);
                if (player.id != Websocket.Instance.curPlayer.id)
                {
                    slot.disableUI();
                    slot.readyButton.GetComponent <ReadyButton>().player = player;
                    slot.readyButton.GetComponent <ReadyButton>().readyClick();
                }
                slot.playerName.text = player.playerName;
                slot.readyButton.GetComponent <ReadyButton>().player = player;
                slot.readyButton.GetComponent <ReadyButton>().readyClick();
            }
        }
    }
Пример #2
0
    private void BnetParty_OnPartyAttributeChanged_DeclineReason(PartyInfo party, string attributeKey, bnet.protocol.attribute.Variant value)
    {
        if (((party.Type == PartyType.FRIENDLY_CHALLENGE) && this.DidSendChallenge()) && value.HasIntValue)
        {
            DeclineReason intValue = (DeclineReason)((int)value.IntValue);
            string        key      = null;
            switch (intValue)
            {
            case DeclineReason.NoValidDeck:
                key = "GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_RECIPIENT_NO_VALID_DECK_SENDER";
                break;

            case DeclineReason.NotUnlocked:
                key = "GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_RECIPIENT_NOT_UNLOCKED_SENDER";
                break;
            }
            if (key != null)
            {
                this.m_hasSeenDeclinedReason = true;
                AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
                    m_headerText      = GameStrings.Get("GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_HEADER"),
                    m_text            = GameStrings.Get(key),
                    m_responseDisplay = AlertPopup.ResponseDisplay.OK
                };
                DialogManager.Get().ShowPopup(info);
            }
        }
    }
Пример #3
0
        public IHttpActionResult PutPartyInfo(int id, PartyInfo partyInfo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != partyInfo.PartyInfoId)
            {
                return(BadRequest());
            }

            db.Entry(partyInfo).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PartyInfoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #4
0
        public PartyInfo GetPartyInfo(int partyId)
        {
            var party = PartyRepository.GetPartyById(partyId);

            if (party != null && party.STATUS != (int)PartyStatuses.DELETED)
            {
                var info = new PartyInfo
                {
                    PartyId               = party.PARTY_ID,
                    InitiatorName         = party.DUOJU_USERS.NICK_NAME,
                    HoldDate              = party.HOLD_DATE,
                    HoldTime              = party.HOLD_TIME,
                    Description           = party.DESCRIPTION,
                    MinIntoForce          = party.MIN_INTO_FORCE,
                    MaxIntoForce          = party.MAX_INTO_FORCE,
                    Status                = party.STATUS,
                    SupplierInfo          = SupplierService.GetSupplierInfoById(party.SUPPLIER_ID),
                    PartyParticipantInfos = GetPartyParticipantInfos(partyId),
                    PartyCommentInfos     = party.STATUS == (int)PartyStatuses.CONSUMED ? PartyRepository.GetPartyCommentInfos(partyId) : null
                };

                ConvertPartyInfo(info);
                return(info);
            }

            return(null);
        }
Пример #5
0
        public IssueInvoiceCommand(DateTime invoiceDate, decimal taxableAmount, decimal taxes, decimal totalPrice, string description, string paymentTerms, string purchaseOrderNumber,
                                   Guid customerId, string customerName, string customerAddress, string customerCity, string customerPostalCode, string customerCountry, string customerVatIndex, string customerNationalIdentificationNumber,
                                   string supplierName, string supplierAddress, string supplierCity, string supplierPostalCode, string supplierCountry, string supplierVatIndex, string supplierNationalIdentificationNumber)
        {
            var customer = new PartyInfo(
                city: customerCity,
                partyName: customerName,
                country: customerCountry,
                partyId: customerId,
                nationalIdentificationNumber: customerNationalIdentificationNumber,
                postalCode: customerPostalCode,
                address: customerAddress,
                vatIndex: customerVatIndex
                );
            var supplier = new PartyInfo(
                partyId: Guid.Empty,
                city: supplierCity,
                partyName: supplierName,
                country: supplierCountry,
                nationalIdentificationNumber: supplierNationalIdentificationNumber,
                postalCode: supplierPostalCode,
                address: supplierAddress,
                vatIndex: supplierVatIndex
                );

            Customer            = customer;
            Supplier            = supplier;
            InvoiceDate         = invoiceDate;
            TaxableAmount       = taxableAmount;
            Taxes               = taxes;
            TotalPrice          = totalPrice;
            Description         = description;
            PaymentTerms        = paymentTerms;
            PurchaseOrderNumber = purchaseOrderNumber;
        }
Пример #6
0
 public ImportIncomingInvoiceCommand(Guid userId, Guid invoiceId, string invoiceNumber, DateTime invoiceDate, DateTime dueDate, string currency, decimal taxableAmount, decimal taxes, decimal totalPrice, decimal totalToPay, string description, string paymentTerms, string purchaseOrderNumber,
                                     PartyInfo customer, PartyInfo supplier, ICollection <InvoiceLineItem> lineItems, bool pricesAreVatIncluded, ICollection <InvoicePriceByVat> pricesByVat, ICollection <NonTaxableItem> nonTaxableItems,
                                     string providenceFundDescription, decimal?providenceFundRate, decimal?providenceFundAmount, string withholdingTaxDescription, decimal?withholdingTaxRate, decimal?withholdingTaxTaxableAmountRate, decimal?withholdingTaxAmount)
     : base(userId)
 {
     Customer                        = customer;
     Supplier                        = supplier;
     InvoiceDate                     = invoiceDate;
     Currency                        = currency;
     TaxableAmount                   = taxableAmount;
     Taxes                           = taxes;
     TotalPrice                      = totalPrice;
     TotalToPay                      = totalToPay;
     Description                     = description;
     PaymentTerms                    = paymentTerms;
     PurchaseOrderNumber             = purchaseOrderNumber;
     LineItems                       = lineItems;
     PricesAreVatIncluded            = pricesAreVatIncluded;
     PricesByVat                     = pricesByVat;
     NonTaxableItems                 = nonTaxableItems;
     ProvidenceFundDescription       = providenceFundDescription;
     ProvidenceFundRate              = providenceFundRate;
     ProvidenceFundAmount            = providenceFundAmount;
     WithholdingTaxDescription       = withholdingTaxDescription;
     WithholdingTaxRate              = withholdingTaxRate;
     WithholdingTaxTaxableAmountRate = withholdingTaxTaxableAmountRate;
     WithholdingTaxAmount            = withholdingTaxAmount;
     InvoiceId                       = invoiceId;
     InvoiceNumber                   = invoiceNumber;
     DueDate                         = dueDate;
 }
Пример #7
0
        public void ReadParty()
        {
            PartyMap = GetLocations("PARTY");
            var source = MemoryLib.GetByteArray(PartyMap, 0x220);

            PartyInfo.ResolvePartyFromBytes(source);
        }
Пример #8
0
 /// <summary>
 /// The default presence when in a party.
 /// </summary>
 /// <param name="partyInfo">The party info.</param>
 /// <param name="properties">The properties.</param>
 public Presence(PartyInfo partyInfo, Dictionary <string, object> properties)
 {
     Status          = $"Battle Royale Lobby - {partyInfo.Members.Count} / {partyInfo.Config["max_size"]}";
     IsPlaying       = false;
     IsJoinable      = false;
     HasVoiceSupport = false;
     SessionId       = "";
     Properties      = properties;
 }
Пример #9
0
        public async Task EditOutgoingCreditNoteDraftAsync(Guid draftId, OutgoingCreditNoteDraftModel model)
        {
            var customer = new PartyInfo
            {
                OriginalId = model.Customer.OriginalId,
                Name       = model.Customer.Name,
                StreetName = Settings.Address,
                City       = Settings.City,
                PostalCode = Settings.PostalCode,
                Country    = Settings.Country,
                VatIndex   = Settings.TaxId,
                NationalIdentificationNumber = Settings.TaxId
            };

            var lineItems = model.LineItems.Select(l => new DraftLineItem
            {
                Id          = l.Id,
                Code        = l.Code,
                Description = l.Description,
                Quantity    = l.Quantity,
                TotalPrice  = l.TotalPrice,
                UnitPrice   = l.UnitPrice,
                Vat         = l.Vat
            });

            var pricesByVat = model.PricesByVat.Select(p => new PriceByVat
            {
                TaxableAmount = p.TaxableAmount,
                TotalPrice    = p.TotalPrice,
                VatAmount     = p.VatAmount,
                VatRate       = p.VatRate
            });

            var nonTaxableItems = model.NonTaxableItems.Select(t => new NonTaxableItem
            {
                Id          = t.Id,
                Amount      = t.Amount,
                Description = t.Description
            });

            await OutgoingCreditNoteDraftCommands.EditDraft(
                draftId,
                customer,
                model.Date,
                model.Currency,
                model.Amount,
                model.Taxes,
                model.TotalPrice,
                model.Description,
                model.PaymentTerms,
                model.PurchaseOrderNumber,
                model.VatIncluded,
                lineItems,
                pricesByVat,
                nonTaxableItems);
        }
Пример #10
0
        public ActionResult GetRateAllRate()
        {
            List <RateInfo> RateList = db.RateInfoset.ToList();

            foreach (var rate in RateList)
            {
                PartyInfo Party = db.PartyInfoset.Where(p => p.PartyInfoId.ToString() == rate.PartyInfoId).FirstOrDefault();
                rate.Ex2 = Party.Name;
            }
            return(Json(RateList, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
    public void JoinParty(PartyInfo party)
    {
        JoinCommand cmd = new JoinCommand();

        cmd.type      = (int)CommandType.JOIN;
        cmd.partyName = party.partyName;
        cmd.player    = curPlayer;
        string jsonCmd = JsonUtility.ToJson(cmd);

        currentSocket.Send(jsonCmd);
    }
Пример #12
0
        public void ApplyEvent([AggregateId(nameof(IncomingInvoiceRegisteredEvent.InvoiceId))] IncomingInvoiceRegisteredEvent evt)
        {
            Id                  = evt.InvoiceId;
            IsOverdue           = false;
            Number              = evt.InvoiceNumber;
            Date                = evt.InvoiceDate;
            DueDate             = evt.DueDate;
            Currency            = evt.Currency;
            Amount              = evt.TaxableAmount;
            Taxes               = evt.Taxes;
            TotalPrice          = evt.TotalPrice;
            TotalToPay          = evt.TotalToPay;
            Description         = evt.Description;
            PaymentTerms        = evt.PaymentTerms;
            PurchaseOrderNumber = evt.PurchaseOrderNumber;
            Supplier            = new PartyInfo(evt.Supplier.Id, evt.Supplier.Name, evt.Supplier.StreetName, evt.Supplier.City, evt.Supplier.PostalCode, evt.Supplier.Country, evt.Supplier.VatIndex, evt.Supplier.NationalIdentificationNumber);

            if (evt.LineItems != null)
            {
                InvoiceLineItems = evt.LineItems
                                   .Select(i => new InvoiceLineItem(i.Code, i.Description, i.Quantity, i.UnitPrice, i.TotalPrice, i.Vat, i.VatDescription))
                                   .ToArray();
            }

            if (evt.PricesByVat != null)
            {
                InvoicePricesByVat = evt.PricesByVat
                                     .Select(p => new InvoicePriceByVat(p.TaxableAmount, p.VatRate, p.VatAmount, p.TotalPrice))
                                     .ToArray();
            }

            if (evt.NonTaxableItems != null)
            {
                NonTaxableItems = evt.NonTaxableItems
                                  .Select(t => new NonTaxableItem(t.Description, t.Amount))
                                  .ToArray();
            }

            if (!string.IsNullOrWhiteSpace(evt.ProvidenceFundDescription) && evt.ProvidenceFundRate.HasValue && evt.ProvidenceFundAmount.HasValue)
            {
                ProvidenceFund = new InvoiceProvidenceFund(evt.ProvidenceFundDescription, evt.ProvidenceFundRate.Value, evt.ProvidenceFundAmount.Value);
            }

            if (!string.IsNullOrWhiteSpace(evt.WithholdingTaxDescription) && evt.WithholdingTaxRate.HasValue && evt.WithholdingTaxTaxableAmountRate.HasValue && evt.WithholdingTaxAmount.HasValue)
            {
                WithholdingTax = new InvoiceWithholdingTax(
                    evt.WithholdingTaxDescription,
                    evt.WithholdingTaxRate.Value,
                    evt.WithholdingTaxTaxableAmountRate.Value,
                    evt.WithholdingTaxAmount.Value);
            }

            PricesAreVatIncluded = evt.PricesAreVatIncluded;
        }
Пример #13
0
    //Private Methods
    private void Init(PartyInfo partyInfo, PartySide side, Transform[] initialPoints, Transform selectingPoint, Deleg_ActionPointChanged onActionPointChanged)
    {
        DivineDebug.Log("Initing party started.");

        _side = side;

        _name = partyInfo.Name;

        _secrets = partyInfo.availableSecrets;

        _actionPoint = partyInfo.actionPoint;


        Event_ActionPointChanged += onActionPointChanged;

        _selectingPoint = selectingPoint;

        _charsDic = new Dictionary <long, Character>();

        //Build Hero
        _hero = BuildCharacter(partyInfo.heroInfo, initialPoints[0], true) as Hero;
        _hero.Event_StateChange += OnCharacterStateChange;
        _charsDic.Add(partyInfo.heroInfo.uniqueID, _hero);

        _characters = new Character[partyInfo.charInfoes.Length];

        for (int i = 0; i < partyInfo.charInfoes.Length; i++)
        {
            if (i + 1 < initialPoints.Length)
            {
                _characters[i] = BuildCharacter(partyInfo.charInfoes[i], initialPoints[i + 1], false);
            }
            else
            {
                _characters[i] = BuildCharacter(partyInfo.charInfoes[i], initialPoints[0], false); //For Chakra
            }
            _characters[i].Event_StateChange   += OnCharacterStateChange;
            _characters[i].Event_ChakraApeared += OnChakraApear;
            _charsDic.Add(partyInfo.charInfoes[i].uniqueID, _characters[i]);
        }

        //Register charaters for click and receive spells
        foreach (Character ch in _charsDic.Values)
        {
            ch.Event_OnClick       += OnCharacterClick;
            ch.Event_SpellReceived += OnCharacterSpellReceived;
        }

        //if (!FakeServer.instance.isFake)
        //{
        _characters[_characters.Length - 1].SetIsChakra(true);
        _chakra = _characters[_characters.Length - 1];
        //}
    }
Пример #14
0
        public IHttpActionResult GetPartyInfo(int id)
        {
            PartyInfo partyInfo = db.PartyInfoset.Find(id);

            if (partyInfo == null)
            {
                return(NotFound());
            }

            return(Ok(partyInfo));
        }
Пример #15
0
    private void InitPartyStats(PartyInfo party)
    {
        _monikers[party.heroInfo.uniqueID] = party.heroInfo.moniker;
        _curStats[party.heroInfo.uniqueID] = (BattleObjStats)party.heroInfo.baseStats.Clone();

        foreach (var troop in party.charInfoes)
        {
            _monikers[troop.uniqueID] = troop.moniker;
            _curStats[troop.uniqueID] = (BattleObjStats)troop.baseStats.Clone();
        }
    }
Пример #16
0
        public async Task EditDraft(Guid draftId, PartyInfo customer, DateTime?date, string currency, decimal taxableAmount, decimal taxes, decimal totalPrice, string description, string paymentTerms, string purchaseOrderNumber, bool pricesAreVatIncluded, IEnumerable <DraftLineItem> lineItems, IEnumerable <PriceByVat> pricesByVat, IEnumerable <NonTaxableItem> nonTaxableItems)
        {
            var draft = _context
                        .OutgoingInvoiceDrafts
                        .Include(d => d.LineItems)
                        .Include(d => d.PricesByVat)
                        .Include(d => d.NonTaxableItems)
                        .Single(d => d.Id == draftId);

            draft.Customer = customer;

            if (draft.Date != date)
            {
                draft.Date = date;
            }
            if (draft.Currency != currency)
            {
                draft.Currency = currency;
            }
            if (draft.TaxableAmount != taxableAmount)
            {
                draft.TaxableAmount = taxableAmount;
            }
            if (draft.Taxes != taxes)
            {
                draft.Taxes = taxes;
            }
            if (draft.TotalPrice != totalPrice)
            {
                draft.TotalPrice = totalPrice;
            }
            if (draft.Description != description)
            {
                draft.Description = description;
            }
            if (draft.PaymentTerms != paymentTerms)
            {
                draft.PaymentTerms = paymentTerms;
            }
            if (draft.PurchaseOrderNumber != purchaseOrderNumber)
            {
                draft.PurchaseOrderNumber = purchaseOrderNumber;
            }
            if (draft.PricesAreVatIncluded != pricesAreVatIncluded)
            {
                draft.PricesAreVatIncluded = pricesAreVatIncluded;
            }

            UpdateDraftLineItems(draft, lineItems);
            UpdateDraftPricesByVat(draft, pricesByVat);
            UpdateDraftNonTaxableItems(draft, nonTaxableItems);

            await _context.SaveChangesAsync();
        }
Пример #17
0
        static void AddPartyInfoDirs(List <string> dirs, PartyInfo p1)
        {
            if (p1.PartyPath != null)
            {
                AddDir(dirs, p1.PartyPath);
            }

            if (p1.FolderPath != null && p1.FolderPath != "")
            {
                AddDir(dirs, p1.FolderPath);
            }
        }
Пример #18
0
        public IHttpActionResult PostPartyInfo(PartyInfo partyInfo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.PartyInfoset.Add(partyInfo);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = partyInfo.PartyInfoId }, partyInfo));
        }
Пример #19
0
        public OutgoingInvoiceIssuedEvent(Guid invoiceId, string invoiceNumber, DateTime invoiceDate, DateTime?dueDate, string currency, decimal taxableAmount, decimal taxes, decimal totalPrice, decimal totalToPay, string description, string paymentTerms, string purchaseOrderNumber,
                                          Guid customerId, string customerName, string customerAddress, string customerCity, string customerPostalCode, string customerCountry, string customerVatIndex, string customerNationalIdentificationNumber,
                                          string supplierName, string supplierAddress, string supplierCity, string supplierPostalCode, string supplierCountry, string supplierVatIndex, string supplierNationalIdentificationNumber, IEnumerable <InvoiceLineItem> lineItems, bool pricesAreVatIncluded, IEnumerable <InvoicePriceByVat> pricesByVat, IEnumerable <NonTaxableItem> nonTaxableItems,
                                          string providenceFundDescription, decimal?providenceFundRate, decimal?providenceFundAmount, string withholdingTaxDescription, decimal?withholdingTaxRate, decimal?withholdingTaxTaxableAmountRate, decimal?withholdingTaxAmount, Guid userId)
            : base(userId)
        {
            var customer = new PartyInfo(
                city: customerCity,
                partyName: customerName,
                country: customerCountry,
                partyId: customerId,
                nationalIdentificationNumber: customerNationalIdentificationNumber,
                postalCode: customerPostalCode,
                address: customerAddress,
                vatIndex: customerVatIndex
                );
            var supplier = new PartyInfo(
                partyId: Guid.Empty,
                city: supplierCity,
                partyName: supplierName,
                country: supplierCountry,
                nationalIdentificationNumber: supplierNationalIdentificationNumber,
                postalCode: supplierPostalCode,
                address: supplierAddress,
                vatIndex: supplierVatIndex
                );

            Customer                        = customer;
            Supplier                        = supplier;
            InvoiceId                       = invoiceId;
            InvoiceNumber                   = invoiceNumber;
            InvoiceDate                     = invoiceDate;
            DueDate                         = dueDate;
            Currency                        = currency;
            TaxableAmount                   = taxableAmount;
            Taxes                           = taxes;
            TotalPrice                      = totalPrice;
            TotalToPay                      = totalToPay;
            Description                     = description;
            PaymentTerms                    = paymentTerms;
            PurchaseOrderNumber             = purchaseOrderNumber;
            LineItems                       = lineItems;
            PricesAreVatIncluded            = pricesAreVatIncluded;
            PricesByVat                     = pricesByVat;
            NonTaxableItems                 = nonTaxableItems;
            ProvidenceFundDescription       = providenceFundDescription;
            ProvidenceFundRate              = providenceFundRate;
            ProvidenceFundAmount            = providenceFundAmount;
            WithholdingTaxDescription       = withholdingTaxDescription;
            WithholdingTaxRate              = withholdingTaxRate;
            WithholdingTaxTaxableAmountRate = withholdingTaxTaxableAmountRate;
            WithholdingTaxAmount            = withholdingTaxAmount;
        }
Пример #20
0
        /// <summary>
        /// Parse a parameter from FreeSWITCH
        /// </summary>
        /// <param name="name">Parameter name as defined by FS</param>
        /// <param name="value">Parameter value</param>
        /// <returns>
        /// true if parsed sucessfully; otherwise false.
        /// </returns>
        public override bool ParseParameter(string name, string value)
        {
            switch (name)
            {
            case ScreenBitTag:
                ScreenBit = value == Yes;
                break;

                /*
                 * case "channel-presence-id":
                 * PresenceId = value;
                 * break;
                 * case "channel-call-uuid":
                 * CallId = new UniqueId(value);
                 * break;*/
            }

            if (name.StartsWith(OriginateeTag) || name.StartsWith(OriginatorTag))
            {
                if (_originator == PartyInfo.Empty)
                {
                    _originator = new PartyInfo();
                }

                return(_originator.Parse(name.Substring(11), value));
            }
            if (name.StartsWith(CallerTag))
            {
                if (_caller == PartyInfo.Empty)
                {
                    _caller = new PartyInfo();
                }

                return(_caller.Parse(name.Substring(7), value));
            }
            if (name.StartsWith(OtherLegTag))
            {
                if (_otherLeg == PartyInfo.Empty)
                {
                    _otherLeg = new PartyInfo();
                }

                return(_otherLeg.Parse(name.Substring(10), value));
            }


            var res = base.ParseParameter(name, value);

            //          if (!res)
            //                Debugger.Break();

            return(res);
        }
Пример #21
0
 //public ImportOutgoingInvoiceCommand(Guid userId, Guid invoiceId, string invoiceNumber, DateTime invoiceDate, DateTime dueDate, string currency, decimal taxableAmount, decimal taxes, decimal totalPrice, decimal totalToPay, string description, string paymentTerms, string purchaseOrderNumber,
 //    Guid customerId, string customerName, string customerAddress, string customerCity, string customerPostalCode, string customerCountry, string customerVatIndex, string customerNationalIdentificationNumber,
 //    string supplierName, string supplierAddress, string supplierCity, string supplierPostalCode, string supplierCountry, string supplierVatIndex, string supplierNationalIdentificationNumber, IEnumerable<InvoiceLineItem> lineItems, bool pricesAreVatIncluded, IEnumerable<InvoicePriceByVat> pricesByVat, IEnumerable<NonTaxableItem> nonTaxableItems,
 //    string providenceFundDescription, decimal? providenceFundRate, decimal? providenceFundAmount, string withholdingTaxDescription, decimal? withholdingTaxRate, decimal? withholdingTaxTaxableAmountRate, decimal? withholdingTaxAmount)
 //    : base(userId)
 //{
 //    var customer = new PartyInfo(
 //        city: customerCity,
 //        partyName: customerName,
 //        country: customerCountry,
 //        partyId: customerId,
 //        nationalIdentificationNumber: customerNationalIdentificationNumber,
 //        postalCode: customerPostalCode,
 //        address: customerAddress,
 //        vatIndex: customerVatIndex
 //    );
 //    var supplier = new PartyInfo(
 //        partyId: Guid.Empty,
 //        city: supplierCity,
 //        partyName: supplierName,
 //        country: supplierCountry,
 //        nationalIdentificationNumber: supplierNationalIdentificationNumber,
 //        postalCode: supplierPostalCode,
 //        address: supplierAddress,
 //        vatIndex: supplierVatIndex
 //    );
 //    Customer = customer;
 //    Supplier = supplier;
 //    InvoiceDate = invoiceDate;
 //    Currency = currency;
 //    TaxableAmount = taxableAmount;
 //    Taxes = taxes;
 //    TotalPrice = totalPrice;
 //    TotalToPay = totalToPay;
 //    Description = description;
 //    PaymentTerms = paymentTerms;
 //    PurchaseOrderNumber = purchaseOrderNumber;
 //    LineItems = lineItems;
 //    PricesAreVatIncluded = pricesAreVatIncluded;
 //    PricesByVat = pricesByVat;
 //    NonTaxableItems = nonTaxableItems;
 //    ProvidenceFundDescription = providenceFundDescription;
 //    ProvidenceFundRate = providenceFundRate;
 //    ProvidenceFundAmount = providenceFundAmount;
 //    WithholdingTaxDescription = withholdingTaxDescription;
 //    WithholdingTaxRate = withholdingTaxRate;
 //    WithholdingTaxTaxableAmountRate = withholdingTaxTaxableAmountRate;
 //    WithholdingTaxAmount = withholdingTaxAmount;
 //    InvoiceId = invoiceId;
 //    InvoiceNumber = invoiceNumber;
 //    DueDate = dueDate;
 //}
 public ImportOutgoingInvoiceCommand(Guid userId, Guid invoiceId, string invoiceNumber, DateTime invoiceDate, DateTime dueDate, string currency, decimal taxableAmount, decimal taxes, decimal totalPrice, decimal totalToPay, string description, string paymentTerms, string purchaseOrderNumber,
                                     PartyInfo customer,
                                     PartyInfo supplier, ICollection <InvoiceLineItem> lineItems, bool pricesAreVatIncluded, ICollection <InvoicePriceByVat> pricesByVat, ICollection <NonTaxableItem> nonTaxableItems,
                                     string providenceFundDescription, decimal?providenceFundRate, decimal?providenceFundAmount, string withholdingTaxDescription, decimal?withholdingTaxRate, decimal?withholdingTaxTaxableAmountRate, decimal?withholdingTaxAmount)
     : base(userId)
 {
     //var customer = new PartyInfo(
     //    city: customerCity,
     //    partyName: customerName,
     //    country: customerCountry,
     //    partyId: customerId,
     //    nationalIdentificationNumber: customerNationalIdentificationNumber,
     //    postalCode: customerPostalCode,
     //    address: customerAddress,
     //    vatIndex: customerVatIndex
     //);
     //var supplier = new PartyInfo(
     //    partyId: Guid.Empty,
     //    city: supplierCity,
     //    partyName: supplierName,
     //    country: supplierCountry,
     //    nationalIdentificationNumber: supplierNationalIdentificationNumber,
     //    postalCode: supplierPostalCode,
     //    address: supplierAddress,
     //    vatIndex: supplierVatIndex
     //);
     Customer                        = customer;
     Supplier                        = supplier;
     InvoiceDate                     = invoiceDate;
     Currency                        = currency;
     TaxableAmount                   = taxableAmount;
     Taxes                           = taxes;
     TotalPrice                      = totalPrice;
     TotalToPay                      = totalToPay;
     Description                     = description;
     PaymentTerms                    = paymentTerms;
     PurchaseOrderNumber             = purchaseOrderNumber;
     LineItems                       = lineItems;
     PricesAreVatIncluded            = pricesAreVatIncluded;
     PricesByVat                     = pricesByVat;
     NonTaxableItems                 = nonTaxableItems;
     ProvidenceFundDescription       = providenceFundDescription;
     ProvidenceFundRate              = providenceFundRate;
     ProvidenceFundAmount            = providenceFundAmount;
     WithholdingTaxDescription       = withholdingTaxDescription;
     WithholdingTaxRate              = withholdingTaxRate;
     WithholdingTaxTaxableAmountRate = withholdingTaxTaxableAmountRate;
     WithholdingTaxAmount            = withholdingTaxAmount;
     InvoiceId                       = invoiceId;
     InvoiceNumber                   = invoiceNumber;
     DueDate                         = dueDate;
 }
Пример #22
0
        /// <summary>
        /// Determine the points for the given Receiving PMode and UserMessage
        /// </summary>
        /// <param name="pmode"></param>
        /// <param name="userMessage"></param>
        /// <returns></returns>
        public int DeterminePoints(ReceivingProcessingMode pmode, UserMessage userMessage)
        {
            if (pmode == null)
            {
                throw new ArgumentNullException(nameof(pmode));
            }

            if (userMessage == null)
            {
                throw new ArgumentNullException(nameof(userMessage));
            }

            PartyInfo pmodePartyInfo = pmode.MessagePackaging?.PartyInfo;

            if (pmodePartyInfo == null)
            {
                return(NotEqual);
            }

            if (!pmodePartyInfo.FromPartySpecified &&
                !pmodePartyInfo.ToPartySpecified)
            {
                return(NotEqual);
            }

            var points = 0;

            bool fromPartyEqual = ArePartyIdsEqual(pmodePartyInfo.FromParty, userMessage.Sender);
            bool toPartyEqual   = ArePartyIdsEqual(pmodePartyInfo.ToParty, userMessage.Receiver);

            if (fromPartyEqual && !pmodePartyInfo.ToPartySpecified)
            {
                points += FromPartyPoints;
            }

            if (toPartyEqual && !pmodePartyInfo.FromPartySpecified)
            {
                points += ToPartyPoints;
            }

            if (fromPartyEqual && toPartyEqual)
            {
                points += FromPartyPoints + ToPartyPoints;
            }

            if (ArePartyRolesEqual(pmodePartyInfo, userMessage))
            {
                points += PartyRolePoints;
            }

            return(points);
        }
Пример #23
0
 private void BnetParty_OnJoined(OnlineEventType evt, PartyInfo party, LeaveReason?reason)
 {
     if ((party.Type == PartyType.FRIENDLY_CHALLENGE) && (evt == OnlineEventType.ADDED))
     {
         long?partyAttributeLong = BnetParty.GetPartyAttributeLong(party.Id, "WTCG.Game.ScenarioId");
         if (partyAttributeLong.HasValue)
         {
             this.m_scenarioId = (int)partyAttributeLong.Value;
             TavernBrawlMission mission = TavernBrawlManager.Get().CurrentMission();
             this.m_isChallengeTavernBrawl = (mission != null) && (this.m_scenarioId == mission.missionId);
         }
     }
 }
Пример #24
0
 public void Apply(OutgoingInvoiceIssuedEvent evt)
 {
     Id = evt.InvoiceId;
     Number = evt.InvoiceNumber;
     Date = evt.InvoiceDate;
     Amount = evt.Amount;
     Taxes = evt.Taxes;
     TotalPrice = evt.TotalPrice;
     Description = evt.Description;
     PaymentTerms = evt.PaymentTerms;
     PurchaseOrderNumber = evt.PurchaseOrderNumber;
     Customer = new PartyInfo(evt.Customer.Id, evt.Customer.Name, evt.Customer.StreetName, evt.Customer.City, evt.Customer.PostalCode, evt.Customer.Country, evt.Customer.VatIndex, evt.Customer.NationalIdentificationNumber);
 }
Пример #25
0
 public void Apply(OutgoingInvoiceIssuedEvent evt)
 {
     Id                  = evt.InvoiceId;
     Number              = evt.InvoiceNumber;
     Date                = evt.InvoiceDate;
     Amount              = evt.Amount;
     Taxes               = evt.Taxes;
     TotalPrice          = evt.TotalPrice;
     Description         = evt.Description;
     PaymentTerms        = evt.PaymentTerms;
     PurchaseOrderNumber = evt.PurchaseOrderNumber;
     Customer            = new PartyInfo(evt.Customer.Id, evt.Customer.Name, evt.Customer.StreetName, evt.Customer.City, evt.Customer.PostalCode, evt.Customer.Country, evt.Customer.VatIndex, evt.Customer.NationalIdentificationNumber);
 }
Пример #26
0
 public void ApplyEvent([AggregateId(nameof(IncomingInvoiceRegisteredEvent.InvoiceId))] IncomingInvoiceRegisteredEvent evt)
 {
     Id                  = evt.InvoiceId;
     Number              = evt.InvoiceNumber;
     Date                = evt.InvoiceDate;
     Amount              = evt.Amount;
     Taxes               = evt.Taxes;
     TotalPrice          = evt.TotalPrice;
     Description         = evt.Description;
     PaymentTerms        = evt.PaymentTerms;
     PurchaseOrderNumber = evt.PurchaseOrderNumber;
     Supplier            = new PartyInfo(evt.Supplier.Id, evt.Supplier.Name, evt.Supplier.StreetName, evt.Supplier.City, evt.Supplier.PostalCode, evt.Supplier.Country, evt.Supplier.VatIndex, evt.Supplier.NationalIdentificationNumber);
 }
Пример #27
0
        public RegisterIncomingCreditNoteCommand(Guid userId, string creditNoteNumber, DateTime creditNoteDate, string currency, decimal taxableAmount, decimal taxes, decimal totalPrice, decimal totalToPay, string description, string paymentTerms, string purchaseOrderNumber,
                                                 Guid customerId, string customerName, string customerAddress, string customerCity, string customerPostalCode, string customerCountry, string customerVatIndex, string customerNationalIdentificationNumber,
                                                 Guid supplierId, string supplierName, string supplierAddress, string supplierCity, string supplierPostalCode, string supplierCountry, string supplierVatIndex, string supplierNationalIdentificationNumber, IEnumerable <LineItem> lineItems, bool pricesAreVatIncluded, IEnumerable <PriceByVat> pricesByVat, IEnumerable <NonTaxableItem> nonTaxableItems,
                                                 string providenceFundDescription, decimal?providenceFundRate, decimal?providenceFundAmount, string withholdingTaxDescription, decimal?withholdingTaxRate, decimal?withholdingTaxTaxableAmountRate, decimal?withholdingTaxAmount)
            : base(userId)
        {
            var customer = new PartyInfo(
                city: customerCity,
                partyName: customerName,
                country: customerCountry,
                partyId: customerId,
                nationalIdentificationNumber: customerNationalIdentificationNumber,
                postalCode: customerPostalCode,
                address: customerAddress,
                vatIndex: customerVatIndex
                );
            var supplier = new PartyInfo(
                partyId: supplierId,
                city: supplierCity,
                partyName: supplierName,
                country: supplierCountry,
                nationalIdentificationNumber: supplierNationalIdentificationNumber,
                postalCode: supplierPostalCode,
                address: supplierAddress,
                vatIndex: supplierVatIndex
                );

            Customer                        = customer;
            Supplier                        = supplier;
            CreditNoteNumber                = creditNoteNumber;
            CreditNoteDate                  = creditNoteDate;
            Currency                        = currency;
            TaxableAmount                   = taxableAmount;
            Taxes                           = taxes;
            TotalPrice                      = totalPrice;
            TotalToPay                      = totalToPay;
            Description                     = description;
            PaymentTerms                    = paymentTerms;
            PurchaseOrderNumber             = purchaseOrderNumber;
            LineItems                       = lineItems;
            PricesAreVatIncluded            = pricesAreVatIncluded;
            PricesByVat                     = pricesByVat;
            NonTaxableItems                 = nonTaxableItems;
            ProvidenceFundDescription       = providenceFundDescription;
            ProvidenceFundRate              = providenceFundRate;
            ProvidenceFundAmount            = providenceFundAmount;
            WithholdingTaxDescription       = withholdingTaxDescription;
            WithholdingTaxRate              = withholdingTaxRate;
            WithholdingTaxTaxableAmountRate = withholdingTaxTaxableAmountRate;
            WithholdingTaxAmount            = withholdingTaxAmount;
        }
Пример #28
0
        public IHttpActionResult DeletePartyInfo(int id)
        {
            PartyInfo partyInfo = db.PartyInfoset.Find(id);

            if (partyInfo == null)
            {
                return(NotFound());
            }

            db.PartyInfoset.Remove(partyInfo);
            db.SaveChanges();

            return(Ok(partyInfo));
        }
Пример #29
0
        public async Task <IActionResult> Set(Guid partyId, PartyInfo partyInfo)
        {
            var success = await _manager.Set(new PartyInfoView
            {
                Id   = partyId,
                Info = partyInfo
            });

            if (success)
            {
                return(Ok());
            }

            return(BadRequest());
        }
        // Create a list of custom properties to append to a matchmaking ticket
        static Dictionary <string, string> BuildTicketProperties()
        {
            // Ticket properties are a collection of non-indexed objects which you can deserialize and access inside a match function
            // You can use properties to attach any arbitrary data you want to a ticket
            var properties = new Dictionary <string, string>();

            // In this example, we attach the data from a custom "CustomTicketProperties" object to the ticket
            var customProperties = new PartyInfo {
                id = Guid.NewGuid()
            };

            properties.Add(customProperties.GetType().Name.ToLower(), JsonUtility.ToJson(customProperties));

            return(properties);
        }
Пример #31
0
 public ImportJobOrderCommand(Guid jobOrderId, Guid customerId, string customerName, Guid managerId, decimal?price, string currency, DateTime dateOfRegistration, DateTime dateOfStart, DateTime dueDate, bool isTimeAndMaterial, string jobOrderNumber, string jobOrderName, string purchaseOrderNumber, string description)
 {
     JobOrderId          = jobOrderId;
     Customer            = new PartyInfo(customerId, customerName);
     ManagerId           = managerId;
     Price               = price;
     Currency            = currency;
     DateOfRegistration  = dateOfRegistration;
     DateOfStart         = dateOfStart;
     DueDate             = dueDate;
     IsTimeAndMaterial   = isTimeAndMaterial;
     JobOrderNumber      = jobOrderNumber;
     JobOrderName        = jobOrderName;
     PurchaseOrderNumber = purchaseOrderNumber;
     Description         = description;
 }
        /// <summary>
        /// Parse a parameter from FreeSWITCH
        /// </summary>
        /// <param name="name">Parameter name as defined by FS</param>
        /// <param name="value">Parameter value</param>
        /// <returns>
        /// true if parsed sucessfully; otherwise false.
        /// </returns>
        public override bool ParseParameter(string name, string value)
        {
            switch (name)
            {
                case ScreenBitTag:
                    ScreenBit = value == Yes;
                    break;
                    /*
                case "channel-presence-id":
                    PresenceId = value;
                    break;
                case "channel-call-uuid":
                    CallId = new UniqueId(value);
                    break;*/
            }

            if (name.StartsWith(OriginateeTag) || name.StartsWith(OriginatorTag))
            {
                if (_originator == PartyInfo.Empty)
                    _originator = new PartyInfo();

                return _originator.Parse(name.Substring(11), value);
            }
            if (name.StartsWith(CallerTag))
            {
                if (_caller == PartyInfo.Empty)
                    _caller = new PartyInfo();

                return _caller.Parse(name.Substring(7), value);
            }
            if (name.StartsWith(OtherLegTag))
            {
                if (_otherLeg == PartyInfo.Empty)
                    _otherLeg = new PartyInfo();

                return _otherLeg.Parse(name.Substring(10), value);
            }


            var res = base.ParseParameter(name, value);
            //          if (!res)
            //                Debugger.Break();

            return res;
        }
Пример #33
0
        public override bool ParseParameter(string name, string value)
        {
            var res = ChannelState.ParseParameter(name, value);
            switch (name)
            {
                case "status":
                    Status = value;
                    break;
                case "rpid":
                    Rpid = value;
                    break;
                case "login":
                    Login = value;
                    break;
                case "event_type":
                    PresenceEventType = value;
                    break;
                case "resub":
                    ReSubscribe = value == "true";
                    break;
                case "alt_event_type":
                    AlternativeEventType = value;
                    break;
                case "event_count":
                    EventCount = int.Parse(value);
                    break;
                case "channel-state":
                    State = ChannelStateParser.Parse(value);
                    break;

                case "presence-calling-file":
                    CallingFile = value;
                    break;

                case "presence-calling-function":
                    CallingFunction = value;
                    break;
                case "presence-calling-line":
                    CallingLineNumber = int.Parse(value);
                    break;

                default:
                    if (name.Length > 8 && name.Substring(0, 8) == "channel-")
                    {
                        if (ChannelInfo == null)
                            ChannelInfo = new ChannelInfo();
                        return ChannelInfo.Parse(name, value);
                    }
                    if (name.Length > 7 && name.Substring(0, 7) == "caller-")
                    {
                        if (Caller == null)
                            Caller = new PartyInfo();
                        return Caller.Parse(name.Substring(7), value);
                    }

                    return base.ParseParameter(name, value) || res;
            }
            return true;
        }