Ejemplo n.º 1
0
 public ActionResult Create(aspnet_MPRoles model)
 {
     ViewData["Message"] = "Success!";
     MoneyPacificRoleProvider provider = new MoneyPacificRoleProvider();
     provider.CreateRole(model.RoleName);
     return View();
 }
Ejemplo 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();            
        }
Ejemplo n.º 3
0
        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();
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the aspnet_MPRoles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToaspnet_MPRoles(aspnet_MPRoles aspnet_MPRoles)
 {
     base.AddObject("aspnet_MPRoles", aspnet_MPRoles);
 }
 /// <summary>
 /// Create a new aspnet_MPRoles object.
 /// </summary>
 /// <param name="roleId">Initial value of the RoleId property.</param>
 public static aspnet_MPRoles Createaspnet_MPRoles(global::System.Int32 roleId)
 {
     aspnet_MPRoles aspnet_MPRoles = new aspnet_MPRoles();
     aspnet_MPRoles.RoleId = roleId;
     return aspnet_MPRoles;
 }