public Globals.SampleDataObject GetCityListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            FilterValue = contextKey;

            _presenter.ListCityByNameAndState();

            if (CityList.Count == 1)
            {
                return new Globals.SampleDataObject(CityList[0].ID, CityList[0].CityStateInformation.Trim());
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
        public Globals.SampleDataObject GetStateListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            ContextKey = contextKey;

            _presenter.ListStatesByAcronym();

            if (StateList.Count == 1)
            {
                return new Globals.SampleDataObject(StateList[0].ID, string.Format("{0} - {1} - {2}", StateList[0].CS_Country.Name, StateList[0].Acronym.Trim(), StateList[0].Name.Trim()));
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
        public Globals.SampleDataObject GetZipCodeListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            FilterValue = contextKey;

            _presenter.ListZipCodesByNameAndCity();

            if (ZipCodeList.Count == 1)
            {
                return new Globals.SampleDataObject(ZipCodeList[0].ID, ZipCodeList[0].ZipCodeNameEdited.Trim());
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
        public Globals.PresetNotificationDataObject[] GetPresetNotificationList()
        {
            _presenter = new JSONServicePresenter(this);
            _presenter.GetPresetNotificationList();

            if (null != PresetNotificationList)
            {
                Globals.PresetNotificationDataObject[] returnList = new Globals.PresetNotificationDataObject[PresetNotificationList.Count];
                for (int i = 0; i < PresetNotificationList.Count; i++)
                {
                    returnList[i] = new Globals.PresetNotificationDataObject()
                    {
                        JobId = PresetNotificationList[i].JobId,
                        JobNumber = PresetNotificationList[i].JobNumber,
                        PresetDate = PresetNotificationList[i].PresetDate.ToString("MM/dd/yyyy")
                    };
                    if (PresetNotificationList[i].PresetTime.HasValue)
                        returnList[i].PresetDate += string.Format(" {0}", PresetNotificationList[i].PresetTime.Value.ToString(@"hh\:mm"));
                }
                return returnList;
            }
            else
                return null;
        }
        public Globals.SampleDataObject GetProjectManagerListJSON(string filterText)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;

            _presenter.ListProjectManager();

            if (ProjectManagerList.Count == 1)
            {
                return new Globals.SampleDataObject(ProjectManagerList[0].ID, ProjectManagerList[0].DivisionAndFullName.Trim().ToString());
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
        public Globals.SampleDataObject GetJobStatusListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            ContextKey = contextKey;

            _presenter.ListJobStatusByDescription();

            if (null != JobStatusList && JobStatusList.Count == 1)
            {
                return new Globals.SampleDataObject(JobStatusList[0].ID, JobStatusList[0].Description);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
        public Globals.MapPlotDataObject[] GetMapPlottingObjects(Globals.MapPlotRequestDataObject mapPlotFilter)
        {
            _presenter = new JSONServicePresenter(this);

            MapPlottingFilter = mapPlotFilter;

            _presenter.GetMapPlottingObjects();

            if (null != MapPlottingObjectsList)
            {
                Globals.MapPlotDataObject[] returnList = new Globals.MapPlotDataObject[MapPlottingObjectsList.Count];
                for (int i = 0; i < MapPlottingObjectsList.Count; i++)
                {
                    returnList[i] = new Globals.MapPlotDataObject()
                    {
                        Latitude = MapPlottingObjectsList[i].Latitude,
                        Longitude = MapPlottingObjectsList[i].Longitude,
                        Type = MapPlottingObjectsList[i].Type,
                        Description = MapPlottingObjectsList[i].Description,
                        Name = MapPlottingObjectsList[i].Name
                    };
                }

                return returnList;
            }
            else
                return null;
        }
        public Globals.SampleDataObject GetDynamicsContactListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            FilterValue = contextKey;

            _presenter.ListDynamicsContactByName();

            if (DynamicsContactList.Count == 1)
            {
                return new Globals.SampleDataObject(DynamicsContactList[0].ID, DynamicsContactList[0].FullContactInformation.Trim());
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
        public Globals.EmailDataDataObject GetEmailData(int callLogId)
        {
            _presenter = new JSONServicePresenter(this);
            CallLogId = callLogId;
            _presenter.GetEmailDataByCallLogId();

            string innerHtml = "<div>";

            if (CallLogCallCriteriaEmail.Count == 0)
                innerHtml += "<div style='text-align: center;'>No Data Found</div>";
            else
                for (int i = 0; i < CallLogCallCriteriaEmail.Count; i++)
                {
                    CS_CallLogCallCriteriaEmail email = CallLogCallCriteriaEmail[i];

                    innerHtml += "<div style='width: 100%; display: inline-block;'>";
                    innerHtml += "<div style='text-align: right; width: 30%; height: 100%; display: inline-block; float: left'><b>Name:</b></div>";
                    innerHtml += "<div style='text-align: left; width: 68%; height: 100%; display: inline-block; float: right'>";
                    innerHtml += email.Name;
                    innerHtml += "</div>";
                    innerHtml += "<div style='text-align: right; width: 30%; height: 100%; display: inline-block; float: left'><b>Email:</b></div>";
                    innerHtml += "<div style='text-align: left; width: 68%; height: 100%; display: inline-block; float: right'>";
                    innerHtml += email.Email;
                    innerHtml += "</div>";
                    innerHtml += "<div style='text-align: right; width: 30%; height: 100%; display: inline-block; float: left'><b>Status Date:</b></div>";
                    innerHtml += "<div style='text-align: left; width: 68%; height: 100%; display: inline-block; float: right'>";
                    innerHtml += email.StatusDate.ToString();
                    innerHtml += "</div>";
                    innerHtml += "<div style='text-align: right; width: 30%; height: 100%; display: inline-block; float: left'><b>Status:</b></div>";
                    innerHtml += "<div style='text-align: left; width: 68%; height: 100%; display: inline-block; float: right'>";
                    switch ((Globals.CallCriteria.CallCriteriaEmailStatus)email.Status)
                    {
                        case Globals.CallCriteria.CallCriteriaEmailStatus.Pending:
                            innerHtml += "Pending";
                            break;
                        case Globals.CallCriteria.CallCriteriaEmailStatus.Sent:
                            innerHtml += "Sent";
                            break;
                        case Globals.CallCriteria.CallCriteriaEmailStatus.Error:
                            innerHtml += "Error";
                            break;
                        case Globals.CallCriteria.CallCriteriaEmailStatus.ConfirmationReceived:
                            innerHtml += "Sent and Confirmed";
                            break;
                        case Globals.CallCriteria.CallCriteriaEmailStatus.ReadConfirmationReceived:
                            innerHtml += "Sent, Confirmed and Read";
                            break;
                        default:
                            innerHtml += "Pending";
                            break;
                    }
                    innerHtml += "</div>";
                    innerHtml += "</div>";

                    if (i != CallLogCallCriteriaEmail.Count - 1)
                        innerHtml += "<HR>";
                }

            innerHtml += "</div>";

            Globals.EmailDataDataObject retObject = new Globals.EmailDataDataObject(innerHtml);

            return retObject;
        }
Ejemplo n.º 10
0
 public Globals.SampleDataObject GetDivision(int employeeId)
 {
     _presenter = new JSONServicePresenter(this);
     EmployeeId = employeeId;
     _presenter.GetDivisionByEmployee();
     return ReturnDataObject;
 }
Ejemplo n.º 11
0
        public Globals.SampleDataObject GetDivisionListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;

            _presenter.ListDivisionByName();

            if (DivisionList.Count == 1)
            {
                return new Globals.SampleDataObject(DivisionList[0].ID, DivisionList[0].ExtendedDivisionName.Trim());
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 12
0
        public Globals.SampleDataObject GetCustomerServiceContactListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            FilterValue = contextKey;
            if (string.IsNullOrEmpty(contextKey))
                FilterValue = "0";

            _presenter.ListCustomerServiceContactByName();

            if (CustomerServiceContactList.Count == 1)
            {
                return new Globals.SampleDataObject(CustomerServiceContactList[0].ID, string.Format("{0} ({1})", CustomerServiceContactList[0].FullContactInformation.Trim(), CustomerServiceContactList[0].CS_Customer_Contact.First().CS_Customer.Name.Trim()));
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 13
0
        public Globals.SampleDataObject GetCustomerListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;

            _presenter.ListCustomerByNameJSON();

            if (null != CustomerList && CustomerList.Count == 1)
            {
                return new Globals.SampleDataObject(CustomerList[0].ID, CustomerList[0].FullCustomerInformation);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 14
0
 public Globals.SampleDataObject GetCustomer(int contactId)
 {
     _presenter = new JSONServicePresenter(this);
     ContactId = contactId;
     _presenter.GetCustomerByContact();
     return ReturnDataObject;
 }
Ejemplo n.º 15
0
        public Globals.SampleDataObject GetJobStatus(int jobId)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            JobId = jobId;

            _presenter.GetJobStatus();

            if (JobStatusList.Count == 1)
            {
                return new Globals.SampleDataObject(JobStatusList[0].ID, JobStatusList[0].Description);
            }
            else
            {
                return new Globals.SampleDataObject(0, "");
            }
        }
Ejemplo n.º 16
0
        public Globals.SampleDataObject GetEmployeeListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = IgnoreCoverage(filterText);
            FilterValue = contextKey;

            _presenter.ListEmployeeByName();

            if (EmployeeList.Count == 1)
            {
                return new Globals.SampleDataObject(EmployeeList[0].ID, EmployeeList[0].DivisionAndFullName);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 17
0
        public Globals.SampleDataObject GetJobStatusListForJobRecordJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            FilterValue = contextKey;

            _presenter.ListJobStatusByDescription();

            if (JobStatusList.Count > 0 && JobStatusList.Any(w => w.ID == (int)Globals.JobRecord.JobStatus.ClosedHold))
            {
                JobStatusList.Remove(JobStatusList.FirstOrDefault());
            }

            if (null != JobStatusList && JobStatusList.Count == 1)
            {
                return new Globals.SampleDataObject(JobStatusList[0].ID, JobStatusList[0].Description);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 18
0
        public Globals.StringDataObject GetEmployeeListWithDivisionNameJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = IgnoreCoverage(filterText);
            FilterValue = contextKey;

            _presenter.ListEmployeeByName();

            if (EmployeeList.Count > 0)
            {
                Globals.StringDataObject dataObject;

                if (null == EmployeeList[0].CS_Division)
                    dataObject = new Globals.StringDataObject(EmployeeList[0].ID.ToString() + "|0", EmployeeList[0].DivisionAndFullName);
                else
                    dataObject = new Globals.StringDataObject(EmployeeList[0].ID.ToString() + "|" + EmployeeList[0].CS_Division.Name, EmployeeList[0].DivisionAndFullName);

                return dataObject;
            }
            else
            {
                return new Globals.StringDataObject("0|0", filterText);
            }
        }
Ejemplo n.º 19
0
        public Globals.LocalEquipmentTypeDataObject[] GetLocalEquipmentTypeListJSON(string prefixText, string contextKey)
        {
            _presenter = new JSONServicePresenter(this);
            _presenter.GetLocalEquipmentTypelList();

            if (null != LocalEquipmentTypeList)
            {
                Globals.LocalEquipmentTypeDataObject[] returnList = new Globals.LocalEquipmentTypeDataObject[LocalEquipmentTypeList.Count];
                for (int i = 0; i < LocalEquipmentTypeList.Count; i++)
                {
                    returnList[i] = new Globals.LocalEquipmentTypeDataObject()
                    {
                        Id = LocalEquipmentTypeList[i].ID,
                        Name = LocalEquipmentTypeList[i].Name
                    };
                }
                return returnList;
            }
            else
                return null;
        }
Ejemplo n.º 20
0
        public Globals.EquipmentComboNotificationDataObject[] GetEquipmentComboNotificationList()
        {
            _presenter = new JSONServicePresenter(this);
            _presenter.GetEquipmentComboNotificationList();

            if (null != EquipmentComboNotificationList)
            {
                Globals.EquipmentComboNotificationDataObject[] returnList = new Globals.EquipmentComboNotificationDataObject[EquipmentComboNotificationList.Count];
                for (int i = 0; i < EquipmentComboNotificationList.Count; i++)
                {
                    returnList[i] = new Globals.EquipmentComboNotificationDataObject()
                    {
                        ComboId = EquipmentComboNotificationList[i].ComboID,
                        ComboName = EquipmentComboNotificationList[i].ComboName
                    };
                }
                return returnList;
            }
            else
                return null;
        }
Ejemplo n.º 21
0
        public Globals.EquipmentOffCallNotificationDataObject[] GetOffCallNotificationList()
        {
            _presenter = new JSONServicePresenter(this);
            _presenter.GetOffCallNotificationList();

            if (null != OffCallNotificationList)
            {
                Globals.EquipmentOffCallNotificationDataObject[] returnList = new Globals.EquipmentOffCallNotificationDataObject[OffCallNotificationList.Count];
                for (int i = 0; i < OffCallNotificationList.Count; i++)
                {
                    returnList[i] = new Globals.EquipmentOffCallNotificationDataObject()
                    {
                        EmployeeId = OffCallNotificationList[i].EmployeeID,
                        EmployeeName = OffCallNotificationList[i].CS_Employee.FullName,
                        OffCallDate = (OffCallNotificationList[i].OffCallEndDate + OffCallNotificationList[i].OffCallReturnTime).ToString("MM/dd/yyyy HH:mm")
                    };
                }
                return returnList;
            }
            else
                return null;
        }
Ejemplo n.º 22
0
        public Globals.EquipmentPermitNotificationDataObject[] GetEquipmentPermitNotificationList()
        {
            _presenter = new JSONServicePresenter(this);
            _presenter.GetEquipmentPermitNotificationList();

            if (null != EquipmentPermitNotificationList)
            {
                Globals.EquipmentPermitNotificationDataObject[] returnList = new Globals.EquipmentPermitNotificationDataObject[EquipmentPermitNotificationList.Count];
                for (int i = 0; i < EquipmentPermitNotificationList.Count; i++)
                {
                    returnList[i] = new Globals.EquipmentPermitNotificationDataObject()
                    {
                        PermitId = EquipmentPermitNotificationList[i].Id,
                        PermitNumber = string.Format("{0}, {1}", EquipmentPermitNotificationList[i].LicenseNumber, EquipmentPermitNotificationList[i].Code),
                        EquipmentName = string.Format("{0}, {1}", EquipmentPermitNotificationList[i].CS_Equipment.Name, EquipmentPermitNotificationList[i].CS_Equipment.Description),
                        ExpirationDate = EquipmentPermitNotificationList[i].ExpirationDate.ToString("MM/dd/yyyy"),
                    };
                }
                return returnList;
            }
            else
                return null;
        }
Ejemplo n.º 23
0
        public Globals.SampleDataObject GetPriceTypeListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;
            FilterValue = contextKey;

            _presenter.ListPriceTypeByName();

            if (PriceTypeList.Count == 1)
            {
                return new Globals.SampleDataObject(PriceTypeList[0].ID, PriceTypeList[0].Description.Trim());
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 24
0
 public Globals.SampleDataObject GetEquipmentType(int equipmentId)
 {
     _presenter = new JSONServicePresenter(this);
     EquipmentId = equipmentId;
     _presenter.GetEquipmentTypeByEquipment();
     return ReturnDataObject;
 }
Ejemplo n.º 25
0
 public Globals.StateAndCountryDataObject GetStateAndCountryByCity(int cityId)
 {
     _presenter = new JSONServicePresenter(this);
     CityId = cityId;
     _presenter.GetStateAndCountryByCity();
     return StateAndCountryDataObject;
 }
Ejemplo n.º 26
0
        public Globals.SampleDataObject GetEquipmentTypeListJSON(string filterText, string contextKey)
        {
            _presenter = new JSONServicePresenter(this);

            FilterText = filterText;

            _presenter.ListAllEquipmentTypeByName();

            if (null != EquipmentTypeList && EquipmentTypeList.Count == 1)
            {
                return new Globals.SampleDataObject(EquipmentTypeList[0].ID, EquipmentTypeList[0].CompleteName);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 27
0
 public Globals.SampleDataObject GetZipCodeByCity(int cityId)
 {
     _presenter = new JSONServicePresenter(this);
     CityId = cityId;
     _presenter.GetFirstZipCodeByCity();
     return ReturnDataObject;
 }
Ejemplo n.º 28
0
        public Globals.SampleDataObject GetJobNumberListWithGeneralJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;

            _presenter.ListJobNumberByDescriptionWithGeneral();

            if (JobList.Count == 1)
            {
                return new Globals.SampleDataObject(JobList[0].ID, JobList[0].PrefixedNumber);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }
Ejemplo n.º 29
0
 public Globals.CollectionCustomer IsCustomerCollection(int customerId)
 {
     _presenter = new JSONServicePresenter(this);
     CustomerId = customerId;
     _presenter.CustomerIsCollection();
     return new Globals.CollectionCustomer() { Collection = IsCostumerCollection };
 }
Ejemplo n.º 30
0
        public Globals.SampleDataObject GetCallTypeListJSON(string filterText, string contextKey)
        {
            if (null == _presenter)
                _presenter = new JSONServicePresenter(this);

            FilterText = filterText;

            _presenter.ListCallTypeListByDescription();

            if (CallTypeList.Count == 1)
            {
                return new Globals.SampleDataObject(CallTypeList[0].ID, CallTypeList[0].Description);
            }
            else
            {
                return new Globals.SampleDataObject(0, filterText);
            }
        }