protected async System.Threading.Tasks.Task Load()
        {
            originatingClubList = new List <SoccerLeagueTransferApp.Models.ConData.ClubDetail>()
            {
            };

            await CheckUserStatus();

            getPlayersResult = new List <SoccerLeagueTransferApp.Models.ConData.Player>()
            {
            };

            var conDataGetClubDetailsResult = await ConData.GetClubDetails();

            getClubDetailsResult = conDataGetClubDetailsResult;

            var conDataGetTransferTypesResult = await ConData.GetTransferTypes();

            getTransferTypesResult = conDataGetTransferTypesResult;

            playertransfer = new SoccerLeagueTransferApp.Models.ConData.PlayerTransfer()
            {
            };

            await MuyikGetPlayerList();
        }
Пример #2
0
        protected async System.Threading.Tasks.Task Load()
        {
            var conDataGetPlayerTransferByTransferIdResult = await ConData.GetPlayerTransferByTransferId(TransferID);

            playertransfer = conDataGetPlayerTransferByTransferIdResult;

            await CheckUserStatus();
        }
Пример #3
0
        protected async System.Threading.Tasks.Task Load()
        {
            await CheckUserStatus();

            var conDataGetPlayerPositionByPositionIdResult = await ConData.GetPlayerPositionByPositionId(PositionID);

            playerposition = conDataGetPlayerPositionByPositionIdResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            await CheckUserStatus();

            var conDataGetUsersResult = await ConData.GetUsers();

            getUsersResult = conDataGetUsersResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            await CheckUserStatus();

            var conDataGetRoleByRoleIdResult = await ConData.GetRoleByRoleId(RoleID);

            role = conDataGetRoleByRoleIdResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            var conDataGetPlayerPositionsResult = await ConData.GetPlayerPositions();

            getPlayerPositionsResult = conDataGetPlayerPositionsResult;

            await CheckUserStatus();
        }
        protected async System.Threading.Tasks.Task Load()
        {
            await CheckUserStatus();

            var conDataGetTransferTypeByTransferTypeIdResult = await ConData.GetTransferTypeByTransferTypeId(TransferTypeID);

            transfertype = conDataGetTransferTypeByTransferTypeIdResult;
        }
        protected async System.Threading.Tasks.Task Load()
        {
            await CheckUserStatus();

            var conDataGetGenderByGenderIdResult = await ConData.GetGenderByGenderId(GenderID);

            gender = conDataGetGenderByGenderIdResult;
        }
Пример #9
0
        /*
         * Cargar los datos de la conexión.
         */
        private void LoadConnectionData()
        {
            ConData conData = JsonConvert.DeserializeObject <ConData>(System.IO.File.ReadAllText(@"dbconfig.json"));

            connectionString = "SERVER=" + conData.server + ";" + "DATABASE=" + conData.database + ";" +
                               "PORT=" + conData.port + ";" + "UID=" + conData.uid + ";" + "PWD=" + conData.password +
                               ";Convert Zero Datetime=true;CHARSET=utf8";
            connection = new MySqlConnection(connectionString);
        }
Пример #10
0
        protected async System.Threading.Tasks.Task Load()
        {
            var conDataGetUserByUserIdResult = await ConData.GetUserByUserId(UserID);

            user = conDataGetUserByUserIdResult;

            var conDataGetClubDetailsResult = await ConData.GetClubDetails();

            getClubDetailsResult = conDataGetClubDetailsResult;
        }
Пример #11
0
        protected async System.Threading.Tasks.Task Load()
        {
            canEdit = false;

            await CheckUserStatus();

            var conDataGetPlayersResult = await ConData.GetPlayers();

            getPlayersResult = conDataGetPlayersResult;
        }
        //method to login user
        private async Task SignInUser()
        {
            //call ValidateUser method in the service layer
            var myUser = await ConData.ValidateUser(user.Username, user.Password);

            if (myUser.UserID > 0)//checking if user was found in the datastore
            {
                //get user roles list

                List <String> rolesList = await ConData.MuyikGetRolesList(myUser.UserID);

                //check if any role was returned

                if (rolesList.Any())
                {
                    //store role list inside my session manager

                    await sessionStorage.SetItemAsync("Roles", rolesList);

                    //store userID inside session manager

                    await sessionStorage.SetItemAsync("UserID", myUser.UserID);

                    //store username inside session manager

                    await sessionStorage.SetItemAsync("Username", myUser.Username);

                    //store TeamID inside session manager

                    await sessionStorage.SetItemAsync("TeamID", myUser.TeamID);


                    //mark user as authenticated

                    await((CustomAuthenticationStateProvider)AuthenticationStateProvider).MarkUserAsAuthenticated(myUser.Username, rolesList);

                    //redirect authenticated user to players list page

                    UriHelper.NavigateTo("players");
                }

                //if no role was returned
                else
                {
                    NotificationService.Notify(NotificationSeverity.Error, "No Role Assignment", "You are a valid application user,but you have not been assigned any role.Please contact system admin.", 5000);
                }
            }

            //if user was not found in datastore
            else
            {
                NotificationService.Notify(NotificationSeverity.Error, "Login Failure", "Invalid Username or Password.", 5000);
            }
        }
        //custom method to reset user password

        private async Task ResetUserPassword()
        {
            try
            {
                SoccerLeagueTransferApp.Models.ConData.User appUser = await ConData.MuyikGetUserByEmail(user.EmailAddress);

                if (appUser.UserID > 0)//this implies that user was found in the data store
                {
                    var toAddress   = appUser.EmailAddress;
                    var emailTitle  = "Password Reset Notification";
                    var newPassword = new Random(7).Next().ToString() + appUser.Username; //generating new password

                    await ConData.MuyikResetPassword(appUser.UserID, newPassword);        //updating password in datastore


                    //generate email body

                    var emailBody         = "Dear " + appUser.Username + ",\nThis is to inform you that we have received a request to reset your password. Your new password is " + newPassword + ".\nPlease go to the login page to login with this new password.Don't forget to change your password after logging in.";
                    var fromAddress       = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build().GetSection("EmailSettings")["fromAddress"];
                    var smtpServerAddress = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build().GetSection("EmailSettings")["smtpServerAddress"];
                    var portNumber        = Convert.ToInt32(new ConfigurationBuilder().AddJsonFile("appsettings.json").Build().GetSection("EmailSettings")["smtpPortNumber"]);
                    var smtpUserName      = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build().GetSection("EmailSettings")["smtpUserName"];
                    var smtpPassword      = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build().GetSection("EmailSettings")["smtpPassword"];

                    //send password reset email

                    MuyikUtility.Email.SendEmail(toAddress, fromAddress, emailTitle, emailBody, smtpServerAddress, portNumber, smtpUserName, smtpPassword);


                    //notify user

                    NotificationService.Notify(NotificationSeverity.Success, "Password Reset Success!", "You Have successfully Reset Your Password.Please Check Your Inbox to get the new password", 5000);


                    //reset page

                    user = new Models.ConData.User();
                }
                else//user not found
                {
                    //notify user

                    NotificationService.Notify(NotificationSeverity.Error, "Email Address Error!", "No Soccer Transfer App User Was Found With That Email Address", 9000);

                    return;
                }
            }
            catch (Exception ex)
            {
                //notify user

                NotificationService.Notify(NotificationSeverity.Error, "Password Reset Error!", "Password Reset Error", 9000);
            }
        }
 private async Task MuyikFetchAllMarketsADONet()
 {
     try
     {
         var myConnectionString = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build().GetSection("ConnectionStrings")["conDataConnection"];
         getMarketsResult = await ConData.MuyikReturnAllMarkets(myConnectionString);
     }
     catch (Exception)
     {
         NotificationService.Notify(NotificationSeverity.Error, "Markets Fetch Error", "An Error Occurred While Fetching The Markets", 7000);
     }
 }
        protected async System.Threading.Tasks.Task Form0Submit(SoccerLeagueTransferApp.Models.ConData.Role args)
        {
            try
            {
                var conDataUpdateRoleResult = await ConData.UpdateRole(RoleID, role);

                DialogService.Close(role);
            }
            catch (System.Exception conDataUpdateRoleException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Role");
            }
        }
Пример #16
0
        protected async System.Threading.Tasks.Task Form0Submit(SoccerLeagueTransferApp.Models.ConData.PlayerPosition args)
        {
            try
            {
                var conDataCreatePlayerPositionResult = await ConData.CreatePlayerPosition(playerposition);

                DialogService.Close(playerposition);
            }
            catch (System.Exception conDataCreatePlayerPositionException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new PlayerPosition!");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(FemiFriendsApp.Models.ConData.MyFriend args)
        {
            try
            {
                var conDataUpdateMyFriendResult = await ConData.UpdateMyFriend(FriendID, myfriend);

                DialogService.Close(myfriend);
            }
            catch (System.Exception conDataUpdateMyFriendException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update MyFriend");
            }
        }
Пример #18
0
        protected async System.Threading.Tasks.Task Form0Submit(FemiFriendsApp.Models.ConData.State args)
        {
            try
            {
                var conDataUpdateStateResult = await ConData.UpdateState(StateID, state);

                DialogService.Close(state);
            }
            catch (System.Exception conDataUpdateStateException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update State");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(CaApp.Models.ConData.Country args)
        {
            try
            {
                var conDataCreateCountryResult = await ConData.CreateCountry(country : country);

                DialogService.Close(country);
            }
            catch (System.Exception conDataCreateCountryException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Country!");
            }
        }
Пример #20
0
        //custom method to delete Gender

        private async Task MuyikDeleteGender()
        {
            try
            {
                await ConData.DeleteGender(GenderID);//passing in page parameter GenderID to DeleteGender method

                UriHelper.NavigateTo("genders", true);
            }
            catch (Exception ex)
            {
                NotificationService.Notify(NotificationSeverity.Error, "Error On Delete", "An Error Occurred While Deleting Gender Record!", 5000);
            }
        }
Пример #21
0
        protected async System.Threading.Tasks.Task Form0Submit(SelectStoredProcedureRadzen.Models.ConData.Market args)
        {
            try
            {
                var conDataCreateMarketResult = await ConData.CreateMarket(market);

                DialogService.Close(market);
            }
            catch (System.Exception conDataCreateMarketException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Market!");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(SoccerLeagueTransferApp.Models.ConData.Player args)
        {
            try
            {
                var conDataUpdatePlayerResult = await ConData.UpdatePlayer(PlayerID, player);

                DialogService.Close(player);
            }
            catch (System.Exception conDataUpdatePlayerException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Player");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(CaApp.Models.ConData.Student args)
        {
            try
            {
                var conDataUpdateStudentResult = await ConData.UpdateStudent(studentId : StudentID, student : student);

                DialogService.Close(student);
            }
            catch (System.Exception conDataUpdateStudentException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Student");
            }
        }
Пример #24
0
        //method to delete user

        private async Task MuyikDeleteUser()
        {
            try
            {
                await ConData.DeleteUser(user.UserID);

                UriHelper.NavigateTo("users", true);
            }
            catch (Exception ex)
            {
                NotificationService.Notify(NotificationSeverity.Error, "Error On User Delete", "An Error Occurred While You Were Deleting This User.Please Contact System Admin");
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(SoccerLeagueTransferApp.Models.ConData.ClubDetail args)
        {
            try
            {
                var conDataUpdateClubDetailResult = await ConData.UpdateClubDetail(TeamID, clubdetail);

                DialogService.Close(clubdetail);
            }
            catch (System.Exception conDataUpdateClubDetailException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update ClubDetail");
            }
        }
Пример #26
0
        protected async System.Threading.Tasks.Task Form0Submit(FemiFriendsApp.Models.ConData.Gender args)
        {
            try
            {
                var conDataUpdateGenderResult = await ConData.UpdateGender(GenderID, gender);

                DialogService.Close(gender);
            }
            catch (System.Exception conDataUpdateGenderException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Gender");
            }
        }
Пример #27
0
        //method to load current user roles

        private async Task MuyikGetCurrentUserRoles()
        {
            var usersInRoles = await ConData.MuyikGetExistingUserRoles(user.UserID);


            if (usersInRoles.Any())
            {
                foreach (UsersInRole userInRole in usersInRoles)
                {
                    userRoleList = userRoleList + userInRole.Role.RoleName + " ";
                }
            }
        }
        protected async System.Threading.Tasks.Task Form0Submit(FemiFriendsApp.Models.ConData.Country args)
        {
            try
            {
                var conDataUpdateCountryResult = await ConData.UpdateCountry(CountryID, country);

                DialogService.Close(country);
            }
            catch (System.Exception conDataUpdateCountryException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Country");
            }
        }
Пример #29
0
        protected async System.Threading.Tasks.Task Form0Submit(SoccerLeagueTransferApp.Models.ConData.Gender args)
        {
            try
            {
                var conDataCreateGenderResult = await ConData.CreateGender(gender);

                DialogService.Close(gender);
            }
            catch (System.Exception conDataCreateGenderException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Gender!");
            }
        }
Пример #30
0
        private async Task MuyikCreateNewMarket()
        {
            try
            {
                await ConData.MuyikAddNewMarket(market.MarketLocation, market.MarketName, market.MarketSizeInHectares);

                UriHelper.NavigateTo("markets", true);
            }
            catch (Exception)
            {
                NotificationService.Notify(NotificationSeverity.Error, "Market Insert Error", "An Error Occurred While Creating The New Market", 7000);
            }
        }