Esempio n. 1
0
        public static Ident TestLogin(string loginname, string password, VueTOView.Common.Environment environment)
        {
            Ident ident = null;
            AuthorizerInternalClient client = ClientProvider.ProvideAuthClient(environment);
            Task <ServiceReference1.ResultOfIdentvcrQC78O> task = client.LoginAsync(loginname, password);
            ResultOfIdentvcrQC78O result = task.Result;

            if ((result != null) && string.IsNullOrEmpty(result.Error) && (result.Data != null))
            {
                ident = result.Data as Ident;
            }

            return(ident);
        }
Esempio n. 2
0
        public static List <TechnicianRequirement> TestGetTourOfTechnician(Ident ident, int mandatorId, ID technicianID, DateTime date, VueTOView.Common.Environment environment)
        {
            List <TechnicianRequirement> list   = new List <TechnicianRequirement>();
            List <TechnicianRequirement> tours  = new List <TechnicianRequirement>();
            WebToolExtendedServiceClient client = ClientProvider.ProvideTOClient(environment);
            Task <ServiceReference2.ResultListOfAppointmentuukIAVwv> task = client.GetTourOfTechnicianAsync(ident, mandatorId, technicianID, date, null);
            ResultListOfAppointmentuukIAVwv result = task.Result;

            if ((result != null) && string.IsNullOrEmpty(result.Error) && (result.DataList != null) && (result.DataList.Length > 0))
            {
                List <Appointment> appointments = result.DataList.Where(x => x.State != ActivationState.Deleted).ToList();
                foreach (Appointment appointment in appointments)
                {
                    List <TechnicianRequirement> appointmenttours = appointment.TechnicianRequirements.Where(y => y.TechnicianID.SourceId == technicianID.SourceId && y.State != ActivationState.Deleted).ToList();
                    foreach (TechnicianRequirement tour in appointmenttours)
                    {
                        tour.Appointment             = appointment;
                        tour.Appointment.GeoLocation = TestGetGeoLocation(client, ident, mandatorId, tour.Appointment.GeoLocationID);
                        if (tour.Appointment.GeoLocation != null)
                        {
                            tours.Add(tour);
                        }
                    }
                }

                list = tours.OrderBy(x => x.RealStart).ToList();
            }

            return(list);
        }
Esempio n. 3
0
        public static List <Technician> TestGetTourTechnicians(Ident ident, int mandatorId, VueTOView.Common.Environment environment)
        {
            List <Technician>            tourtechnicians = new List <Technician>();
            WebToolExtendedServiceClient client          = ClientProvider.ProvideTOClient(environment);
            Task <ServiceReference2.ResultListOfTechnicianuukIAVwv> task = client.GetTechniciansAsync(ident, mandatorId, null);
            ResultListOfTechnicianuukIAVwv result = task.Result;

            if ((result != null) && string.IsNullOrEmpty(result.Error) && (result.DataList != null) && (result.DataList.Length > 0))
            {
                List <Technician> technicians = result.DataList.ToList();
                foreach (Technician tec in technicians.Where(x => !x.IsSubcontractor).OrderBy(x => x.Name))
                {
                    tourtechnicians.Add(tec);
                }
            }

            return(tourtechnicians);
        }