Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "moustafa"

Hello before i wrote this topic i read the documentation related to Dependency Injection [http://www.aspnetboilerplate.com/Pages/Documents/Dependency-Injection]) and other related documentation [http://www.aspnetboilerplate.com/Pages/Documents/Repositories])

but i'm still need help and advice in my case , maybe for some of you my questions are naive , for other are easy , on the other hand for someone like me its confused and need answers to put things together and make the big picture clear as possible as we can

so i have a class that have one of more properties used to retrieve static data (not coming from database) , i tried to use dependency injection structure descried in the documentation but still have doubts that what's i'm doing is not totally true Q1- can anyone correct me if i'm wrong with what i done here? Q2- can you provide me with different ways (practical examples) to accomplish my task based on my code below and please don't refer me to external links :) ? Q3- what is the write place to put these classes in my project ?

Classes & Interfaces

1- BlockedPermissions.cs

public class BlockedPermissions
    {
        public string Name { get; set; }
    }

2-IBlockedPermissionsAppService.cs (never used in my code)

public interface IBlockedPermissionsAppService : IApplicationService
    {
        List<BlockedPermissions> GetList();
    }

3- BlockedPermissionsAppService.cs

public class BlockedPermissionsAppService
    {
        private IBlockedPermissionsRepository _blockedPermissionsRepository;

        public BlockedPermissionsAppService(IBlockedPermissionsRepository blockedPermissionsRepository)
        {
            _blockedPermissionsRepository = blockedPermissionsRepository;
        }
        public List<BlockedPermissions> GetList()
        {
            var lst = _blockedPermissionsRepository.GetList();
            return lst;
        }
    }

4- IBlockedPermissionsRepository.cs

public interface IBlockedPermissionsRepository 
    {
        List<BlockedPermissions> GetList();
    }

5- BlockedPermissionsRepository.cs

public class BlockedPermissionsRepository : IBlockedPermissionsRepository
    {
        public List<BlockedPermissions> GetList()
        {
            List<BlockedPermissions> lst = new List<BlockedPermissions>();
            lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages" });
            lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages.Create" });
            lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages.Edit" });
            lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages.Delete" });
           return lst;
      }

Finally i use this code to retrieve the list

var blockedPermissionsAppService = new BlockedPermissionsAppService(new BlockedPermissionsRepository());
            var lst = blockedPermissionsAppService.GetList();

Sorry to prolong and thank you :)

Hello i'm trying to get current authenticated user's information using this code

var r = new SessionAppService().GetCurrentLoginInformations(); string userName = r.Result.User.UserName;

but it's not work as r.Result always null

is that the right piece of code to accomplish this task?

Hello , i need to report a simple error of type " Input string was not in a correct format." in changePassword.chtml which occurs when someone trying to change the password only when he use the arabic interface

this line particularly throw that error
<span class="help-block">@Html.Raw(L("PasswordChangeDontRememberMessage", "<a href=&quot;" + Url.Action("ForgotPassword", "Account") + "&quot;>" + L("ClickHere") + "</a>"))</span>

the problem is in arabic localization file <text name="PasswordChangeDontRememberMessage">إذا كنت لا تتذكر كلمة المرور {0} {</text> so you need to change it to be to fix the problem <text name="PasswordChangeDontRememberMessage">إذا كنت لا تتذكر كلمة المرور {0}.</text>

thank you

Hello

by default 'admin' user , 'admin' role are created , that's ok

i need to do the following scenario : two users created by default admin and superadmin two roles created by default admin and superadmin

the idea is superadmin user has all the permissions the admin has all the permissions except pages that specified by superadmin ex: languages, organization stucture, audit logs and the most important thing no one even admin can't see superadmins in users list and can't see those pages in role management page , and superadmin roles doesn't appear in roles page , in brief no one can see superadmin user and superadmin role at any page that uses roles logic , no one can use it to make any query except superadmin user

hoping the idea is clear , so how can i do that ?

**Hello every one

i was trying to make sure that activation link sent to user after registration or from control panel by admin or throw email activation page <a class="postlink" href="http://localhost:6240/Account/EmailActivation">http://localhost:6240/Account/EmailActivation</a>

but it's not working

first of all in MyProjectCoreModule.cs i enabled email sending in debug mode IocManager.Register<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient);

and set the smtp settings and i'm very sure that its valid data but i have dobt about specific fields smtp host (no problem) smtp port (no problem) domain name (?????) username (??????) password (no problem) ssl (no problem)

but nothing works i tried for hours now so what i am missing ? can someone explains this for me ? thank you in advance**

Showing 31 to 35 of 35 entries