public ProfileRepo Update(ProfileRepo entity)
 {
     entity.SetUpdateDateTime();
     return(_context.Set <ProfileRepo>()
            .Update(entity)
            .Entity);
 }
 public ProfileRepo Add(ProfileRepo entity, long createdBy = 0)
 {
     entity.SetCreateDateTime();
     return(_context.Set <ProfileRepo>()
            .Add(entity)
            .Entity);
 }
        public ViewResult Profile()
        {
            string  name = HttpContext.Session.GetString("Name");
            int     id   = PublicUserRepo.GetId(name);
            Profile pro  = ProfileRepo.GetProfile(id);

            return(View("Profile", pro));
        }
        public UnitOfWork()
        {
            context = new Context.Context();
            //context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            ItemRepo = new ItemRepo(context);
            ItemTypeRepo = new ItemTypeRepo(context);
            PubRepo = new PubRepo(context);
            OrderRepo = new OrderRepo(context);
            ProfileRepo = new ProfileRepo(context);
            UserRepo = new UserRepo(context);
        }
Esempio n. 5
0
 public CommonController()
 {
     _cityRepo              = new CityRepo();
     _countyRepo            = new CountyRepo();
     _transfusionCenterRepo = new TransfusionCenterRepo();
     _requestRepo           = new RequestRepo();
     _profileRepo           = new ProfileRepo();
     _appointmentService    = new DonationAppointmentService(new DonationAppointmentRepo());
     _bloodTypeService      = new BloodTypeService(new BloodTypeRepo());
     _notificationService   = new NotificationService();
     _labResultService      = new LabResultService(new LabResultRepo());
     _donationService       = new DonationService(new DonationRepo());
 }
        public IActionResult Profile(Profile pro)
        {
            if (ModelState.IsValid)
            {
                string name = HttpContext.Session.GetString("Name");
                int    id   = PublicUserRepo.GetId(name);
                ProfileRepo.DeleteProfile(id);
                ProfileRepo.UpdateProfile(id, pro);
                HttpContext.Session.SetString("Name", pro.Usrinfo.Name); //Incase if user changes the name

                return(View("HomePage", pro.Usrinfo));
            }
            else
            {
                ModelState.AddModelError(String.Empty, "Please enter correct data");
                return(View("Profile", pro));
            }
        }
Esempio n. 7
0
        public TestDataGenerator()
        {
            DefaultTypeMap.MatchNamesWithUnderscores = true;

            var contractsAssembly = Assembly.GetAssembly(typeof(AuthData));

            foreach (var type in contractsAssembly.DefinedTypes)
            {
                if (type.IsClass && !type.ContainsGenericParameters)
                {
                    SqlMapper.AddTypeHandler(type.AsType(), new DapperTypeHandler());
                }
            }

            var arrayTypes = new[]
            {
                typeof(Requirement[]),
                typeof(RequirementStatus[])
            };

            foreach (var type in arrayTypes)
            {
                SqlMapper.AddTypeHandler(type, new DapperTypeHandler());
            }

            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            var profileRepo = new ProfileRepo(config);

            authService = new AuthService(config, profileRepo);

            fileRepo      = new FileRepo(config);
            taskService   = new TaskService(config, fileRepo);
            courseService = new CourseService(config, taskService);
            groupService  = new GroupService(config);

            userService = new UserService(config, profileRepo);
        }
Esempio n. 8
0
 public ActionResult ProfileDetails(ProfileModel model) //used to update the profile page after clicking the update button in profile page.
 {
     if (Session["UserId"] != null && Session["Accountid"] != null)
     {
         try
         {
             ProfileRepo ProRepo = new ProfileRepo();
             ProRepo.PostProfile(model, Session["Accountid"], Session["UserId"]);
         }
         catch (SqlException)
         {
             ViewData["Errormessage"] = "Profile Updation Failed.";
             return(View(model));
         }
         ViewData["Successmessage"] = "Profile Updated Sucessfully.";
         return(View(model));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
Esempio n. 9
0
        public ActionResult ProfileDetails() //can be seen in profile page and used to retrieve values inside textboxes.
        {
            ProfileModel model = new ProfileModel();

            if (Session["UserId"] != null && Session["Accountid"] != null)
            {
                try
                {
                    ProfileRepo ProRepo = new ProfileRepo();
                    ProRepo.GetProfile(model, Session["Accountid"], Session["UserId"]);
                }
                catch (SqlException)
                {
                    ViewData["Errormessage"] = "Error While Loading Profile.";
                    return(View(model));
                }

                return(View(model));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
Esempio n. 10
0
        public void setup()
        {
            songrepo = new SongRepo();
            songrepo.add(new Song
            {
                Song_ID    = 11111,
                HREF       = "3240asfsadf92g342",
                Song_Name  = "Get on My Level",
                Artist     = "Steven",
                Popularity = "High"
            });

            playlistrepo = new PlaylistRepo();
            playlistrepo.add(new Playlist
            {
                Playlist_ID    = 4,
                Playlist_Title = "mongo",
                Song_ID        = "4",
                Song_Title     = "Get on My Level",
                Song_Vote      = 1,
                Party_ID       = 4,
            });

            bridgerepo = new BridgeRepo();
            bridgerepo.add(new Bridge_Combo_ID
            {
                Bridge_Combo_ID1 = 123432,
                Song_ID          = 11111,
                Playlist_ID      = 4
            });

            partyrepo = new PartyRepo();
            partyrepo.add(new Party
            {
                Party_ID          = 4,
                Playlist          = 4,
                Party_Title       = "TEST",
                Participant_Count = 4,
                Genre_Limitation  = "4",
                Repeat_Contraint  = 1
            });

            role_permissionrepo = new Role_PermissionRepo();
            role_permissionrepo.add(new Role_Permission
            {
                Role_Permission_Combo_ID = 4,
                Permission1 = true,
                Permission2 = true,
                PermissionN = 4
            });

            personrolerepo = new Person_RoleRepo();
            personrolerepo.add(new Person_Role
            {
                Person_Role_ID           = 4,
                Role_Title               = "TEST",
                Role_Permission_Combo_ID = 4
            });


            personrepo = new PersonRepo();
            personrepo.add(new Person
            {
                Person_ID          = 4,
                Last_Name          = "TEST",
                First_Name         = "TEST",
                Role_ID            = 4,
                User_Name          = "TEST",
                Sex                = null,
                E_Mail             = "TEST@TEST",
                Phone              = 1234567891,
                Facebook_Key       = null,
                Twitter_Key        = null,
                Spotify_Key        = null,
                Profile_ID         = 4,
                Party_Owner_ID     = 4,
                Party_Participant  = 4,
                IsActive           = true,
                User_Password      = "******",
                Security_Question1 = "test",
                Security_Question2 = "testtest",
                Secuirty_Answer1   = "test",
                Security_Answer2   = "testtest"
            });

            profilerepo = new ProfileRepo();
            profilerepo.add(new Profile
            {
                Person_ID       = 4,
                Profile_ID      = 4,
                Profile_Name    = "TEST",
                Profile_Picture = null,
                Bio             = "TEST TEST"
            });
        }
Esempio n. 11
0
        public void setup()
        {
            songrepo = new SongRepo();
            songrepo.add(new Song
            {
                Song_ID = 11111,
                HREF = "3240asfsadf92g342",
                Song_Name = "Get on My Level",
                Artist = "Steven",
                Popularity = "High"
            });

            playlistrepo = new PlaylistRepo();
            playlistrepo.add(new Playlist
            {
                Playlist_ID = 4,
                Playlist_Title = "mongo",
                Song_ID = "4",
                Song_Title = "Get on My Level",
                Song_Vote = 1,
                Party_ID = 4,
            });

            bridgerepo = new BridgeRepo();
            bridgerepo.add(new Bridge_Combo_ID
            {
                Bridge_Combo_ID1 = 123432,
                Song_ID = 11111,
                Playlist_ID = 4
            });

            partyrepo = new PartyRepo();
            partyrepo.add(new Party
            {
                Party_ID = 4,
                Playlist = 4,
                Party_Title = "TEST",
                Participant_Count = 4,
                Genre_Limitation = "4",
                Repeat_Contraint = 1
            });

            role_permissionrepo = new Role_PermissionRepo();
            role_permissionrepo.add(new Role_Permission
            {
                Role_Permission_Combo_ID = 4,
                Permission1 = true,
                Permission2 = true,
                PermissionN = 4
            });

            personrolerepo = new Person_RoleRepo();
            personrolerepo.add(new Person_Role
            {
                Person_Role_ID = 4,
                Role_Title = "TEST",
                Role_Permission_Combo_ID = 4
            });

            personrepo = new PersonRepo();
            personrepo.add(new Person
            {
                Person_ID = 4,
                Last_Name = "TEST",
                First_Name = "TEST",
                Role_ID = 4,
                User_Name = "TEST",
                Sex = null,
                E_Mail = "TEST@TEST",
                Phone = 1234567891,
                Facebook_Key = null,
                Twitter_Key = null,
                Spotify_Key = null,
                Profile_ID = 4,
                Party_Owner_ID = 4,
                Party_Participant = 4,
                IsActive = true,
                User_Password = "******",
                Security_Question1 = "test",
                Security_Question2 = "testtest",
                Secuirty_Answer1 = "test",
                Security_Answer2 = "testtest"
            });

            profilerepo = new ProfileRepo();
            profilerepo.add(new Profile
            {
                Person_ID = 4,
                Profile_ID = 4,
                Profile_Name = "TEST",
                Profile_Picture = null,
                Bio = "TEST TEST"
            });
        }
Esempio n. 12
0
 public UserService(IConfiguration configuration, ProfileRepo profileRepo) : base(configuration)
 {
     this.profileRepo = profileRepo;
 }
Esempio n. 13
0
 public ProfileService(ProfileRepo ProfileRepo)
 {
     _profileRepo = ProfileRepo;
 }
Esempio n. 14
0
 public AuthService(IConfiguration config, ProfileRepo profileRepo) : base(config)
 {
     this.profileRepo = profileRepo;
 }