This project is read-only.

I've Started the beer house MVC3 project

Topics: Developer Forum, Project Management Forum, User Forum
Jun 4, 2013 at 10:49 AM
I've Started the beer house MVC3 project at
I changed some code:
  1. Change in web.config to run website in host
    ___<remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=(local);Integrated Security=false;Initial Catalog=TheBeerHouse;User;;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    <add name="ApplicationServices" connectionString="data source=(local);Integrated Security=false;Initial Catalog=TheBeerHouse;User;;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    <add name="TheBeerHouseDataContext" connectionString="Data Source=(local);Integrated Security=false;Initial Catalog=TheBeerHouse;Persist Security Info=True;User;;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    <add name="DefaultConnection" connectionString="Data Source=(local);Initial Catalog=TheBeerHouse;Persist Security Info=True;User;;Integrated Security=false;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />___
  2. Change in function Edituser in UserController.cs file to change roles of user:
_//Is a list of all the user roles
        ArrayList removeRoleList = new ArrayList(Roles.GetAllRoles());

        //We are requesting the form variables directly from the form
        String key;
        String val="";
        for (int i = 0; i < Request.Form.Keys.Count; i++)//    (string key in Request.Form.Keys)
                val = Request.Form.GetValues(i).GetValue(0).ToString();
                val = "";

            if (key.StartsWith("role."))
                String userRole = key.Substring(5, key.Length - 5);
                if (val.EndsWith("true"))
                if (!Roles.IsUserInRole(id, userRole))
                    Roles.AddUserToRole(id, userRole);