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


C# DBManager.GetAllEmailTypeByAccountTypeName方法代码示例

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


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

示例1: SelfAddContact

        //  Contact
        public int SelfAddContact(string firstName, string middleName, string lastName, string email, string fax)
        {
            DBManager db = new DBManager();
            AccountDB selfAccount = db.GetSelfAccount();

            ContactDB contact = new ContactDB();
            contact.FirstName = firstName;
            contact.MiddleName = middleName;
            contact.LastName = lastName;
            contact.AccountId = selfAccount.Id;

            if (!String.IsNullOrEmpty(email))
            {
                List<EmailDB> listEmail = new List<EmailDB>();
                EmailDB emailDB = new EmailDB();
                emailDB.Value = email;
                List<EmailTypeDB> listEmailType = db.GetAllEmailTypeByAccountTypeName(AccountTypeDB.TYPE_SELF_STRING);
                if (listEmailType.Count() > 0)
                {
                    emailDB.EmailType = listEmailType[0];
                }
                listEmail.Add(emailDB);
                contact.ListEmail = listEmail;
            }
            if (!String.IsNullOrEmpty(fax))
            {
                List<FaxDB> listFax = new List<FaxDB>();
                FaxDB faxDB = new FaxDB();
                faxDB.Value = fax;
                List<FaxTypeDB> listFaxType = db.GetAllFaxTypeByAccountTypeName(AccountTypeDB.TYPE_SELF_STRING);
                if (listFaxType.Count() > 0)
                {
                    faxDB.FaxType = listFaxType[0];
                }
                listFax.Add(faxDB);
                contact.ListFax = listFax;
            }

            List<ContactDB> list = new List<ContactDB>();
            list.Add(contact);
            return db.AddOrUpdateContacts(list);
        }
开发者ID:thongvo,项目名称:myfiles,代码行数:43,代码来源:DatabaseController.cs

示例2: GetAllEmailTypeByAccountTypeName

 public List<EmailType> GetAllEmailTypeByAccountTypeName(string accountTypename)
 {
     DBManager db = new DBManager();
     return db.GetAllEmailTypeByAccountTypeName(accountTypename);
 }
开发者ID:thongvo,项目名称:myfiles,代码行数:5,代码来源:DatabaseController.cs

示例3: SelfAddContact

        //  Contact
        public List<int> SelfAddContact(string firstName, string middleName, string lastName, string email, string fax)
        {
            DBManager db = new DBManager();
            AccountDB selfAccount = db.GetSelfAccount();

            ContactDB contact = new ContactDB();
            contact.FirstName = firstName;
            contact.MiddleName = middleName;
            contact.LastName = lastName;

            contact.AccountId = selfAccount.Id;
            List<Dictionary<string, int>> positionEmailFax = new List<Dictionary<string, int>>();
            if (!String.IsNullOrEmpty(email))
            {
                Dictionary<string, int> dictionaryEmail = new Dictionary<string, int>();
                List<EmailDB> listEmail = new List<EmailDB>();
                EmailDB emailDB = new EmailDB();
                emailDB.Value = email;
                List<EmailTypeDB> listEmailType = db.GetAllEmailTypeByAccountTypeName(AccountTypeDB.TYPE_SELF_STRING);
                if (listEmailType.Any())
                {
                    for (int i = 0; i < listEmailType.Count; i++)
                    {
                        if (listEmailType[i].IsPreferred)
                        {
                            emailDB.EmailType = listEmailType[i];
                            dictionaryEmail.Add("Email", i);
                        }
                    }
                }
                listEmail.Add(emailDB);
                contact.ListEmail = listEmail;
                positionEmailFax.Add(dictionaryEmail);
            }
            if (!String.IsNullOrEmpty(fax))
            {
                Dictionary<string, int> dictionaryFax = new Dictionary<string, int>();
                List<FaxDB> listFax = new List<FaxDB>();
                FaxDB faxDB = new FaxDB();
                faxDB.Value = fax;
                List<FaxTypeDB> listFaxType = db.GetAllFaxTypeByAccountTypeName(AccountTypeDB.TYPE_SELF_STRING);
                if (listFaxType.Any())
                {
                    for (int i = 0; i < listFaxType.Count; i++)
                    {
                        if (listFaxType[i].IsPreferred)
                        {
                            faxDB.FaxType = listFaxType[i];
                            dictionaryFax.Add("Fax", i);
                        }
                    }
                }
                listFax.Add(faxDB);
                contact.ListFax = listFax;
                positionEmailFax.Add(dictionaryFax);
            }

            List<ContactDB> list = new List<ContactDB>();
            list.Add(contact);
            return db.AddOrUpdateContacts(list);
        }
开发者ID:thongvo,项目名称:myfiles,代码行数:62,代码来源:DatabaseController.cs


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