Beispiel #1
0
        public static async Task <bool> SincLocalDbWithWebSiteDb()
        {
            var webApiUtilsServ = ServiceLocator.Get <IUtilsWebService>();

            if (!await webApiUtilsServ.TestConnection())
            {
                MessageBox.Show("La Api Web no esta accesible, pruebe conectandose a internet e intentelo nuevamente.");
            }
            //Sincronizar nomencladores
            bool res = true;

            res &= await Process <ICategoryWebService, ICategoryService, CategoryVO, Category>();

            res &= await Process <ICivilStatusWebService, ICivilStatusService, CivilStatusVO, CivilStatus>();

            res &= await Process <IComplexionWebService, IComplexionService, ComplexionVO, Complexion>();

            res &= await Process <ICourseWebService, ICourseService, CourseVO, Course>();

            res &= await Process <ICurrencyWebService, ICurrencyService, CurrencyVO, Currency>();

            res &= await Process <IDriverLicenseWebService, IDriverLicenseService, DriverLicenseVO, DriverLicense>();

            res &= await Process <IEyeColorWebService, IEyeColorService, EyeColorVO, EyeColor>();

            res &= await Process <ILanguageWebService, ILanguageService, LanguageVO, Language>();

            res &= await Process <ILanguageLevelWebService, ILanguageLevelService, LanguageLevelVO, LanguageLevel>();

            res &= await Process <IMembershipWebService, IMembershipService, MembershipVO, Membership>();

            res &= await Process <IMunicipalityWebService, IMunicipalityService, MunicipalityVO, Municipality>();

            res &= await Process <IPrizeWebService, IPrizeService, PrizeVO, Prize>();

            res &= await Process <IProvinceWebService, IProvinceService, ProvinceVO, Province>();

            res &= await Process <IScheduleWebService, IScheduleService, ScheduleVO, Schedule>();

            res &= await Process <ISchoolGradeWebService, ISchoolGradeService, SchoolGradeVO, SchoolGrade>();

            res &= await Process <ISkinColorWebService, ISkinColorService, SkinColorVO, SkinColor>();

            res &= await Process <ISpecialtyWebService, ISpecialtyService, SpecialtyVO, Specialty>();

            res &= await Process <IVehicleWebService, IVehicleService, VehicleVO, Vehicle>();

            res &= await Process <IWorkplaceWebService, IWorkplaceService, WorkplaceVO, Workplace>();

            res &= await Process <IGenderWebService, IGenderService, GenderVO, Emplomania.Model.Gender>();

            WebNomenclatorsCache.Load();

            //TODO: Hacer otras cosas como sincronizar usuarios.
            return(res);
        }
 static WebNomenclatorsCache()
 {
     Instance = new WebNomenclatorsCache()
     {
         Statures = new List <float>()
         {
             1.50F,
             1.51F,
             1.52F,
             1.53F,
             1.54F,
             1.55F,
             1.56F,
             1.57F,
             1.58F,
             1.59F,
             1.60F,
             1.61F,
             1.62F,
             1.63F,
             1.64F,
             1.65F,
             1.66F,
             1.67F,
             1.68F,
             1.69F,
             1.70F,
             1.71F,
             1.72F,
             1.73F,
             1.74F,
             1.75F,
             1.76F,
             1.77F,
             1.78F,
             1.79F,
             1.80F,
             1.81F,
             1.82F,
             1.83F,
             1.84F,
             1.85F,
             1.86F,
             1.87F,
             1.88F,
             1.89F,
             1.90F,
             1.91F,
             1.92F,
             1.93F,
             1.94F,
             1.95F,
             1.96F,
             1.97F,
             1.98F,
             1.99F,
             2.00F,
             2.01F,
             2.02F,
             2.03F,
             2.04F,
             2.05F,
             2.06F,
             2.07F,
             2.08F,
             2.09F,
             2.10F
         },
         WorkPlaceCount = new List <int>()
         {
             1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
         },
         WorkedTimes = new List <string>()
         {
             "menos 1 año",
             "1 año",
             "2 años",
             "3 años",
             "4 años",
             "5 años",
             "6 años",
             "7 años",
             "8 años",
             "9 años",
             "10 años",
             "mas de 10 años",
         },
         HowKnowEM = new List <string>()
         {
             "Por un anuncio de clasificados",
             "Porque me lo recomendaron",
             "Por publicidad impresa",
             "Recibí promoción por email",
             "Por el paquete semanal",
             "Por las redes sociales",
         }
     };
     Load();
 }