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; }
public int GetTotalContactCount() { DBManager db = new DBManager(); return db.GetTotalContactCount(); }
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; }
public int GetContactCount(string search) { DBManager db = new DBManager(); if (String.IsNullOrEmpty(search)) { return db.GetTotalContactCount(); } return db.GetContactCount(search); }