コード例 #1
0
ファイル: frmDataAPI.cs プロジェクト: mohsinkhan13/CSExample
        private void cmdCreateIndividual_Click(object sender, EventArgs e)
        {
            var field = _gateway.FindExtraField("Turnover");

            var i = new Individual()
            {
                LastName = "Smith"
            };

            i.ExtraFields.Add(new ExtraValue()
            {
                ExtraFieldId = field.ExtraFieldId,
                Value        = "100000"
            });

            _gateway.Save(i);

            CssContext.Instance.Host.OpenContact(i.ContactId);
        }
コード例 #2
0
        private void CreateClientWithExtraFields(object Sender, SideBarEventArgs e)
        {
            var centralDAL     = CssContext.Instance.GetDAL(string.Empty) as DAL;
            var centralGateway = new CentralGateway(centralDAL);

            var contact = new Organisation()
            {
                Name = "Extra Field Test"
            };

            centralGateway.Save(contact);
            centralGateway.ConvertContactToClient(contact, "EF001", CssContext.Instance.Host.EmployeeId);

            contact = (Organisation)centralGateway.FindContact(contact.ContactId, CssContext.Instance.Host.EmployeeId);

            CssContext.Instance.Host.OpenClient(contact.Client.ClientId);
        }