Ejemplo n.º 1
0
        public void addProfilePhone(ProfilePhone _profilePhone)
        {
            var P = Converter.ToProfileLocalP(_profilePhone);

            ProfilePerfiles.Add(P);
            IsEmpty = false;
        }
Ejemplo n.º 2
0
        public void addProfileWhatsapp(ProfileWhatsapp _profileW)
        {
            var W = Converter.ToProfileLocalW(_profileW);

            ProfilePerfiles.Add(W);
            IsEmpty = false;
        }
Ejemplo n.º 3
0
        public void addProfileSM(ProfileSM _profileSM)
        {
            var SM = Converter.ToProfileLocalSM(_profileSM);

            ProfilePerfiles.Add(SM);
            IsEmpty = false;
        }
Ejemplo n.º 4
0
        public void addProfileEmail(ProfileEmail _profileEmail)
        {
            var E = Converter.ToProfileLocalE(_profileEmail);

            ProfilePerfiles.Add(E);
            IsEmpty = false;
        }
Ejemplo n.º 5
0
        private async Task <ObservableCollection <ProfileWhatsapp> > GetListWhatsapp(int _BoxId)
        {
            this.IsRunning = true;
            List <ProfileWhatsapp> listWhatsapp;

            //var connection = await this.apiService.CheckConnection();

            //if (!connection.IsSuccess)
            //{
            //    this.IsRunning = false;
            //    await Application.Current.MainPage.DisplayAlert(
            //        Languages.Error,
            //        connection.Message,
            //        Languages.Accept);
            //    return null;
            //}

            var apiSecurity = Application.Current.Resources["APISecurity"].ToString();

            ProfileWhatsapp = new ObservableCollection <ProfileWhatsapp>();
            listWhatsapp    = await this.apiService.GetListByUser <ProfileWhatsapp>(
                apiSecurity,
                "/api",
                "/ProfileWhatsapps",
                MainViewModel.GetInstance().User.UserId);

            foreach (ProfileWhatsapp ItemWhatsapp in listWhatsapp)
            {
                Box_ProfileWhatsapp RelationWhatsapp;
                RelationWhatsapp = new Box_ProfileWhatsapp
                {
                    BoxId             = _BoxId,
                    ProfileWhatsappId = ItemWhatsapp.ProfileWhatsappId
                };
                //apiSecurity = Application.Current.Resources["APISecurity"].ToString();
                var response = await this.apiService.Get(
                    apiSecurity,
                    "/api",
                    "/Box_ProfileWhatsapp/GetBox_ProfileWhatsapp",
                    RelationWhatsapp);

                ItemWhatsapp.Exist = response.IsSuccess;
                if (ItemWhatsapp.Exist == true)
                {
                    var W = Converter.ToProfileLocalW(ItemWhatsapp);
                    ProfilePerfiles.Add(W);
                }
            }
            //foreach (ProfileWhatsapp profWhatsapp in listWhatsapp)
            //{
            //    if (profWhatsapp.Exist == true)
            //    {
            //        ProfilePerfiles.Add(profWhatsapp);
            //    }
            //}
            this.IsRunning = false;
            return(ProfileWhatsapp);
        }
Ejemplo n.º 6
0
        private async Task <ObservableCollection <ProfileSM> > GetListSM(int _BoxId)
        {
            this.IsRunning = true;
            List <ProfileSM> listSM;
            //var connection = await this.apiService.CheckConnection();
            //if (!connection.IsSuccess)
            //{
            //    this.IsRunning = false;
            //    await Application.Current.MainPage.DisplayAlert(
            //        Languages.Error,
            //        connection.Message,
            //        Languages.Accept);
            //    return null;
            //}

            var apiSecurity = Application.Current.Resources["APISecurity"].ToString();

            ProfileSM = new ObservableCollection <ProfileSM>();
            listSM    = await this.apiService.GetListByUser <ProfileSM>(
                apiSecurity,
                "/api",
                "/ProfileSMs",
                MainViewModel.GetInstance().User.UserId);

            foreach (ProfileSM ItemSM in listSM)
            {
                Box_ProfileSM RelationSM;
                RelationSM = new Box_ProfileSM
                {
                    BoxId       = _BoxId,
                    ProfileMSId = ItemSM.ProfileMSId
                };
                //apiSecurity = Application.Current.Resources["APISecurity"].ToString();
                var response = await this.apiService.Get(
                    apiSecurity,
                    "/api",
                    "/Box_ProfileSM/GetBox_ProfileSM",
                    RelationSM);

                ItemSM.Exist = response.IsSuccess;
                if (ItemSM.Exist == true)
                {
                    var SM = Converter.ToProfileLocalSM(ItemSM);
                    ProfilePerfiles.Add(SM);
                }
            }
            this.IsRunning = false;
            return(ProfileSM);
        }
Ejemplo n.º 7
0
        private async Task <ObservableCollection <ProfileEmail> > GetListEmail(int _BoxId)
        {
            this.IsRunning = true;
            List <ProfileEmail> listEmail;
            var apiSecurity = Application.Current.Resources["APISecurity"].ToString();

            ProfileEmail = new ObservableCollection <ProfileEmail>();
            listEmail    = await this.apiService.GetListByUser <ProfileEmail>(
                apiSecurity,
                "/api",
                "/ProfileEmails",
                MainViewModel.GetInstance().User.UserId);

            var ListOrderBy = listEmail.OrderBy(x => x.Name).ToList();

            foreach (ProfileEmail ItemEmail in ListOrderBy)
            {
                Box_ProfileEmail RelationEmail;
                RelationEmail = new Box_ProfileEmail
                {
                    BoxId          = _BoxId,
                    ProfileEmailId = ItemEmail.ProfileEmailId
                };

                var response = await this.apiService.Get(
                    apiSecurity,
                    "/api",
                    "/Box_ProfileEmail/GetBox_ProfileEmail",
                    RelationEmail);

                ItemEmail.Exist = response.IsSuccess;

                //if (ItemEmail.Exist == true)
                //{
                var Email = Converter.ToProfileLocalE(ItemEmail);
                ProfilePerfiles.Add(Email);
                //}
            }
            this.IsRunning = false;
            return(ProfileEmail);
        }
Ejemplo n.º 8
0
        private async Task <ObservableCollection <ProfilePhone> > GetListPhone(int _BoxId)
        {
            this.IsRunning = true;
            List <ProfilePhone> listPhone;
            var apiSecurity = Application.Current.Resources["APISecurity"].ToString();

            ProfilePhone = new ObservableCollection <ProfilePhone>();
            listPhone    = await this.apiService.GetListByUser <ProfilePhone>(
                apiSecurity,
                "/api",
                "/ProfilePhones",
                MainViewModel.GetInstance().User.UserId);

            var ListOrderBy = listPhone.OrderBy(x => x.Name).ToList();

            foreach (ProfilePhone ItemPhone in ListOrderBy)
            {
                Box_ProfilePhone RelationPhone;
                RelationPhone = new Box_ProfilePhone
                {
                    BoxId          = _BoxId,
                    ProfilePhoneId = ItemPhone.ProfilePhoneId
                };

                var response = await this.apiService.Get(
                    apiSecurity,
                    "/api",
                    "/Box_ProfilePhone/GetBox_ProfilePhone",
                    RelationPhone);

                ItemPhone.Exist = response.IsSuccess;
                //if (ItemPhone.Exist == true)
                //{
                var Phone = Converter.ToProfileLocalP(ItemPhone);
                ProfilePerfiles.Add(Phone);
                //}
            }
            this.IsRunning = false;
            return(ProfilePhone);
        }
Ejemplo n.º 9
0
        private async Task <ObservableCollection <ProfileWhatsapp> > GetListWhatsapp(int _BoxId)
        {
            this.IsRunning = true;
            List <ProfileWhatsapp> listWhatsapp;

            var apiSecurity = Application.Current.Resources["APISecurity"].ToString();

            ProfileWhatsapp = new ObservableCollection <ProfileWhatsapp>();
            listWhatsapp    = await this.apiService.GetListByUser <ProfileWhatsapp>(
                apiSecurity,
                "/api",
                "/ProfileWhatsapps",
                MainViewModel.GetInstance().User.UserId);

            var ListOrderBy = listWhatsapp.OrderBy(x => x.Name).ToList();

            foreach (ProfileWhatsapp ItemWhatsapp in ListOrderBy)
            {
                Box_ProfileWhatsapp RelationWhatsapp;
                RelationWhatsapp = new Box_ProfileWhatsapp
                {
                    BoxId             = _BoxId,
                    ProfileWhatsappId = ItemWhatsapp.ProfileWhatsappId
                };

                var response = await this.apiService.Get(
                    apiSecurity,
                    "/api",
                    "/Box_ProfileWhatsapp/GetBox_ProfileWhatsapp",
                    RelationWhatsapp);

                ItemWhatsapp.Exist = response.IsSuccess;

                var W = Converter.ToProfileLocalW(ItemWhatsapp);
                ProfilePerfiles.Add(W);
            }
            this.IsRunning = false;
            return(ProfileWhatsapp);
        }
Ejemplo n.º 10
0
        private async Task <ObservableCollection <ProfileSM> > GetListSM(int _BoxId)
        {
            this.IsRunning = true;
            List <ProfileSM> listSM;

            var apiSecurity = Application.Current.Resources["APISecurity"].ToString();

            ProfileSM = new ObservableCollection <ProfileSM>();
            listSM    = await this.apiService.GetListByUser <ProfileSM>(
                apiSecurity,
                "/api",
                "/ProfileSMs",
                MainViewModel.GetInstance().User.UserId);

            foreach (ProfileSM ItemSM in listSM)
            {
                Box_ProfileSM RelationSM;
                RelationSM = new Box_ProfileSM
                {
                    BoxId       = _BoxId,
                    ProfileMSId = ItemSM.ProfileMSId
                };
                //apiSecurity = Application.Current.Resources["APISecurity"].ToString();
                var response = await this.apiService.Get(
                    apiSecurity,
                    "/api",
                    "/Box_ProfileSM/GetBox_ProfileSM",
                    RelationSM);

                ItemSM.Exist = response.IsSuccess;
                if (ItemSM.Exist == true)
                {
                    var SM = Converter.ToProfileLocalSM(ItemSM);
                    ProfilePerfiles.Add(SM);
                }
            }
            this.IsRunning = false;
            return(ProfileSM);
        }
Ejemplo n.º 11
0
        public void addProfileW(ProfileWhatsapp _profileW)
        {
            var W = Converter.ToProfileLocalW(_profileW);

            ProfilePerfiles.Add(W);
        }