Beispiel #1
0
        public void updateProfileWhatsapp(ProfileWhatsapp _profileW)
        {
            ProfileLocal W        = Converter.ToProfileLocalW(_profileW);
            ProfileLocal Aux      = new ProfileLocal();
            int          newIndex = 0;

            foreach (ProfileLocal PLocal in ProfilePerfiles)
            {
                if (W.ProfileName == PLocal.ProfileName && W.value == PLocal.value)
                {
                    Aux      = PLocal;
                    newIndex = ProfilePerfiles.IndexOf(PLocal);
                }
            }

            ProfilePerfiles.Remove(Aux);

            ProfilePerfiles.Insert(newIndex, W);
        }
Beispiel #2
0
        public void updateProfilePhone(ProfilePhone _profileP)
        {
            ProfileLocal P        = Converter.ToProfileLocalP(_profileP);
            ProfileLocal Aux      = new ProfileLocal();
            int          newIndex = 0;

            foreach (ProfileLocal PLocal in ProfilePerfiles)
            {
                if (P.ProfileName == PLocal.ProfileName && P.value == PLocal.value)
                {
                    Aux      = PLocal;
                    newIndex = ProfilePerfiles.IndexOf(PLocal);
                }
            }

            ProfilePerfiles.Remove(Aux);

            ProfilePerfiles.Insert(newIndex, P);
        }
Beispiel #3
0
        public void updateProfileEmail(ProfileEmail _profileEmail)
        {
            ProfileLocal E        = Converter.ToProfileLocalE(_profileEmail);
            ProfileLocal Aux      = new ProfileLocal();
            int          newIndex = 0;

            foreach (ProfileLocal PLocal in ProfilePerfiles)
            {
                if (E.ProfileName == PLocal.ProfileName && E.value == PLocal.value)
                {
                    Aux      = PLocal;
                    newIndex = ProfilePerfiles.IndexOf(PLocal);
                }
            }

            ProfilePerfiles.Remove(Aux);

            ProfilePerfiles.Insert(newIndex, E);
        }
Beispiel #4
0
        public void updateProfileSM(ProfileSM _profileSM)
        {
            ProfileLocal SM       = Converter.ToProfileLocalSM(_profileSM);
            ProfileLocal Aux      = new ProfileLocal();
            int          newIndex = 0;

            foreach (ProfileLocal PLocal in ProfilePerfiles)
            {
                if (SM.ProfileName == PLocal.ProfileName && SM.value == PLocal.value)
                {
                    Aux      = PLocal;
                    newIndex = ProfilePerfiles.IndexOf(PLocal);
                }
            }

            ProfilePerfiles.Remove(Aux);

            ProfilePerfiles.Insert(newIndex, SM);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #7
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);
        }
        public void addProfileSM(ProfileSM _profileSM)
        {
            var SM = Converter.ToProfileLocalSM(_profileSM);

            ProfilePerfiles.Add(SM);
        }
        public void addProfilePhone(ProfilePhone _profilePhone)
        {
            var P = Converter.ToProfileLocalP(_profilePhone);

            ProfilePerfiles.Add(P);
        }
        public void addProfileEmail(ProfileEmail _profileEmail)
        {
            var E = Converter.ToProfileLocalE(_profileEmail);

            ProfilePerfiles.Add(E);
        }