/// <summary>
 /// List all resources related to the current call log on the read-only grid
 /// </summary>
 public void ListResourcesReadOnly()
 {
     try
     {
         if (_view.CallID.HasValue)
         {
             using (_callLogModel = new CallLogModel())
             {
                 _view.ResourceReadOnlyDataSource = _callLogModel.ListCallLogResourceByCallEntry(_view.CallID.Value);
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Write(string.Format("An Error has ocurred while trying to load the resources related to the Call Log.\n{0}\n{1}", ex.Message, ex.StackTrace));
         _view.DisplayMessage("An Internal Error has ocurred while trying to load the resources related to the Call Log. Please try again.", false);
     }
 }
        /// <summary>
        /// Load data for call criteria
        /// </summary>
        public void ListAllEmployeeCallLogInfoCallCriteria()
        {
            try
            {
                if (_view.JobId.HasValue && _view.CallID.HasValue)
                {
                    IList<CS_CallLogResource> resources = new List<CS_CallLogResource>();

                    using (_callLogModel = new CallLogModel())
                    {
                        resources = _callLogModel.ListCallLogResourceByCallEntry(_view.CallID.Value);
                    }

                    List<CallCriteriaResourceVO> source = new List<CallCriteriaResourceVO>();

                    for (int i = 0; i < resources.Count; i++)
                    {
                        if (resources[i].Type == (int)Globals.CallCriteria.EmailVOType.Employee)
                        {
                            using (_employeeModel = new EmployeeModel())
                            {
                                source.Add(_employeeModel.GetEmployeeDataForInitialAdvise(resources[i].EmployeeID.Value, _view.CallID.Value));
                            }
                        }
                        else
                        {
                            using (_customerModel = new CustomerModel())
                            {
                                source.Add(_customerModel.GetContactDataForInitialAdvise(resources[i].ContactID.Value, _view.CallID.Value));
                            }
                        }
                    }

                    _view.PersonInitialAdviseGridDataSource = source;
                }
                else
                {
                    IList<EmailVO> resourceList = new List<EmailVO>();
                    List<CallCriteriaResourceVO> source = new List<CallCriteriaResourceVO>();
                    List<int> callCriteriasIDs = new List<int>();

                    using (_callCriteriaModel = new CallCriteriaModel())
                    {
                        resourceList = _callCriteriaModel.ListReceiptsByCallLog(_view.SelectedCallType.ID.ToString(), _view.JobId.Value, null, out callCriteriasIDs);
                        _view.CallCriteriaIDs = callCriteriasIDs;
                    }

                    for (int i = 0; i < resourceList.Count; i++)
                    {
                        if (resourceList[i].Type == (int)Globals.CallCriteria.EmailVOType.Employee)
                        {
                            using (_employeeModel = new EmployeeModel())
                            {
                                source.Add(_employeeModel.GetEmployeeDataForInitialAdvise(resourceList[i].PersonID));
                            }
                        }
                        else
                        {
                            using (_customerModel = new CustomerModel())
                            {
                                source.Add(_customerModel.GetContactDataForInitialAdvise(resourceList[i].PersonID));
                            }
                        }
                    }

                    _view.PersonInitialAdviseGridDataSource = source;
                }
            }
            catch (Exception ex)
            {
                Logger.Write(string.Format("An Error has ocurred while trying to List .\n{0}\n{1}", ex.Message, ex.StackTrace));
                _view.DisplayMessage("An Internal Error has ocurred while trying to load the Information. Please try again.", false);
            }
        }