Exemplo n.º 1
0
        private static void NotifyTimeSpentOnIncident(CrmServiceClient service)
        {
            // Calculate the total number of minutes spent on an incident.
            var calculateRequestTime = new CalculateTotalTimeIncidentRequest
            {
                IncidentId = _incidentId
            };
            var response =
                (CalculateTotalTimeIncidentResponse)service.Execute(calculateRequestTime);

            Console.WriteLine("  {0} minutes have been spent on the incident.",
                              response.TotalTime);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Calculates the total time that was spent on the <c>Incident</c>.
        /// Please note that if an activity that is used to resolve the incident (case) has already been <c>billed</c>, those minutes are not included in the calculation of the current incident.
        /// <para>
        /// For more information look at https://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.calculatetotaltimeincidentrequest(v=crm.8).aspx
        /// </para>
        /// </summary>
        /// <param name="id"><c>Incident</c> Id</param>
        /// <returns>
        /// Calculated total time in <c>minutes</c>
        /// </returns>
        public long CalculateTotalTime(Guid id)
        {
            ExceptionThrow.IfGuidEmpty(id, "id");

            CalculateTotalTimeIncidentRequest request = new CalculateTotalTimeIncidentRequest()
            {
                IncidentId = id
            };

            var serviceResponse = (CalculateTotalTimeIncidentResponse)this.OrganizationService.Execute(request);

            return(serviceResponse.TotalTime);
        }
Exemplo n.º 3
0
        private void NotifyTimeSpentOnIncident()
        {
            //<snippetCloseAnIncident4>
            // Calculate the total number of minutes spent on an incident.
            var calculateRequestTime = new CalculateTotalTimeIncidentRequest
            {
                IncidentId = _incidentId
            };
            var response =
                (CalculateTotalTimeIncidentResponse)_serviceProxy.Execute(calculateRequestTime);

            Console.WriteLine("  {0} minutes have been spent on the incident.",
                              response.TotalTime);
            //</snippetCloseAnIncident4>
        }
Exemplo n.º 4
0
        private void NotifyTimeSpentOnIncident()
        {
            //<snippetCloseAnIncident4>
            // Calculate the total number of minutes spent on an incident. 
            var calculateRequestTime = new CalculateTotalTimeIncidentRequest
            {
                IncidentId = _incidentId
            };
            var response =
                (CalculateTotalTimeIncidentResponse)_serviceProxy.Execute(calculateRequestTime);

            Console.WriteLine("  {0} minutes have been spent on the incident.",
                response.TotalTime);
            //</snippetCloseAnIncident4>
        }