Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        CombatEntity          = EntityFactory.Create <CombatEntity>();
        CombatEntity.Position = transform.position;
        CombatEntity.AddComponent <MotionComponent>();
        CombatEntity.ListenActionPoint(ActionPointType.PostReceiveDamage, OnReceiveDamage);
        CombatEntity.ListenActionPoint(ActionPointType.PostReceiveCure, OnReceiveCure);
        {
            CombatEntity.ListenActionPoint(ActionPointType.PostReceiveStatus, OnReceiveStatus);
            CombatEntity.Subscribe <RemoveStatusEvent>(OnRemoveStatus).AsCoroutine();
        }

        var config = Resources.Load <StatusConfigObject>("StatusConfigs/Status_Tenacity_坚韧");
        var Status = CombatEntity.AttachStatus <StatusTenacity>(config);

        Status.Caster = CombatEntity;
        Status.TryActivateAbility();
    }
Ejemplo n.º 2
0
        public void WhenKeys_ShouldGeneratePublicVirtualPropertyWithKeyAttribute()
        {
            // Arrange
            var definition = _fixture.Create <Definition>();

            definition.Keys.Clear();
            definition.Keys.Add("Id", typeof(Guid));
            definition.Columns.Add("Id", typeof(Guid));
            var sut = new EntityFactory();

            // Act
            var actual = sut.Create(definition);

            // Assert
            var code = actual.NormalizeWhitespace().ToString();

            code.Should().Contain($"[Key]\r\n    public virtual System.Guid Id");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// An enumerable that can return a range of T between index and the
        /// count provided.
        /// </summary>
        /// <param name="index">
        /// First index of the range required.
        /// </param>
        /// <param name="count">
        /// Number of elements to return.
        /// </param>
        /// <returns>
        /// An enumerator for the list.
        /// </returns>
        public IEnumerable <T> GetRange(int index, int count)
        {
            var reader = _dataSet.Pool.GetReader();

            try
            {
                reader.BaseStream.Position =
                    Header.StartPosition + (EntityFactory.GetLength() * index);
                for (int i = 0; i < count; i++)
                {
                    yield return((T)EntityFactory.Create(_dataSet, index, reader));
                }
            }
            finally
            {
                _dataSet.Pool.Release(reader);
            }
        }
 /// <summary>
 /// Adds the contact to account.
 /// </summary>
 /// <param name="sourceLead">The source lead.</param>
 /// <param name="accountID">The account ID.</param>
 private void AddContactToAccount(ILead sourceLead, string accountID)
 {
     if (accountID != null)
     {
         var account = EntityFactory.GetById <IAccount>(accountID);
         if (account != null)
         {
             IContact newContact = EntityFactory.Create <IContact>();
             sourceLead.ConvertLeadToContact(newContact, account, "Add Contact to this Account");
             sourceLead.ConvertLeadAddressToContactAddress(newContact);
             sourceLead.ConvertLeadAddressToAccountAddress(account);
             sourceLead.MergeLeadWithAccount(account, "ACCOUNTWINS", newContact);
             account.Contacts.Add(newContact);
             account.Save();
             Response.Redirect(String.Format("Contact.aspx?entityId={0}", (newContact.Id)));
         }
     }
 }
        public static void OnLoad1Step(IInsertQuote form, EventArgs args)
        {
            IQuote quote = form.CurrentEntity as IQuote;

            if (quote == null)
            {
                return;
            }
            var srv = ApplicationContext.Current.Services.Get <ISelectionService>();

            if (srv != null)
            {
                ISelectionContext sc = srv.GetSelectionContext("QuickInsertAccountContact");
                if (sc != null)
                {
                    var sels = sc.GetSelectedIds();
                    if (sels.Count > 0)
                    {
                        string   newContactId = sels[0];
                        IContact newContact   = EntityFactory.GetById <IContact>(newContactId);
                        IAccount newAccount   = newContact.Account;
                        quote.Account         = newAccount;
                        quote.AccountManager  = newAccount.AccountManager;
                        quote.BillingContact  = newContact;
                        quote.ShippingContact = newContact;
                        quote.BillToName      = newContact.NameLF;
                        quote.ShipToName      = newContact.NameLF;

                        if (quote.BillingAddress == null)
                        {
                            quote.BillingAddress = EntityFactory.Create <IQuoteAddress>();
                        }
                        quote.SetQuoteBillingAddress(newContact.Address);

                        if (quote.ShippingAddress == null)
                        {
                            quote.ShippingAddress = EntityFactory.Create <IQuoteAddress>();
                        }
                        quote.SetQuoteShippingAddress(newContact.Address);
                        srv.SetSelectionContext("QuickInsertAccountContact", null);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public void CreateDeliveryItem(string subject, string body, IDeliverySystem ds, IList <string> targets)
        {
            IDeliveryItem deliveryItem = EntityFactory.Create <IDeliveryItem>();

            deliveryItem.Subject        = subject;
            deliveryItem.Body           = body;
            deliveryItem.Status         = DeliverySystems.DeliveryItemStatuses.ToBeProcessed;
            deliveryItem.DeliverySystem = ds;

            foreach (string target in targets)
            {
                IDeliveryItemTarget t = EntityFactory.Create <IDeliveryItemTarget>();
                t.DeliveryItem = deliveryItem;
                t.Address      = target;
                t.Type         = DeliverySystems.DeliveryItemTargetTypes.To;
                deliveryItem.DeliveryItemTargets.Add(t);
            }
            deliveryItem.Save();
        }
        public void GetEnvironmentWithSpecificProjectTest()
        {
            var project2    = EntityFactory.Create(() => Instance.Create.Project("other", SandboxProject.ParentProject, DateTime.Now, SandboxSchedule));
            var environment = CreateEnvironment(EnvironmentName);
            var filter      = new EnvironmentFilter();

            filter.Project.Add(SandboxProject);

            var environments = Instance.Get.Environments(filter);

            CollectionAssert.Contains(environments, environment);

            filter = new EnvironmentFilter();
            filter.Project.Add(project2);

            environments = Instance.Get.Environments(filter);

            Assert.AreEqual(0, environments.Count);
        }
Ejemplo n.º 8
0
        protected T FindOrCreate <T>(Expression <Func <T, bool> > pred, bool returnExisting)
            where T : class, new()
        {
            var entity = EntityFactory.Find(pred, EntitySource);

            if (entity != null)
            {
                if (!returnExisting)
                {
                    return(null);
                }
                EntityFactory.Attach(entity);
                return(entity);
            }
            else
            {
                return(EntityFactory.Create <T>());
            }
        }
Ejemplo n.º 9
0
        protected override async ETTask Run(Session session, PlayerEnterRoom message)
        {
            Room room = Game.Scene.GetComponent <Room>();

            // 创建Player
            Player p = EntityFactory.Create <Player, long, Room>(Game.Scene, message.Info.UId, room);

            p.AddComponent <HandCardsComponent>();
            p.AddComponent <TeamComponent>();

            // Player信息
            var playerInfo = p.AddComponent <PlayerBaseInfo>();

            playerInfo.UId      = message.Info.UId;
            playerInfo.NickName = message.Info.NickName;

            // 进入房间
            p.SeatIndex = message.SeatIndex;
            p.IsReady   = message.Ready;
            room.Enter(p);
        }
    /// <summary>
    /// Handles the Click event of the cmdAssignImportHistory control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void cmdAssignImportHistory_Click(object sender, EventArgs e)
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        WebPortalPage portalPage = Page as WebPortalPage;

        if (portalPage != null)
        {
            IImportHistory importHistory = EntityFactory.Create <IImportHistory>();
            importHistory.Status         = GetLocalResourceObject("importStatus_Processing").ToString();
            importHistory.ProcessedCount = 0;
            importHistory.Save();
            importManager.ImportHistory = importHistory;
            portalPage.ClientContextService.CurrentContext.Remove("ImportHistoryId");
            portalPage.ClientContextService.CurrentContext.Add("ImportHistoryId", importHistory.Id.ToString());
        }
    }
Ejemplo n.º 11
0
        private InvoiceItem Map(InvoiceXmlItem dto)
        {
            var entity = EntityFactory.Create <InvoiceItem>();

            entity.ProductCode        = dto.KodTovara;
            entity.ProductName        = dto.Tovar;
            entity.Manufacturer       = FindOrCreateOrganization(dto.Izgotovitel, dto.StranaIzgotovitelja);
            entity.Quantity           = dto.Kolichestvo;
            entity.ManufacturerPrice  = dto.CenaIzg;
            entity.StateRegistryPrice = dto.CenaGR;
            entity.SupplierMarkupRate = dto.NacenOpt / 100;
            //dto.CenaOpt
            //dto.SummaOpt
            entity.ValueAddedTaxRate = dto.StavkaNDS / 100;
            //dto.SummaNDS
            //dto.SummaOptVklNDS
            entity.Ean13 = dto.EAN13;
            entity.CustomsDeclarationNumber = dto.GTD;
            entity.Series.AddRange(dto.Serii.Select(Map));
            return(entity);
        }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the ddLSalesProcess control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void ddLSalesProcess_SelectedIndexChanged(object sender, EventArgs e)
    {
        string          opportunityId = this.EntityContext.EntityID.ToString();
        string          pluginID      = ddLSalesProcess.SelectedItem.Value;
        ISalesProcesses salesProcess  = EntityFactory.Create <ISalesProcesses>();

        salesProcess.InitSalesProcess(pluginID, opportunityId);
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        this.UpdateSnapShot();
        if (_salesProcess != null)
        {
            IList <ISalesProcessAudit> list = _salesProcess.GetSalesProcessAudits();
            LoadStagesDropDown(list);
        }
        else
        {
            LoadStagesDropDown(null);
        }
        refresher.RefreshAll();
    }
Ejemplo n.º 13
0
        public void Setup()
        {
            var data = new CardData()
            {
                Name = "Test", DataId = 1
            };

            data.Stats.Add(new StatInfo("Health", 1));
            data.Keywords.Add(new KeywordInfo("Charge", 1));
            CardDatabase.GetInstance().AddItem(data);

            testEntity   = EntityFactory.Create(typeof(Card), TestDefaults.MainPlayer, 1);
            clonedEntity = testEntity.Clone();
            testCard     = testEntity.Clone().AsActor().AsCard();

            notEqualEntityDifStats = EntityFactory.Create(typeof(Card), TestDefaults.MainPlayer, 1);
            notEqualEntityDifStats.AsActor().AsCard().ChangeStat("Health", new Modifier(1));
            notEqualEntityDifKeywords = testEntity.Clone();
            notEqualEntityDifKeywords
            .AsActor().AsCard().AddKeyword(new Keyword(new KeywordInfo("kwd", 2)));
        }
Ejemplo n.º 14
0
        public static void CheckAccContactInfoStep(IAccNewsletter accnewsletter)
        {
            if (!String.IsNullOrEmpty(accnewsletter.Email))
            {
                IQueryable         qry = EntityFactory.GetRepository <IAccContactInfo>() as IQueryable;
                IExpressionFactory ep  = qry.GetExpressionFactory();
                ICriteria          crt = qry.CreateCriteria();

                crt.Add(ep.Eq("AccountId", accnewsletter.Accountid));
                crt.Add(ep.Eq("ContactValue", accnewsletter.Email));

                IList <IAccContactInfo> lst = crt.List <IAccContactInfo>();
                if (lst.Count > 0)
                {
                    foreach (IAccContactInfo vEntity in lst)
                    {
                        vEntity.Comments = "Рассылка сведений об операциях";
                        vEntity.IsActual = true;
                        vEntity.Save();
                    }
                }
                else
                {
                    IAccContactInfo com = EntityFactory.Create <IAccContactInfo>();
                    com.AccountId = accnewsletter.Accountid;
                    com.IsActual  = true;
                    if (accnewsletter.DeliveryType.Contains("E-mail"))
                    {
                        com.ContactType = "E-mail для рассылки";
                    }
                    else
                    {
                        com.ContactType = "Телефон для рассылки";
                    }
                    com.Comments     = "Рассылка сведений об операциях";
                    com.ContactValue = accnewsletter.Email;
                    com.Save();
                }
            }
        }
Ejemplo n.º 15
0
        //---------------------------------------------------------------------------

        public Stage(int seed)
        {
            m_Rand    = (seed == 0 ? new Random() : new Random(seed));
            Rooms     = new List <Room>();
            Corridors = new List <Corridor>();
            Corners   = new List <Corner>();

            for (int i = 0; i < 40; i++)
            {
                Rooms.Add(CreateRoom(Size));
            }
            SpreadRooms(Rooms);
            ConnectRooms(Rooms);
            FindCorners(Rooms, Corridors);

            AreaManager.Get().Reset(Bounds.Width, Bounds.Height);
            foreach (Room room in Rooms)
            {
                Area area = EntityFactory.Create <Area>("Area");
                area.Collider.AddRect(room.Bounds.X, room.Bounds.Y, room.Bounds.Width, room.Bounds.Height);
            }
        }
Ejemplo n.º 16
0
        protected T FindOrCreate <T>(string name)
            where T : class, INamedEntity, new()
        {
            if (IsEmptyName(name))
            {
                return(null);
            }
            name = name.Trim();

            var entity = EntityFactory.Find <T>(e =>
                                                e.Name.ToUpper().Equals(name.ToUpper(), StringComparison.OrdinalIgnoreCase),
                                                EntitySource);

            if (entity != null)
            {
                return(entity);
            }

            entity      = EntityFactory.Create <T>();
            entity.Name = name;
            return(entity);
        }
Ejemplo n.º 17
0
        public void Setup()
        {
            var data = new CardData {
                Name = "Test", DataId = 1
            };

            CardDatabase.GetInstance().AddItem(data);
            testEntity = EntityFactory.Create(typeof(Card), TestDefaults.MainPlayer);

            testZone = new Zone <Card> {
                MaxSize = 1
            };
            testZone.OnItemAdded += delegate
            {
                mustBeTrue = true;
            };
            testZone.OnItemRemoved += delegate
            {
                mustBeTrue2 = true;
            };
            testZone.Add(testEntity.AsActor().AsCard());
        }
Ejemplo n.º 18
0
    void Start()
    {
        Player player = EntityFactory.Create <Player, string>("model");

        Game.Scene.AddChild(player);
        InputComponent input = ComponentFactory.CreateWithEntity <InputComponent, string, string>(Game.Scene, "GameInputControl", "KeyBordControl");

        input.onStarted += (ctx) =>
        {
            player.GetComponent <Live2dComponent>().PlayAnimation("Walk");
        };

        input.onPerformed += (ctx) =>
        {
            player.GetComponent <Live2dComponent>().PlayAnimation("Run");
        };

        input.onCanceled += (ctx) =>
        {
            player.GetComponent <Live2dComponent>().PlayAnimation("Idle");
        };
    }
Ejemplo n.º 19
0
    // Start is called before the first frame update
    void Start()
    {
        Instance     = this;
        CombatEntity = EntityFactory.Create <CombatEntity>();
        CombatEntity.AddComponent <SkillPreviewComponent>();
        //CombatEntity.GetComponent<MotionComponent>().Enable = false;

        SkillConfigObject config   = Resources.Load <SkillConfigObject>("SkillConfigs/Skill_1001_黑火球术");
        SkillAbility      abilityA = CombatEntity.AttachSkill <Skill1001Entity>(config);

        CombatEntity.BindSkillInput(abilityA, KeyCode.Q);

        config   = Resources.Load <SkillConfigObject>("SkillConfigs/Skill_1002_炎爆");
        abilityA = CombatEntity.AttachSkill <Skill1002Entity>(config);
        CombatEntity.BindSkillInput(abilityA, KeyCode.W);

        config   = Resources.Load <SkillConfigObject>("SkillConfigs/Skill_1004_血红激光炮");
        abilityA = CombatEntity.AttachSkill <Skill1004Ability>(config);
        CombatEntity.BindSkillInput(abilityA, KeyCode.E);

        AnimTimer.MaxTime = AnimTime;
    }
Ejemplo n.º 20
0
        public NewsDocType()
        {
            // Define a name and an alias for the doctype
            // Setup<TAllowedType> is an extension method declared on EntityFactory
            this.Setup("news", "News");

            // Create a new tab group
            var newsGroup = EntityFactory.Create <AttributeGroupDefinition>("newsdata", "News Data");

            base.AttributeSchema.AttributeGroupDefinitions.Add(newsGroup);


            // Create a serialization type for persisting this to the repository
            var stringSerializer = EntityFactory.Create <StringSerializationType>("string", "String");

            stringSerializer.DataSerializationType = DataSerializationTypes.String;

            // Create a data type
            var textInputField = EntityFactory.Create <AttributeTypeDefinition>("textInputField", "Text Input Field");

            // Create a new property with that data type in our tab group
            var bodyText = EntityFactory.CreateAttributeIn <AttributeDefinition>("bodyText", "Body Text", textInputField,
                                                                                 stringSerializer, newsGroup);


            // Create a data type
            var pictureInputField = EntityFactory.Create <AttributeTypeDefinition>("pictureInputField",
                                                                                   "Picture Input Field");

            // Create a new property with that data type in our tab group
            var image = EntityFactory.CreateAttributeIn <AttributeDefinition>("image", "Image", pictureInputField,
                                                                              stringSerializer, newsGroup);


            // Specify that only an Article can be a child of a News item
            var articleDocType = new ArticleDocType();

            base.GraphSchema.PermittedDescendentTypes.Add(articleDocType);
        }
Ejemplo n.º 21
0
    protected void btnConvert_Click(object sender, EventArgs e)
    {
        IContact            newContact        = EntityFactory.Create <IContact>();
        IAccount            newAccount        = EntityFactory.Create <IAccount>();
        ILeadHistory        newHistory        = EntityFactory.Create <ILeadHistory>();
        ILeadAddressHistory newAddressHistory = EntityFactory.Create <ILeadAddressHistory>();

        newAddressHistory.LeadHistory = newHistory;
        newHistory.Addresses.Add(newAddressHistory);

        {
            ILead curLead = BindingSource.Current as ILead;
            if (curLead != null)
            {
                accountID = ((IAccount)dtsAccounts.Current).Id.ToString();
                if (accountID != null)
                {
                    IList <IAccount> selectedAccount = EntityFactory.GetRepository <IAccount>().FindByProperty("Id", accountID);
                    if (selectedAccount != null)
                    {
                        foreach (IAccount account in selectedAccount)
                        {
                            curLead.ConvertLeadToContact(newContact, account, GetLocalResourceObject("chkAddContacts.Text").ToString());

                            curLead.ConvertLeadAddressToContactAddress(newContact);
                            curLead.ConvertLeadAddressToAccountAddress(account);

                            curLead.MergeLeadWithAccount(account, GetLocalResourceObject("ExistingAccountwins.Text").ToString(), newContact);

                            account.Save();

                            Response.Redirect(string.Format("Contact.aspx?entityId={0}", (newContact.Id)));
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 22
0
    /// <summary>
    /// Adds the contact to account.
    /// </summary>
    /// <param name="sourceLead">The source lead.</param>
    /// <param name="accountID">The account ID.</param>
    private void AddContactToAccount(ILead sourceLead, string accountID)
    {
        if (accountID == null)
        {
            return;
        }
        IList <IAccount> selectedAccount = EntityFactory.GetRepository <IAccount>().FindByProperty("Id", accountID);

        if (selectedAccount != null)
        {
            foreach (IAccount account in selectedAccount)
            {
                IContact newContact = EntityFactory.Create <IContact>();
                sourceLead.ConvertLeadToContact(newContact, account, "Add Contact to this Account");
                sourceLead.ConvertLeadAddressToContactAddress(newContact);
                sourceLead.ConvertLeadAddressToAccountAddress(account);
                sourceLead.MergeLeadWithAccount(account, "ACCOUNTWINS", newContact);
                account.Contacts.Add(newContact);
                account.Save();
                Response.Redirect(String.Format("Contact.aspx?entityId={0}", (newContact.Id)));
            }
        }
    }
Ejemplo n.º 23
0
        //---------------------------------------------------------------------------

        private static Pickup Create(string name, Vector3 location, Vector3 force)
        {
            Pickup pickup = EntityFactory.Create <Pickup>(string.Format("{0}Pickup", name));

            pickup.AddComponent <TransformComponent>().Init(location);

            PhysicsComponent physics = pickup.AddComponent <PhysicsComponent>();

            physics.Init(BodyType.Dynamic, 0.97f, 2.0f);

            CircleColliderComponent collider = pickup.AddComponent <CircleColliderComponent>();

            collider.Init(25, BodyType.Dynamic);
            collider.SetCollidesWith(ECollisionCategory.Stage);
            collider.SetCollisionCategory(ECollisionCategory.Pickup);
            collider.SetRestitution(0.3f);
            //collider.SetSensor(true);

            physics.ApplyForce(force, true);

            pickup.AddComponent <DespawnComponent>();
            return(pickup);
        }
        public void CreateAssets()
        {
            NewSandboxProject();
            sandboxProject = SandboxProject;

            andre = EntityFactory.CreateMember("Member 1");

            epic1 = EntityFactory.CreateEpic("Epic 1", sandboxProject);
            epic2 = EntityFactory.CreateEpic("Epic 2", sandboxProject);

            var childEpic = EntityFactory.CreateChildEpic(epic2);

            childEpic.Name = "Son of an Epic";
            childEpic.Save();

            epic1.Owners.Add(andre);
            epic1.Source.CurrentValue = "Customer";
            epic1.Risk              = 5;
            epic1.Value             = 20;
            epic1.Swag              = 20;
            epic1.Type.CurrentValue = "New Feature";
            epic1.Save();

            epic2.Priority.CurrentValue = "High";
            epic2.Source.CurrentValue   = "Sales";
            epic2.Reference             = "Find Me";
            epic2.Risk  = 10;
            epic2.Value = 80;
            epic2.Swag  = 30;
            epic2.Save();

            var story1 = EntityFactory.Create(epic1.GenerateChildStory);

            story1.Reference = "Find Me";
            story1.Customer  = andre;
            story1.Save();
        }
Ejemplo n.º 25
0
        private void RecordForContact(IMailQueue mail)
        {
            if (string.IsNullOrEmpty(mail.RecordForContactId))
            {
                return;
            }

            var contact = EntityFactory.GetById <IContact>(mail.RecordForContactId);

            if (contact == null)
            {
                return;
            }

            var user = EntityFactory.GetById <IUser>(mail.CreateUser);

            var note = EntityFactory.Create <IHistory>();

            note.AccountId     = contact.Account.Id.ToString();
            note.AccountName   = contact.Account.AccountName;
            note.ContactId     = contact.Id.ToString();
            note.ContactName   = contact.FullName;
            note.Type          = HistoryType.atEMail;
            note.UserId        = user?.Id.ToString() ?? "ADMIN";
            note.UserName      = user?.UserInfo.NameLF ?? "Administrator";
            note.Description   = mail.Subject;
            note.Result        = "Completed";
            note.StartDate     = DateTime.Now;
            note.Timeless      = true;
            note.Duration      = 1;
            note.Category      = "E-mail";
            note.CompletedDate = note.StartDate;
            note.CompletedUser = user?.Id.ToString() ?? "ADMIN";
            note.Notes         = (mail.Body.Length > 255 ? mail.Body.Substring(0, 255) : mail.Body);
            note.LongNotes     = mail.Body;
            note.Save();
        }
    /// <summary>
    /// Handles the TextChanged event of the txtQualificationDescription* controls, used to update the corresponding LeadQualification entity.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void txtQualificationDescription_TextChanged(object sender, EventArgs e)
    {
        TextBox tb = sender as TextBox;

        if (tb == null)
        {
            return;
        }
        string id = tb.Attributes[cQualificationId];

        if (!string.IsNullOrEmpty(id))
        {
            IQualification qualification = EntityFactory.GetById <IQualification>(id);
            if (qualification != null)
            {
                ILead lead = GetCurrentLead();
                if (lead != null)
                {
                    ILeadQualification leadQual = GetLeadQualification(lead, qualification);
                    if (leadQual != null)
                    {
                        leadQual.Notes = tb.Text;
                        leadQual.Save();
                    }
                    else
                    {
                        ILeadQualification newQual = EntityFactory.Create <ILeadQualification>();
                        newQual.Lead          = lead;
                        newQual.Qualification = qualification;
                        newQual.Notes         = tb.Text;
                        newQual.Save();
                    }
                }
            }
        }
    }
Ejemplo n.º 27
0
    /// <summary>
    /// Starts the import process inside its own thread.
    /// </summary>
    public void StartImportProcess()
    {
        ImportManager importManager = Page.Session["importManager"] as ImportManager;

        if (importManager == null)
        {
            return;
        }
        try
        {
            SetImportSourceValue();
            AddJob(importManager);
            AddCrossReferenceMananager(importManager);

            WebPortalPage portalPage = Page as WebPortalPage;
            if (portalPage != null)
            {
                IImportHistory importHistory = EntityFactory.Create <IImportHistory>();
                importHistory.Status         = GetLocalResourceObject("importStatus_Processing").ToString();
                importHistory.ProcessedCount = 0;
                importHistory.Save();
                lblHeader.Text               = GetLocalResourceObject("lblHeader_ProcessStarted.Caption").ToString();
                lblImportNumber.Visible      = true;
                lnkImportHistoryCaption.Text = String.Format(" {0}-{1}", importHistory.Alternatekeyprefix, importHistory.Alternatekeysuffix);
                lnkImportHistory.HRef        = String.Format("..\\..\\ImportHistory.aspx?entityid='{0}'&modeid=Detail", importHistory.Id);
                lblImportLeadsWizard.Visible = true;
                importManager.ImportHistory  = importHistory;
                portalPage.ClientContextService.CurrentContext.Remove("ImportHistoryId");
                portalPage.ClientContextService.CurrentContext.Add("ImportHistoryId", importHistory.Id.ToString());
            }
        }
        catch (Exception ex)
        {
            log.Error("The call to StepProcessRequest.StartImportProcess() failed", ex);
        }
    }
Ejemplo n.º 28
0
        protected override async ETTask Run(Session session, PlayerInfoRefresh message)
        {
            PlayerBaseInfo info = null;

            // 创建大厅玩家
            if (LobbyPlayer.Ins == null)
            {
                LobbyPlayer lobbyPlayer = EntityFactory.Create <LobbyPlayer>(Game.Scene);
                info = lobbyPlayer.AddComponent <PlayerBaseInfo>();
            }
            else
            {
                info = LobbyPlayer.Ins.GetComponent <PlayerBaseInfo>();
            }

            info.UId      = message.Info.UId;
            info.NickName = message.Info.NickName;
            info.RoomCard = message.Info.RoomCard;
            info.Coin     = message.Info.Coin;

            LobbyPlayer.Ins.OnLobbyPlayerInfoChanged();

            await Task.CompletedTask;
        }
    /// <summary>
    /// Handles the RowCommand event of the LeadMarketing control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewCommandEventArgs"/> instance containing the event data.</param>
    protected void LeadMarketing_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        ITargetResponse targetResponse = null;
        string          targetId       = String.Empty;
        string          responseId     = String.Empty;

        try
        {
            int rowIndex = Convert.ToInt32(e.CommandArgument);
            targetId   = grdLeadMarketing.DataKeys[rowIndex].Values[0].ToString();
            responseId = grdLeadMarketing.DataKeys[rowIndex].Values[1].ToString();
            if (!string.IsNullOrEmpty(responseId))
            {
                targetResponse = EntityFactory.GetRepository <ITargetResponse>().Get(responseId);
            }
        }
        catch
        {
        }

        switch (e.CommandName.ToUpper())
        {
        case "EDIT":
            if (String.IsNullOrEmpty(targetId))
            {
                AddResponseAndTarget();
            }
            else
            {
                if (targetResponse == null)
                {
                    targetResponse = EntityFactory.Create <ITargetResponse>();
                    ICampaignTarget target = EntityFactory.GetRepository <ICampaignTarget>().Get(targetId);
                    targetResponse.Campaign       = target.Campaign;
                    targetResponse.CampaignTarget = target;
                }
                ShowResponseView(targetResponse);
            }
            break;

        case "DELETE":
            if (targetResponse != null)
            {
                ICampaignTarget campaignTarget = targetResponse.CampaignTarget;
                if (campaignTarget.TargetResponses.Count <= 1)
                {
                    campaignTarget.Status = GetLocalResourceObject("TargetStatus_Removed").ToString();
                }
                campaignTarget.TargetResponses.Remove(targetResponse);
                targetResponse.Delete();
                LoadMarketing();
            }
            else
            {
                RemoveTargetAssociation(targetId);
            }
            break;

        case "REMOVE":
            RemoveTargetAssociation(targetId);
            break;

        case "SORT":
            break;
        }
    }
Ejemplo n.º 30
0
 public static FUILevelPage Create(Entity domain, GObject go)
 {
     return(EntityFactory.Create <FUILevelPage, GObject>(domain, go));
 }
Ejemplo n.º 31
0
        private Entity ReadEntity(EntityFactory factory)
        {
            string[] inputs = Console.ReadLine().Split(' ');

            int id = int.Parse(inputs[0]);
            int ownerId = int.Parse(inputs[1]);
            var entity = factory.Create(id, ownerId);

            entity.Radius = float.Parse(inputs[2]);
            entity.Position = new Position(double.Parse(inputs[3]), double.Parse(inputs[4]));
            entity.Speed = new Velocity(double.Parse(inputs[5]), double.Parse(inputs[6]));

            return entity;
        }