.NET 學習

.NET 學習生活感想... 万事成蹉跎..... 贵在坚持 及时整理自己做过和学过的东西

博客园 首页 新随笔 联系 订阅 管理

XCRM: Leads and opportunities(XCRM销售线索和销售机会)

A Lead is not directly linked to a Contact or Account. It can be converted into an Account, Contact or Opportunity later. I’ll just capture the fact that the Lead class exists and may have some basic info:
一个销售线索不直接链接到联系人或客户。它能被转换成一个客户,联系人或之后的销售机会。我就抓住事实,存在Lead类,有一些基础信息:

[Test]

public void LeadsRelationships() {

    RegisterDC<ILead>();

    Generate();

    ILead romanFromDx = ObjectSpace.CreateObject<ILead>();

    romanFromDx.FirstName = "Roman";

    romanFromDx.LastName = "Eremin";

    romanFromDx.CompanyName = "DevExpress";

}

[DomainComponent]

public interface ILead {

    string FirstName { get; set; }

    string LastName { get; set; }

    string CompanyName { get; set; }

}

At this point, I’m not sure that the ILead should be inherited from the IPerson. So, I've just added the FirstName and LastName properties, and made a note to resolve this problem later.
至此,我不确定Ilead应当继承自Iperson.因此,我刚好加入了FirstName LastName 属性,做一个备注稍后解决这个问题。

An Opportunity is a more probable possibility for business. It is related to an Account (who you want to sell to) and Product (what you want to sell). Simple CRM systems do not track products and prices, so I will leave them out in our CRM app. Here is the test for Opportunities:
一个销售机会是更有可能的业务。它关系到一个客户(你想要销售给谁)和产品(你想要销售什么)。简单的CRM系统不跟踪产品和价格,因此在我的CRM应用程序中我将分离他们。这是一个销售机会的测试:

[Test]

public void OpportunityAccountRelationships() {

    RegisterDC<IContact>();

    RegisterDC<IAccount>();

    RegisterDC<IOpportunity>();

    Generate();

    IAccount dx = ObjectSpace.CreateObject<IAccount>();

    dx.Name = "DevExpress";

    IOpportunity sellComponents = ObjectSpace.CreateObject<IOpportunity>();

    sellComponents.Name = "Sell some third-party components to DX";

    sellComponents.Account = dx;

    Assert.IsTrue(Enumerator.Exists<IOpportunity>(dx.Opportunities, sellComponents));

}

To make this test pass I need the following:
要使测试通过我需下面内容:

[DomainComponent]

public interface IOpportunity {

    string Name { get; set; }

    IAccount Account { get; set; }

}

[DomainComponent]

public interface IAccount {

   

    IList<IOpportunity> Opportunities { get; }

}

 

欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/

 

posted on 2011-01-25 08:35  Tonyyang  阅读(623)  评论(0编辑  收藏  举报
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/