示例#1
0
        public void addProfilePhone(ProfilePhone _profilePhone)
        {
            var P = Converter.ToProfileLocalP(_profilePhone);

            ProfilePerfiles.Add(P);
            IsEmpty = false;
        }
示例#2
0
        public void addProfileWhatsapp(ProfileWhatsapp _profileW)
        {
            var W = Converter.ToProfileLocalW(_profileW);

            ProfilePerfiles.Add(W);
            IsEmpty = false;
        }
示例#3
0
        public void addProfileSM(ProfileSM _profileSM)
        {
            var SM = Converter.ToProfileLocalSM(_profileSM);

            ProfilePerfiles.Add(SM);
            IsEmpty = false;
        }
示例#4
0
        public void addProfileEmail(ProfileEmail _profileEmail)
        {
            var E = Converter.ToProfileLocalE(_profileEmail);

            ProfilePerfiles.Add(E);
            IsEmpty = false;
        }
        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);
        }
        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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
        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);
        }
        public void addProfileW(ProfileWhatsapp _profileW)
        {
            var W = Converter.ToProfileLocalW(_profileW);

            ProfilePerfiles.Add(W);
        }