public MobileRole populate( Role role ) { id = role.RoleId; name = role.RoleName; return this; }
public ActionResult Create() { var r = new Role { RoleName = "NEW" }; DbUtil.Db.Roles.InsertOnSubmit(r); DbUtil.Db.SubmitChanges(); return Redirect("/Setup/Roles/"); }
public static int CreateRole(CMSDataContext db, string name) { bool? hardwired = null; if (Hardwired().Contains(name)) hardwired = true; var role = new Role {Hardwired = hardwired, RoleName = name}; db.Roles.InsertOnSubmit(role); db.SubmitChanges(); return role.RoleId; }