Exemplo n.º 1
0
        public void UserCont(Models.Users user, Models.ApplicationUsers ApplicationUsers)
        {
            Functions _functions = new Functions();

            _functions.Countries(user);
            int           userId        = user.UserId;
            int           countryId     = _functions._countriesUsers.CountryId;
            int           ApplicationId = _roWApplicationusers.ApplicationId;
            var           list          = _functions.lcoun;
            List <string> var           = new List <string>();
            List <int>    country       = new List <int>();

            foreach (Countries _eachCountries in list)
            {
                var.Add(_eachCountries.ID);
                CountriesUsers c = new CountriesUsers(country, var, ApplicationId, userId);
                Session["CountriesUsers"] = c;
            }
            foreach (Countries _eachCountry in list)
            {
                country.Add(_eachCountry.CountryId);
                CountriesUsers c = new CountriesUsers(country, var, ApplicationId, userId);
                Session["CountriesUsers"] = c;
            }
        }
Exemplo n.º 2
0
        public void UserCont(Models.ApplicationUsers user, Models.UserCountries UserCountries1)
        {
            Functions function = new Functions();

            function.Countries(ApplicationUsers);

            int userId        = ApplicationUsers.UserId;
            int ApplicationId = ApplicationUsers.ApplicationId;

            var list = function.lcoun;

            List <string> var     = new List <string>();
            List <int>    country = new List <int>();

            foreach (Countries ce in list)
            {
                var.Add(ce.ID);
                CountriesUsers c = new CountriesUsers(country, var, ApplicationId, userId);
                Session["CountriesUsers"] = c;
            }

            foreach (Countries cu in list)
            {
                country.Add(cu.CountryId);
                CountriesUsers c = new CountriesUsers(country, var, ApplicationId, userId);
                Session["CountriesUsers"] = c;
            }
        }
Exemplo n.º 3
0
 public void ActivitySesions(Models.Users user, Models.ApplicationUsers ApplicationUsers)
 {
     _activitySessions.Date          = DateTime.Now;
     _activitySessions.UserId        = user.UserId;
     _activitySessions.ApplicationId = ApplicationUsers.ApplicationId;
     db.ActivitySessions.Add(_activitySessions);
     db.SaveChanges();
 }
Exemplo n.º 4
0
        public void ActivitySesions(Models.ApplicationUsers user)
        {
            ActivitySessions.UserId        = user.UserId;
            ActivitySessions.ApplicationId = user.ApplicationId;
            ActivitySessions.Date          = DateTime.Now;

            db.ActivitySessions.Add(ActivitySessions);
            db.SaveChanges();
        }
Exemplo n.º 5
0
        public void Countries(Models.ApplicationUsers user)
        {
            var UserC = from UserCountry in db.UserCountries
                        where UserCountry.UserId == user.UserId
                        select UserCountry;

            if (UserC.LongCount() > 0)
            {
                foreach (UserCountries UC in UserC)
                {
                    Ucountries.CountryId = UC.CountryId;
                    Ucountries.UserId    = UC.UserId;

                    var CountU = from CountriesU in db.CountriesUser
                                 where CountriesU.CountryId == Ucountries.CountryId
                                 select CountriesU;

                    if (CountU.LongCount() > 0)
                    {
                        foreach (CountriesUser Count in CountU)
                        {
                            Cusers             = new CountriesUser();
                            Cusers.Active      = Count.Active;
                            Cusers.CountryName = Count.CountryName;
                            Cusers.CountryId   = Count.CountryId;
                            Cusers.ID          = Count.ID;

                            var CountriesD = (from Country in s.Countries
                                              where Country.ID == Cusers.ID
                                              select Country).ToList();
                            if (CountU.LongCount() > 0)
                            {
                                foreach (Countries Coun in CountriesD)
                                {
                                    DCountries             = new Countries();
                                    DCountries.Active      = Coun.Active;
                                    DCountries.CountryName = Coun.CountryName;
                                    DCountries.CountryId   = Coun.CountryId;
                                    DCountries.ID          = Coun.ID;
                                    lcoun.Add(DCountries);
                                }
                            }
                        }
                    }
                }
            }
        }