예제 #1
0
        private bool IsMaximumContactExeed(List<ContactDB> list)
        {
            int moreContactCount = list.Count();
            DBManager db = new DBManager();
            currentContactNumber = db.GetTotalContactCount();

            if (currentContactNumber + moreContactCount > ContactDB.MAX_CONTACT)
            {
                DownloadControllerAndData controllerAndData = new DownloadControllerAndData
                {
                    Controller = this,
                    ListData = list
                };
                NotifyDownloadStatus(DownloadStatus.MAXIMUM_CONTACT_EXEED, controllerAndData);
                return true;
            }
            return false;
        }
예제 #2
0
 public int GetTotalContactCount()
 {
     DBManager db = new DBManager();
     return db.GetTotalContactCount();
 }
예제 #3
0
        private bool IsMaximumContactExeed(List<CMData.Contact> list)
        {
            int moreContactCount = list.Count();
            DBManager db = new DBManager();
            currentContactNumber = db.GetTotalContactCount();
            var totalContacts = currentContactNumber + moreContactCount;

            if (currentContactNumber == ContactDB.MAX_LIMITATION)
            {
                DownloadControllerAndData controllerAndData = new DownloadControllerAndData
                {
                    Controller = this,
                    ListData = list
                };

                NotifyDownloadStatus(DownloadStatus.EXCEED_MAXIMUM_LIMIT_CONTACT, controllerAndData);
                return true;
            }
            else
            {
                if (totalContacts > ContactDB.MAX_CONTACT)
                {
                    DownloadControllerAndData controllerAndData = new DownloadControllerAndData
                    {
                        Controller = this,
                        ListData = list
                    };

                    NotifyDownloadStatus(DownloadStatus.EXCEED_CURRENT_LIMIT_CONTACT, controllerAndData);
                    return true;
                }
            }

            return false;
        }
예제 #4
0
 public int GetContactCount(string search)
 {
     
     DBManager db = new DBManager();
     if (String.IsNullOrEmpty(search))
     {
         return db.GetTotalContactCount();
     }
     return db.GetContactCount(search);
 }