当前位置: 首页>>代码示例>>C#>>正文


C# BrightPlatformEntities.FIUpdateContactDetails方法代码示例

本文整理汇总了C#中BrightPlatformEntities.FIUpdateContactDetails方法的典型用法代码示例。如果您正苦于以下问题:C# BrightPlatformEntities.FIUpdateContactDetails方法的具体用法?C# BrightPlatformEntities.FIUpdateContactDetails怎么用?C# BrightPlatformEntities.FIUpdateContactDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrightPlatformEntities的用法示例。


在下文中一共展示了BrightPlatformEntities.FIUpdateContactDetails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: simpleButtonSave_Click

        private void simpleButtonSave_Click(object sender, EventArgs e)
        {
            if (textEditFirstname.Text.Length < 1 || textEditLastname.Text.Length < 1) {
                MessageBox.Show("Firstname / Lastname is required.", "Add Contact", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }
            bool IsActivated = false;
            BPContext = new BrightPlatformEntities(UserSession.EntityConnection);

            contact objContact = ObjectContact.GetContact(textEditFirstname.Text, textEditLastname.Text, m_accountID);
            if (objContact != null) {
                if (!m_Edit && !objContact.active) {
                    string Message = "This contact is currently de-activated." + Environment.NewLine + "Would you like to re-activate this contact?";
                    DialogResult objResult = MessageBox.Show(Message, "Add Contact", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (objResult == DialogResult.Yes) {
                        var objC = BPContext.contacts.FirstOrDefault(x=>x.id == objContact.id);
                        objC.active = true;
                        BPContext.SaveChanges();
                        DialogResult = System.Windows.Forms.DialogResult.OK;
                        return;
                    } else {
                        DialogResult = System.Windows.Forms.DialogResult.None;
                        return;
                    }
                } else if (m_Edit && !objContact.active) {
                    string Message = "Contact already exist and is currently de-activated, please enter another contact name.";
                    MessageBox.Show(Message, "Add Contact", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    DialogResult = System.Windows.Forms.DialogResult.None;
                    return;
                }else {
                    MessageBox.Show("Contact already exist, please enter another contact name.", "Contacts", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    DialogResult = System.Windows.Forms.DialogResult.None;
                    return;
                }
            }

            var titleval = ComboBoxAuto.Tag as object[];
            int? title_id = null;
            /**
             * [@jeff 05.24.2012]: https://brightvision.jira.com/browse/PLATFORM-1433
             * added validation for null titleval
             */
            if (titleval != null)
                if (titleval.Length > 0)
                    title_id = titleval[0] != null ? (int?) int.Parse(titleval[0].ToString()) : null;

            int? contact_id;

            if (m_Edit) {
                BPContext.FIUpdateContactDetails(
                    objContact.id, textEditFirstname.Text.Trim(), textEditMiddlename.Text.Trim(), textEditLastname.Text.Trim(),
                    textEditDirectphone.Text.Trim(), textEditMobile.Text.Trim(), title_id, null, textEditRoles.Text.Trim(),
                    textEditAddress1.Text.Trim(), textEditAddress2.Text.Trim(), textEditCity.Text.Trim(),
                    textEditZip.Text.Trim(), textEditCountry.Text.Trim(), "", UserSession.CurrentUser.UserId,
                    textEditEmail.Text.Trim(), "", 0, IsActivated, m_accountID, null,
                    UserSession.CurrentUser.ComputerName,
                    BrightVision.EventLog.Business.FacadeEventLog.Source_Bright_Manager_Add_Contact,
                    null,
                    null,
                    null,
                    null
                );
            } else {
                contact_id = BPContext.FIUpdateContactDetails(
                        null, textEditFirstname.Text.Trim(), textEditMiddlename.Text.Trim(), textEditLastname.Text.Trim(),
                        textEditDirectphone.Text.Trim(), textEditMobile.Text.Trim(), title_id, null, textEditRoles.Text.Trim(),
                        textEditAddress1.Text.Trim(), textEditAddress2.Text.Trim(), textEditCity.Text.Trim(),
                        textEditZip.Text.Trim(), textEditCountry.Text.Trim(), "", UserSession.CurrentUser.UserId,
                        textEditEmail.Text.Trim(), "", 0, true , m_accountID, null,
                        UserSession.CurrentUser.ComputerName,
                        BrightVision.EventLog.Business.FacadeEventLog.Source_Bright_Manager_Add_Contact,
                        null,
                        null,
                        null,
                        null
                ).FirstOrDefault();

                ContactId = contact_id ?? 0;
            }
        }
开发者ID:,项目名称:,代码行数:81,代码来源:

示例2: SaveContacts

        /// <summary>
        /// Save contact record
        /// </summary>
        public static void SaveContacts(List<CTContact> aContactList, int pContactId, string pModifiedSource)
        {
            BrightPlatformEntities m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection);
            foreach (CTContact iContact in aContactList) {
                if (iContact == null)
                    continue;

                m_objBrightPlatformEntity.FIUpdateContactDetails (
                    iContact.id,
                    iContact.first_name,
                    iContact.middle_name,
                    iContact.last_name,
                    iContact.direct_phone,
                    iContact.mobile,
                    null,
                    iContact.title,
                    iContact.role_tags,
                    iContact.address_1,
                    iContact.address_2,
                    iContact.city,
                    iContact.zipcode,
                    iContact.country,
                    "",
                    UserSession.CurrentUser.UserId,
                    iContact.email,
                    iContact.linkedin_url,
                    null,
                    true,
                    pContactId,
                    null,
                    UserSession.CurrentUser.ComputerName,
                    pModifiedSource,
                    iContact.absence_start,
                    iContact.absence_end,
                    null,
                    null
                );

                //var objContact = m_objBrightPlatformEntity.contacts.Where(objRow => objRow.id == iContact.id).SingleOrDefault();
                //objContact.first_name = iContact.first_name;
                //objContact.middle_name = iContact.middle_name;
                //objContact.last_name = iContact.last_name;
                //objContact.direct_phone = iContact.direct_phone;
                //objContact.mobile = iContact.mobile;
                //objContact.email = iContact.email;
                //objContact.title = iContact.title;
                ////objContact.company_name = iContact.company_name;
                //objContact.address_1 = iContact.address_1;
                //objContact.address_2 = iContact.address_2;
                //objContact.city = iContact.city;
                //objContact.zipcode = iContact.zipcode;
                //objContact.country = iContact.country;
                //objContact.active = iContact.active;
                //m_objBrightPlatformEntity.SaveChanges();
            }
        }
开发者ID:,项目名称:,代码行数:59,代码来源:


注:本文中的BrightPlatformEntities.FIUpdateContactDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。