コード例 #1
0
        public static void Check(this PartyDetails expected, PartyDetails candidate)
        {
            Assert.AreEqual(expected.Id, candidate.Id, "Id differs");
            Assert.AreEqual(expected.Name, candidate.Name, "Name differs");

            expected.Validity.Check(candidate.Validity);
        }
コード例 #2
0
        public void AddMappingToExpiredEntityNotAllowed()
        {
            var start  = new DateTime(2000, 12, 31);
            var finish = DateUtility.Round(SystemTime.UtcNow().AddDays(-1));
            var entity = new Party();
            var d1     = new PartyDetails
            {
                Party    = entity,
                Validity = new DateRange(start, finish)
            };

            // NB Must bypass business rules to set up
            entity.Details.Add(d1);

            var s1 = new SourceSystem {
                Name = "Test"
            };
            var m1 = new PartyMapping {
                System = s1, MappingValue = "1", Validity = new DateRange(start, DateUtility.MaxDate)
            };

            try
            {
                entity.ProcessMapping(m1);
            }
            catch (ArgumentOutOfRangeException ex)
            {
                Assert.IsTrue(ex.Message.StartsWith("Cannot change mapping for expired entity"));
                throw;
            }
        }
コード例 #3
0
 public void UseAbility(PartyDetails user, PartyDetails opponent)
 {
     foreach (ActionEffectScriptable eff in effects)
     {
         eff.ApplyEffect(user, opponent);
     }
 }
コード例 #4
0
        void ConcatenateDateTime()
        {
            PartyDetails details = partyDetails;

            details.when      = partyDate.Add(partyTime);
            partyDetails      = details;
            partyDetails.when = details.when;
            //partyDetails.time = partyTime;
        }
コード例 #5
0
    public override void ApplyEffect(PartyDetails user, PartyDetails opponent)
    {
        switch (target)
        {
        case Target.User:
            user.ModifyHealth(damage);
            break;

        case Target.Opponent:
            opponent.ModifyHealth(damage);
            break;
        }
    }
コード例 #6
0
        public static void Compare(EnergyTrading.MDM.Contracts.Sample.Party contract, MDM.Party entity)
        {
            PartyDetails detailsToCompare = entity.Details[0];

            if (contract.MdmSystemData != null)
            {
                detailsToCompare = entity.Details.Where(details => details.Validity.Start == contract.MdmSystemData.StartDate).First();
            }

            Assert.AreEqual(contract.Details.Name, detailsToCompare.Name);
            Assert.AreEqual(contract.Details.FaxNumber, detailsToCompare.Fax);
            Assert.AreEqual(contract.Details.TelephoneNumber, detailsToCompare.Phone);
            Assert.AreEqual(contract.Details.Role, detailsToCompare.Role);
        }
コード例 #7
0
        public void VersionReportsLatestTimestamp()
        {
            var party   = new Party();
            var details = new PartyDetails()
            {
                Id = 12, Name = "Party 1", Timestamp = 34UL.GetVersionByteArray()
            };

            party.AddDetails(details);

            var entity = party as IEntity;

            Assert.AreEqual(34UL, entity.Version, "Version differs");
        }
コード例 #8
0
        public void AttemptUpdateNonExistentMapping()
        {
            var details = new PartyDetails {
                Id = 12, Name = "Party"
            };
            var entity = new Party();

            entity.AddDetails(details);

            var mapping = new PartyMapping {
                Id = 34
            };

            entity.ProcessMapping(mapping);
        }
コード例 #9
0
        public ActionResult SaveParties(string partyId, string partyType, string partyName, string mobile, string telephone, string address, string city, string pincode, string state, string country, string email, string pancard, string gstIn)
        {
            if (partyId == "" || partyId == null)
            {
                partyId = "0";
            }
            if (telephone == "" || telephone == null)
            {
                telephone = "0";
            }
            if (pincode == "" || pincode == null)
            {
                pincode = "0";
            }

            Response      res        = new Response();
            List <object> resultList = new List <object>();
            var           partyFlag  = Int32.Parse(partyId);
            PartyDetails  party      = new PartyDetails();

            party.partyType = partyType;
            party.partyName = partyName;
            party.mobile    = long.Parse(mobile);
            party.telephone = long.Parse(telephone);
            party.address   = address;
            party.city      = city;
            party.pincode   = Int32.Parse(pincode);
            party.state     = state;
            party.country   = country;
            party.email     = email;
            party.pancard   = pancard;
            party.gstIn     = gstIn;
            party.partyId   = Int32.Parse(partyId);

            if (partyFlag == 0)
            {
                res = masterDal.SavePartyDetails(party);
            }
            else
            {
                res = masterDal.UpdatePartyDetails(party);
            }
            resultList.Add(res);
            resultList.Add(GetAllParties());


            return(Json(resultList, JsonRequestBehavior.AllowGet));
        }
コード例 #10
0
 public FindLocationPopUpPage()
 {
     positions = new List <Position>();
     CloseWhenBackgroundIsClicked = true;
     Padding = 20;
     if (CreatePartyViewModel._partyDetails != null)
     {
         partyDetails = CreatePartyViewModel._partyDetails;
     }
     else
     {
         throw new NullReferenceException("No partyDetails assigned to Findlocation page");
     }
     InitializeComponent();
     Initialize();
 }
コード例 #11
0
        public async Task DeleteItemAsync(PartyDetails partyDetailsDB)
        {
            try
            {
                var result = await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(databaseId, collectionId, partyDetailsDB.Id));

                if (Items != null && Items.Contains(partyDetailsDB))
                {
                    Items.Remove(partyDetailsDB);
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(@"ERROR {0}", e.Message);
            }
        }
コード例 #12
0
        public PricePopupPage()
        {
            CloseWhenBackgroundIsClicked = true;
            Padding = 20;
            if (CreatePartyViewModel._partyDetails != null)
            {
                partyDetails = CreatePartyViewModel._partyDetails;
            }
            else
            {
                throw new NullReferenceException("No partyDetails assigned to Price Popup page page");
            }

            InitializeComponent();
            //BindingContext = this;
        }
コード例 #13
0
        private async Task ExecuteCreatePartyCommand()
        {
            if (IsBusy)
            {
                return;
            }
            joinButtonLabel = "";
            IsBusy          = true;
            try
            {
                ImageSource partyHeaderSource = partyHeaderImageSource;

                string headerImagePath;

                headerImagePath = await AzureStorage.UploadFileAsync(ContainerType.Image, new MemoryStream(partyHeaderByteArray));

                Debug.WriteLine("AzureStorage Succes");

                //TODO Make sure user information is transferred to theese values
                partyDetails.picture = headerImagePath ?? " ";
                partyDetails.partyId = Guid.NewGuid().ToString();
                partyDetails.userId  = App.UserDetails.userId ?? " ";


                AzurePartyManager manager = AzurePartyManager.DefaultManager;
                var cloudService          = ServiceLocator.Instance.Resolve <ICloudService>();

                ICloudTable <PartyDetails> Table = cloudService.GetTable <PartyDetails>();
                partyDetails = await Table.CreateItemAsync(partyDetails);

                PartyDetails partyDetailsDB = partyDetails;
                await manager.InsertItemAsync(partyDetailsDB);
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"[Upload] Error = {ex.Message}");
            }
            finally
            {
                IsBusy          = false;
                joinButtonLabel = "Party Created!";
                RootPage.instance.GoToDetailPage(MasterDetailPageManager.MapPage);
            }
        }
コード例 #14
0
    public override void ApplyEffect(PartyDetails user, PartyDetails opponent)
    {
        switch (target)
        {
        case Target.User:
            if (Random.Range(0, 100) <= chance)
            {
                user.ModifyHealth(damage);
            }
            break;

        case Target.Opponent:
            if (Random.Range(0, 100) <= chance)
            {
                opponent.ModifyHealth(damage);
            }
            break;
        }
    }
コード例 #15
0
        public void Map()
        {
            // Arrange
            var start = new DateTime(2010, 1, 1);
            var end   = DateUtility.MaxDate;
            var range = new DateRange(start, end);

            var id = new EnergyTrading.Mdm.Contracts.MdmId {
                SystemName = "Test", Identifier = "A"
            };
            var contractDetails = new EnergyTrading.MDM.Contracts.Sample.PartyDetails();
            var contract        = new EnergyTrading.MDM.Contracts.Sample.Party
            {
                Identifiers = new EnergyTrading.Mdm.Contracts.MdmIdList {
                    id
                },
                Details       = contractDetails,
                MdmSystemData = new EnergyTrading.Mdm.Contracts.SystemData {
                    StartDate = start, EndDate = end
                }
            };

            // NB Don't assign validity here, want to prove SUT sets it
            var partyDetails = new PartyDetails();

            var mapping = new PartyMapping();

            var mappingEngine = new Mock <IMappingEngine>();

            mappingEngine.Setup(x => x.Map <EnergyTrading.Mdm.Contracts.MdmId, PartyMapping>(id)).Returns(mapping);
            mappingEngine.Setup(x => x.Map <EnergyTrading.MDM.Contracts.Sample.PartyDetails, PartyDetails>(contractDetails)).Returns(partyDetails);

            var mapper = new PartyMapper(mappingEngine.Object);

            // Act
            var candidate = mapper.Map(contract);

            // Assert
            Assert.AreEqual(1, candidate.Details.Count, "Detail count differs");
            Assert.AreEqual(1, candidate.Mappings.Count, "Mapping count differs");
            Check(range, partyDetails.Validity, "Validity differs");
        }
コード例 #16
0
 void Initialize()
 {
     Title        = Constants.CreatePartyPageTitle;
     partyDetails = new PartyDetails()
     {
         price       = 0,
         ageMin      = 0,
         ageMax      = 0,
         where       = string.Empty,
         when        = DateTime.Now,
         picture     = Constants.picturePlaceholder,
         title       = string.Empty,
         description = Constants.descriptionPlaceholder,
         hostpicture = App.UserDetails.picture
     };
     partyHeaderImageSource = ImageSource.FromFile(partyDetails.picture);
     joinButtonLabel        = "Create Party";
     geoCoder  = new Geocoder();
     positions = new List <Position>();
 }
コード例 #17
0
        public void AddingDetailsTrimsMappingToEntityFinish()
        {
            var start  = new DateTime(2000, 1, 1);
            var finish = DateUtility.Round(SystemTime.UtcNow()).AddDays(3);

            var party = new Party();
            var m1    = new PartyMapping {
                Validity = new DateRange(start, DateTime.MaxValue)
            };

            party.ProcessMapping(m1);

            var d1 = new PartyDetails {
                Validity = new DateRange(start, finish)
            };

            party.AddDetails(d1);

            Assert.AreEqual(finish, m1.Validity.Finish, "Mapping finish differs");
        }
コード例 #18
0
        protected override Party Default()
        {
            var entity = base.Default();
            var system = new SourceSystem {
                Name = "Fred"
            };

            var d = new PartyDetails {
                Party = entity, Name = "Test"
            };

            entity.Details.Add(d);

            var m = new PartyMapping {
                Party = entity, System = system, MappingValue = "A"
            };

            entity.Mappings.Add(m);

            return(entity);
        }
コード例 #19
0
        public async Task <PartyDetails> InsertItemAsync(PartyDetails partyDetailsDB)
        {
            try
            {
                //First insert party in document Db
                var result = await client.CreateDocumentAsync(collectionLink, partyDetailsDB);

                partyDetailsDB.Id = result.Resource.Id;
                if (Items == null)
                {
                    Items = new List <PartyDetails>();
                }
                Items.Add(partyDetailsDB);
                //Then insert party in sql table
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(@"ERROR {0}", e.Message);
            }
            return(partyDetailsDB);
        }
コード例 #20
0
    IEnumerator TurnAdvanceRoutine()
    {
        phase++;
        phase = phase >= EncounterPhase.Count ? 0 : phase;
        PartyDetails forWhomTheTurnTolls = parties[(int)phase];

        yield return(msgManager.AnimateText(forWhomTheTurnTolls.partyName + "'s turn!"));

        yield return(new WaitForSeconds(1));

        if ((int)phase == 1)
        {
            forWhomTheTurnTolls.TakeTurn(parties[0]);
        }
        else
        {
            for (int i = 0; i < optionPanel.transform.childCount; i++)
            {
                optionPanel.transform.GetChild(i).gameObject.GetComponent <Button>().interactable = true;
            }
        }
    }
コード例 #21
0
        public Response SavePartyDetails(PartyDetails obj)
        {
            List <PartyDetails> partyList = new List <PartyDetails>();
            var IsExist = entities.party_details.Where(x => x.partyName == obj.partyName && x.partyType == obj.partyType).ToList();

            if (IsExist.Count == 0)
            {
                party_details partyObj = new party_details();
                partyObj.partyType = obj.partyType;
                partyObj.partyName = obj.partyName;
                partyObj.mobile    = obj.mobile;
                partyObj.telephone = obj.telephone;
                partyObj.address   = obj.address;
                partyObj.city      = obj.city;
                partyObj.pincode   = obj.pincode;
                partyObj.state     = obj.state;
                partyObj.country   = obj.country;
                partyObj.email     = obj.email;
                partyObj.pancard   = obj.pancard;
                partyObj.partyId   = obj.partyId;
                partyObj.gstIn     = obj.gstIn;
                partyObj.createBy  = "Admin";
                partyObj.createdOn = DateTime.Now;
                partyObj.updatedBy = "Admin";
                partyObj.updatedOn = DateTime.Now;
                entities.party_details.Add(partyObj);
                entities.SaveChanges();
                return(new Response {
                    IsSuccess = true, Message = "Data Successfully Inserted "
                });
            }
            else
            {
                return new Response {
                           IsSuccess = false, Message = "Data already exists"
                }
            };
        }
コード例 #22
0
        public void ChangeEndDateConstraintedToEntityValidity()
        {
            var start  = new DateTime(2000, 12, 31);
            var finish = DateUtility.Round(SystemTime.UtcNow().AddDays(5));
            var entity = new Party();

            var s1 = new SourceSystem {
                Name = "Test"
            };
            var d1 = new PartyDetails {
                Validity = new DateRange(start, finish)
            };
            var m1 = new PartyMapping {
                System = s1, MappingValue = "1", Validity = new DateRange(start, DateUtility.MaxDate)
            };

            entity.AddDetails(d1);
            entity.ProcessMapping(m1);

            m1.ChangeEndDate(finish.AddDays(5));

            Assert.AreEqual(finish, m1.Validity.Finish, "Finish differs");
        }
コード例 #23
0
        public Response UpdatePartyDetails(PartyDetails obj)
        {
            List <PartyDetails> partyList = new List <PartyDetails>();
            var IsExist = entities.party_details.Where(x => x.partyId == obj.partyId).ToList();

            if (IsExist.Count != 0)
            {
                var partyObj = entities.party_details.Where(x => x.partyId == obj.partyId).FirstOrDefault();

                partyObj.partyType = obj.partyType;
                partyObj.partyName = obj.partyName;
                partyObj.mobile    = obj.mobile;
                partyObj.telephone = obj.telephone;
                partyObj.address   = obj.address;
                partyObj.city      = obj.city;
                partyObj.pincode   = obj.pincode;
                partyObj.state     = obj.state;
                partyObj.country   = obj.country;
                partyObj.email     = obj.email;
                partyObj.pancard   = obj.pancard;
                partyObj.partyId   = obj.partyId;
                partyObj.gstIn     = obj.gstIn;
                partyObj.updatedBy = "Admin";
                partyObj.updatedOn = DateTime.Now;
                entities.SaveChanges();
                return(new Response {
                    IsSuccess = true, Message = "Data Successfully Updated"
                });
            }
            else
            {
                return new Response {
                           IsSuccess = false, Message = "Updation Error. Contact Administrator"
                }
            };
        }
コード例 #24
0
        public static IIdentifiable Create(string name)
        {
            switch (name)
            {
            case "Broker":
                var broker = new Broker {
                    PartyRoleType = "Broker"
                };
                var brokerDetails = Create <BrokerDetails>();
                broker.Party            = Create <Party>();
                brokerDetails.PartyRole = broker;
                broker.Details.Add(brokerDetails);
                return(broker);

            case "BrokerDetails":
                return(new BrokerDetails
                {
                    Name = "Name" + Guid.NewGuid(),
                    Fax = "01302111111",
                    Phone = "01302222222",
                    Rate = 1.1m
                });

            case "Counterparty":
                var counterparty = new Counterparty {
                    PartyRoleType = "Counterparty"
                };
                var counterpartyDetails = Create <CounterpartyDetails>();
                counterparty.Party            = Create <Party>();
                counterpartyDetails.PartyRole = counterparty;
                counterparty.Details.Add(counterpartyDetails);
                return(counterparty);

            case "CounterpartyDetails":
                return(new CounterpartyDetails
                {
                    Name = "Name" + Guid.NewGuid(),
                    Fax = "01302111111",
                    Phone = "01302222222",
                    ShortName = "sh",
                    //TaxLocation = Create<Location>()
                });

            case "Exchange":
                var exchange = new Exchange {
                    PartyRoleType = "Exchange", Party = Create <Party>()
                };
                var exchangeDetails = Create <ExchangeDetails>();
                exchangeDetails.PartyRole = exchange;
                exchange.Details.Add(exchangeDetails);
                return(exchange);

            case "ExchangeDetails":
                return
                    (new ExchangeDetails
                {
                    Name = "Name" + Guid.NewGuid(),
                    Phone = "118118"
                });


            case "LegalEntity":
                var legalEntity = new LegalEntity {
                    PartyRoleType = "LegalEntity"
                };
                var legalEntityDetails = Create <LegalEntityDetails>();
                legalEntity.Party            = Create <Party>();
                legalEntityDetails.PartyRole = legalEntity;
                legalEntity.Details.Add(legalEntityDetails);
                return(legalEntity);

            case "LegalEntityDetails":
                return(new LegalEntityDetails
                {
                    Name = "Name" + Guid.NewGuid(),
                    RegisteredName = "RegisteredName",
                    RegistrationNumber = "RegistrationNumber",
                    Address = "123 Fake St",
                    Website = "http://test.com",
                    CountryOfIncorporation = "Germany",
                    Email = "*****@*****.**",
                    Fax = "020 1234 5678",
                    Phone = "020 3469 1256",
                    PartyStatus = "Active",
                    CustomerAddress = "456 Wrong Road",
                    InvoiceSetup = "Customer",
                    VendorAddress = "789 Right Road"
                });

            case "Location":
                return(new Location
                {
                    Type = "LocationType" + Guid.NewGuid(),
                    Name = "Location" + Guid.NewGuid(),
                });

            case "Party":
                var partyDetails = Create <PartyDetails>();
                var party        = new Party();
                party.Details.Add(partyDetails);
                partyDetails.Party = party;
                return(party);

            case "PartyDetails":
                var ptDetails = new PartyDetails
                {
                    Name  = "Name" + Guid.NewGuid(),
                    Phone = "020 8823 1234",
                    Fax   = "020 834 1237",
                    Role  = "Trader"
                };
                return(ptDetails);

            case "PartyRole":
                var partyRole = new PartyRole {
                    PartyRoleType = "SomeRole", Party = Create <Party>()
                };
                partyRole.Details.Add(Create <PartyRoleDetails>());
                return(partyRole);

            case "PartyRoleDetails":
                return
                    (new PartyRoleDetails
                {
                    Name = "Name" + Guid.NewGuid(),
                });

            case "Person":
                var personDetails = Create <PersonDetails>();
                var person        = new Person();
                person.Details.Add(personDetails);
                return(person);

            case "PersonDetails":
                var psDetails = new PersonDetails
                {
                    FirstName = "Firstname" + Guid.NewGuid(),
                    LastName  = "Lastname" + Guid.NewGuid(),
                    Email     = "*****@*****.**"
                };
                return(psDetails);

            case "SourceSystem":
                return(new SourceSystem
                {
                    Name = "SourceSystem" + Guid.NewGuid()
                });

            default:
                throw new NotImplementedException("No OM for " + name);
            }
        }
コード例 #25
0
        public void SuccessMatch()
        {
            // Arrange
            var validatorFactory = new Mock <IValidatorEngine>();
            var mappingEngine    = new Mock <IMappingEngine>();
            var repository       = new Mock <IRepository>();
            var searchCache      = new Mock <ISearchCache>();

            var service = new PartyService(validatorFactory.Object, mappingEngine.Object, repository.Object, searchCache.Object);

            // Domain details
            var start  = new DateTime(1999, 12, 31);
            var finish = new DateTime(2020, 1, 1);
            var system = new SourceSystem {
                Name = "Endur"
            };
            var mapping = new PartyMapping
            {
                System       = system,
                MappingValue = "A"
            };
            var details = new PartyDetails
            {
                Name     = "Party 1",
                Validity = new DateRange(start, finish)
            };
            var party = new Party
            {
                Id = 1
            };

            party.AddDetails(details);
            party.ProcessMapping(mapping);

            // Contract details
            var identifier = new EnergyTrading.Mdm.Contracts.MdmId
            {
                SystemName = "Endur",
                Identifier = "A"
            };
            var cDetails = new EnergyTrading.MDM.Contracts.Sample.PartyDetails
            {
                Name = "Party 1"
            };

            mappingEngine.Setup(x => x.Map <PartyMapping, EnergyTrading.Mdm.Contracts.MdmId>(mapping)).Returns(identifier);
            mappingEngine.Setup(x => x.Map <PartyDetails, EnergyTrading.MDM.Contracts.Sample.PartyDetails>(details)).Returns(cDetails);
            validatorFactory.Setup(x => x.IsValid(It.IsAny <MappingRequest>(), It.IsAny <IList <IRule> >())).Returns(true);

            var list = new List <PartyMapping> {
                mapping
            };

            repository.Setup(x => x.Queryable <PartyMapping>()).Returns(list.AsQueryable());

            var request = new MappingRequest
            {
                SystemName = "Endur",
                Identifier = "A",
                ValidAt    = SystemTime.UtcNow(),
                Version    = 1
            };

            // Act
            var response  = service.Map(request);
            var candidate = response.Contract;

            // Assert
            repository.Verify(x => x.Queryable <PartyMapping>());

            Assert.IsTrue(response.IsValid);
            Assert.IsNotNull(candidate, "Contract null");

            mappingEngine.Verify(x => x.Map <PartyMapping, EnergyTrading.Mdm.Contracts.MdmId>(mapping));
            mappingEngine.Verify(x => x.Map <PartyDetails, EnergyTrading.MDM.Contracts.Sample.PartyDetails>(details));

            Assert.AreEqual(2, candidate.Identifiers.Count, "Identifier count incorrect");
            // NB This is order dependent
            Assert.AreSame(identifier, candidate.Identifiers[1], "Different identifier assigned");
            Assert.AreSame(cDetails, candidate.Details, "Different details assigned");
            Assert.AreEqual(start, candidate.MdmSystemData.StartDate, "Start date differs");
            Assert.AreEqual(finish, candidate.MdmSystemData.EndDate, "End date differs");
        }
コード例 #26
0
        public IEnumerable <MappingGridModel> GetIngestionGridDetails()
        {
            List <MappingGridModel> lstMasterTableDetails = new List <MappingGridModel>();

            try
            {
                using (_dbContext = string.IsNullOrEmpty(_connectionString) ? _dbContext : new ZionContext(_connectionString))
                {
                    lstMasterTableDetails = (from map in _dbContext.LandingToCoreMapDetails
                                             join L in _dbContext.LandingTableDetails on map.LandingDetailId equals L.LandingDetailId
                                             join ds in _dbContext.DatasetMaster on map.DatasetId equals ds.DatasetId
                                             join inf in _dbContext.InterfaceMaster on ds.InterfaceId equals inf.InterfaceId
                                             join p in _dbContext.PartyAcctDetails on inf.PartyId equals p.PartyId into PartyDetails
                                             from party in PartyDetails.DefaultIfEmpty()
                                             join c in _dbContext.CustomerAcctDetails on inf.CustomerId equals c.CustomerId into CustDetails
                                             from customer in CustDetails.DefaultIfEmpty()
                                             select new MappingGridModel
                    {
                        DatasetId = map.DatasetId,
                        DatasetName = ds.DatasetName,
                        TableName = L.TableName,
                        InterfaceId = inf.InterfaceId,
                        InterfaceName = inf.InterfaceName,
                        CustomerId = (customer != null) ? customer.CustomerId : -1,
                        CustomerName = ((customer != null && customer.CustomerName != null) ? customer.CustomerName : string.Empty),
                        PartyId = (party != null) ? party.PartyId : -1,                                                     //((party != null && party.PartyId != null) ? party.PartyId : null),
                        PartyName = ((party != null && party.PartyName != null) ? party.PartyName : string.Empty),
                        PartyType = ((party != null && party.PartyType != null) ? party.PartyType : string.Empty),
                        CreatedDate = map.CreatedDate,
                        UpdatedDate = map.UpdatedDate,
                        Status = map.Status
                    }
                                             ).Distinct().ToList();

                    //DateTime? createdDate = null;
                    //DateTime? updatedDate = null;
                    //if (lstMasterTableDetails.Count > 0)
                    //{
                    //    createdDate = lstMasterTableDetails[0].CreatedDate;
                    //    updatedDate = lstMasterTableDetails[0].UpdatedDate;
                    //}
                    List <MappingGridModel> lstTempTableDetails = (from map in _dbContext.LandingToCoreTempDetails
                                                                   join L in _dbContext.LandingTableDetails on map.LandingDetailId equals L.LandingDetailId
                                                                   join ds in _dbContext.DatasetMaster on map.DatasetId equals ds.DatasetId
                                                                   join inf in _dbContext.InterfaceMaster on ds.InterfaceId equals inf.InterfaceId
                                                                   join p in _dbContext.PartyAcctDetails on inf.PartyId equals p.PartyId into PartyDetails
                                                                   from party in PartyDetails.DefaultIfEmpty()
                                                                   join c in _dbContext.CustomerAcctDetails on inf.CustomerId equals c.CustomerId into CustDetails
                                                                   from customer in CustDetails.DefaultIfEmpty()
                                                                   select new MappingGridModel
                    {
                        DatasetId = map.DatasetId,
                        DatasetName = ds.DatasetName,
                        TableName = L.TableName,
                        InterfaceId = inf.InterfaceId,
                        InterfaceName = inf.InterfaceName,
                        CustomerId = (customer != null) ? customer.CustomerId : -1,
                        CustomerName = ((customer != null && customer.CustomerName != null) ? customer.CustomerName : string.Empty),
                        PartyId = (party != null) ? party.PartyId : -1,                                               //((party != null && party.PartyId != null) ? party.PartyId : null),
                        PartyName = ((party != null && party.PartyName != null) ? party.PartyName : string.Empty),
                        PartyType = ((party != null && party.PartyType != null) ? party.PartyType : string.Empty),
                        CreatedDate = map.CreatedDate,
                        UpdatedDate = map.UpdatedDate,
                        Status = map.Status
                    }
                                                                   ).Distinct().ToList();

                    lstTempTableDetails.ForEach(row =>
                    {
                        int count = lstMasterTableDetails.Where(x => x.DatasetId == row.DatasetId).Count();
                        if (count <= 0)
                        {
                            lstMasterTableDetails.Add(row);
                        }
                    });
                }
            }
            catch
            {
                throw;
            }
            return((from map in lstMasterTableDetails
                    let updated = map.UpdatedDate ?? map.CreatedDate
                                  orderby updated descending
                                  select map).ToList());
        }
コード例 #27
0
 public virtual void ApplyEffect(PartyDetails user, PartyDetails opponent)
 {
 }
コード例 #28
0
 public virtual void TakeTurn(PartyDetails opponent)
 {
 }
コード例 #29
0
    public override void TakeTurn(PartyDetails opponent)
    {
        /*
         * Opponent's attacks are all the same as the Player's attacks, just named differently for theming
         *
         * 0 - Debug        regular attack
         * 1 - Break        healing move
         * 2 - Pop Quiz     bonus damage
         * 3 - Teach        bonus healing
         */
        string abilUsed  = "";
        int    soundUsed = 0;

        int   det  = health - opponent.health;
        float rand = Random.Range(0.0f, 100.0f);

        if (det < -10)
        {
            if (rand <= 30)
            {
                actionOptions[1].UseAbility(this, opponent);
                abilUsed  = actionOptions[1].abilityName;
                soundUsed = actionOptions[1].actionSFX;
            }
            else
            {
                actionOptions[3].UseAbility(this, opponent);
                abilUsed  = actionOptions[3].abilityName;
                soundUsed = actionOptions[3].actionSFX;
            }
        }
        else if (det >= -9 && det <= -4)
        {
            if (rand <= 25)
            {
                actionOptions[1].UseAbility(this, opponent);
                abilUsed  = actionOptions[1].abilityName;
                soundUsed = actionOptions[1].actionSFX;
            }
            else
            {
                actionOptions[3].UseAbility(this, opponent);
                abilUsed  = actionOptions[3].abilityName;
                soundUsed = actionOptions[3].actionSFX;
            }
        }
        else if (det >= 3)
        {
            actionOptions[2].UseAbility(this, opponent);
            abilUsed  = actionOptions[2].abilityName;
            soundUsed = actionOptions[2].actionSFX;
        }
        else
        {
            if (rand <= 30)
            {
                actionOptions[0].UseAbility(this, opponent);
                abilUsed  = actionOptions[0].abilityName;
                soundUsed = actionOptions[0].actionSFX;
            }
            else if (rand <= 60)
            {
                actionOptions[3].UseAbility(this, opponent);
                abilUsed  = actionOptions[3].abilityName;
                soundUsed = actionOptions[3].actionSFX;
            }
            else if (rand <= 80)
            {
                actionOptions[1].UseAbility(this, opponent);
                abilUsed  = actionOptions[1].abilityName;
                soundUsed = actionOptions[1].actionSFX;
            }
            else
            {
                actionOptions[2].UseAbility(this, opponent);
                abilUsed  = actionOptions[2].abilityName;
                soundUsed = actionOptions[2].actionSFX;
            }
        }

        OnTurnTaken.Invoke(partyName, abilUsed, soundUsed);
    }