// **************************************
        // URL: /Account/LogOn
        // **************************************

        public ActionResult LoadHtmlFromDB()
        {
            ASPNETDBEntities1 db = new ASPNETDBEntities1();
            string message;
            Test testObj = db.Tests.First<Test>();
            message = testObj.Description;
            TestViewModel model = new TestViewModel();
            model.message = message;

            //ViewData["message"] = message;
            return View(model);
            
        }
Exemplo n.º 2
0
        public override void CreateRole(string roleName)
        {
            // throw new NotImplementedException();
            ASPNETDBEntities1 db = new ASPNETDBEntities1();

            //aspnet_MPRoles newRole = db.aspnet_MPRoles.CreateObject();

            aspnet_MPRoles newRole = new aspnet_MPRoles();
            newRole.RoleName = roleName;
            newRole.LowerRoleNam = roleName.ToLower();

            db.aspnet_MPRoles.AddObject(newRole);
            //db.SaveChanges();
            db.Connection.Close();            
        }
        public ActionResult Create()
        {
            ASPNETDBEntities1 db = new ASPNETDBEntities1();

            string roleName = "LeThanhDung";
            //aspnet_MPRoles newRole = db.aspnet_MPRoles.CreateObject();

            aspnet_MPRoles newRole = new aspnet_MPRoles();
            newRole.RoleName = roleName;
            newRole.LowerRoleNam = roleName.ToLower();

            db.aspnet_MPRoles.AddObject(newRole);

            db.SaveChanges();
            db.Connection.Close(); 
            return View();
        }