Example #1
0
 //public static List<ContactInfo> FilterSearchAdvance_Indanhsach(int branchId, string userIds, int statusMapId, int statusCareId, string levels, DateTime? handoverFromDate, DateTime? handoverToDate, DateTime? callFromDate, DateTime? callToDate, int qualityId, int productSellId, EmployeeType employeeType, out int totalRecord)
 //{
 //    if (callFromDate.HasValue && !callToDate.HasValue) callToDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
 //    if (handoverFromDate.HasValue && !handoverToDate.HasValue) handoverToDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
 //    return FillContactCollection(DataProvider.Instance().Contacts_Filter_Search_Advance_Indanhsach(branchId, userIds, statusMapId, statusCareId, levels, handoverFromDate, handoverToDate, callFromDate, callToDate, qualityId, productSellId, employeeType), out totalRecords);
 //}
 // Delete
 public static void Delete(int id, ContactDeletedInfo info, EmployeeType employeeType)
 {
     DataProvider.Instance().Contacts_Delete(id, info.ContactId, info.BranchId, info.UserId, info.Phone, info.Email, info.DeletedBy, info.DeletedTime, info.Json, employeeType);
 }
Example #2
0
 private static ContactDeletedInfo InitContactDeletedInfo(int id)
 {
     var phones = PhoneRepository.GetByContact(id) ?? new List<PhoneInfo>();
     var phoneInfo = phones.Where(c => c.IsPrimary == 1).FirstOrDefault();
     var entityJson = new ContactDeletedJson
                          {
                              CallHistories = CallHistoryRepository.GetAllByContactId(id),
                              ContactInfo = ContactRepository.GetInfo(id) ?? new ContactInfo(),
                              ContactLevelInfo = ContactLevelInfoRepository.GetInfoByContactId(id),
                          };
     var entity = new ContactDeletedInfo
                      {
                          DeletedTime = DateTime.Now,
                          Json = entityJson.ToJson(),
                          Email = entityJson.ContactInfo.Email,
                          ContactId = entityJson.ContactInfo.Id,
                          UserId = entityJson.ContactInfo.UserConsultantId,
                          BranchId = entityJson.ContactInfo.BranchId,
                          DeletedBy = UserContext.GetCurrentUser().UserID,
                          Phone = phoneInfo != null ? phoneInfo.PhoneNumber : string.Empty,
                      };
     return entity;
 }